[WinCairo] Add WebKit platform files for wincairo webkit
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-10-25  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2
3         [WinCairo] Add WebKit platform files for wincairo webkit
4         https://bugs.webkit.org/show_bug.cgi?id=178000
5
6         Reviewed by Alex Christensen.
7
8         * Platform/Module.h:
9         * Platform/SharedMemory.h:
10         (WebKit::SharedMemory::handle const):
11         * Platform/win/LoggingWin.cpp: Added. It is based on Source/WebCore/platform/win/LoggingWin.cpp
12         (WebKit::logLevelString):
13         * Platform/win/ModuleWin.cpp: Added.
14         (WebKit::Module::load):
15         (WebKit::Module::unload):
16         (WebKit::Module::platformFunctionPointer const):
17         * Platform/win/SharedMemoryWin.cpp: Added.
18         (WebKit::SharedMemory::Handle::Handle):
19         (WebKit::SharedMemory::Handle::~Handle):
20         (WebKit::SharedMemory::Handle::isNull const):
21         (WebKit::SharedMemory::Handle::encode const):
22         (WebKit::SharedMemory::Handle::clear):
23         (WebKit::getDuplicatedHandle):
24         (WebKit::SharedMemory::Handle::decode):
25         (WebKit::protectAttribute):
26         (WebKit::SharedMemory::allocate):
27         (WebKit::SharedMemory::create):
28         (WebKit::accessRights):
29         (WebKit::SharedMemory::map):
30         (WebKit::SharedMemory::adopt):
31         (WebKit::SharedMemory::~SharedMemory):
32         (WebKit::SharedMemory::createHandle):
33         (WebKit::SharedMemory::systemPageSize):
34         * PlatformWin.cmake:
35
36 2017-10-25  Chris Dumez  <cdumez@apple.com>
37
38         Add support for unregistering a service worker
39         https://bugs.webkit.org/show_bug.cgi?id=178735
40
41         Reviewed by Brady Eidson.
42
43         Add support for unregistering a service worker:
44         - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister
45
46         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
47         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
48         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
49         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
50         * WebProcess/Storage/WebSWClientConnection.messages.in:
51
52 2017-10-25  Chris Dumez  <cdumez@apple.com>
53
54         Make SharedStringHashTable less error prone
55         https://bugs.webkit.org/show_bug.cgi?id=178764
56
57         Reviewed by Youenn Fablet.
58
59         SharedStringHashTable is backed by SharedMemory and this SharedMemory
60         may be readonly (and is when used in the WebContent process). As a result,
61         some of the operations on SharedStringHashTable that write to this shared
62         memory will crash if called and the SharedMemory is readonly.
63
64         To make this less error prone, introduce a new SharedStringHashTableReadOnly
65         base class for SharedStringHashTable and only keep the operations that
66         write to the shared memory on SharedStringHashTableReadOnly (namely, add() /
67         remove() / clear(). Update VisitedLinkTableController and WebSWOriginTable
68         to use SharedStringHashTableReadOnly since they are instantiated in the
69         WebContent process and use readonly shared memory.
70
71         * Shared/SharedStringHashTable.cpp:
72         (WebKit::SharedStringHashTableReadOnly::SharedStringHashTableReadOnly):
73         (WebKit::SharedStringHashTableReadOnly::~SharedStringHashTableReadOnly):
74         (WebKit::SharedStringHashTableReadOnly::setSharedMemory):
75         (WebKit::doubleHash):
76         (WebKit::SharedStringHashTableReadOnly::contains const):
77         (WebKit::SharedStringHashTableReadOnly::findSlot const):
78         (WebKit::SharedStringHashTable::SharedStringHashTable):
79         (WebKit::SharedStringHashTable::~SharedStringHashTable):
80         (WebKit::SharedStringHashTable::add):
81         (WebKit::SharedStringHashTable::remove):
82         (WebKit::SharedStringHashTable::clear):
83         * Shared/SharedStringHashTable.h:
84         * WebProcess/Storage/WebSWOriginTable.h:
85         * WebProcess/WebPage/VisitedLinkTableController.cpp:
86         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
87         * WebProcess/WebPage/VisitedLinkTableController.h:
88
89 2017-10-25  Adrian Perez de Castro  <aperez@igalia.com>
90
91         [WPE] Remove GLib API functions which use Cairo
92         https://bugs.webkit.org/show_bug.cgi?id=178205
93
94         Reviewed by Michael Catanzaro.
95
96         Add PLATFORM(GTK) guards for the parts of of the GLib API which use cairo_surface_t (web
97         page snapshots and favicons), and remove the affected function prototypes from public API
98         headers. This way, the WPE version of the API is not tied to Cairo.
99
100         * PlatformWPE.cmake:
101         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
102         * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h:
103         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
104         * UIProcess/API/glib/WebKitWebView.cpp:
105         (webkitWebViewConstructed):
106         (webkitWebViewGetProperty):
107         (webkitWebViewDispose):
108         (webkit_web_view_class_init):
109         (webkitWebViewLoadChanged):
110         * UIProcess/API/glib/WebKitWebViewPrivate.h:
111         * UIProcess/API/wpe/WebKitFaviconDatabase.h:
112         * UIProcess/API/wpe/WebKitWebView.h:
113         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
114         (webkitWebPageDidReceiveMessage):
115
116 2017-10-25  Zan Dobersek  <zdobersek@igalia.com>
117
118         Make SERVICE_WORKER feature buildable on GTK, WPE
119         https://bugs.webkit.org/show_bug.cgi?id=178574
120
121         Reviewed by Carlos Garcia Campos.
122
123         * CMakeLists.txt: Add missing files to the build.
124         * StorageProcess/StorageProcess.cpp:
125         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
126         IPC::Attachment object should be accessed through an rvalue reference,
127         making it mutable and enabling releasing the file descriptor.
128         * StorageProcess/StorageProcess.h: Adjust the method signature.
129         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
130         Explicitly include the ResourceError header from WebCore (using a forwarding header).
131         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
132         Include the CachedResource header from WebCore (again using a forwarding header).
133         * WebProcess/Storage/WebServiceWorkerProvider.h: Forward-declare the WebCore::CachedResource type.
134
135 2017-10-24  Youenn Fablet  <youenn@apple.com>
136
137         ServiceWorkerClientFetch should return an error that is not null in case of failure
138         https://bugs.webkit.org/show_bug.cgi?id=178761
139
140         Reviewed by Geoffrey Garen.
141
142         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
143         (WebKit::ServiceWorkerClientFetch::didFail): Generating a General error.
144
145 2017-10-24  Youenn Fablet  <youenn@apple.com>
146
147         Enable service worker to use cache storage api
148         https://bugs.webkit.org/show_bug.cgi?id=178684
149
150         Reviewed by Brady Eidson.
151
152         Passing the WebPreferences store of the default page group of the WebProcessPool to its ServiceWorker process.
153         ServiceWorkerContextManager then uses it to initialize the preferences accordingly.
154         Patch is covered by new test which is using cache api previously disabled and now enabled through the store.
155
156         Made use of the new ServiceWorkerThreadProxy in ServiceWorkerContextManager to enable a cache storage connection.
157         Fixed the default size of quota in WebsiteDataStore.
158
159         * UIProcess/WebProcessPool.cpp:
160         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
161         * UIProcess/WebsiteData/WebsiteDataStore.h:
162         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
163         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
164         (WebKit::ServiceWorkerContextManager::updatePreferences):
165         (WebKit::ServiceWorkerContextManager::startServiceWorker):
166         (WebKit::ServiceWorkerContextManager::startFetch):
167         * WebProcess/Storage/ServiceWorkerContextManager.h:
168         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): Deleted.
169         * WebProcess/WebProcess.cpp:
170         (WebKit::WebProcess::getWorkerContextConnection):
171         * WebProcess/WebProcess.h:
172         * WebProcess/WebProcess.messages.in:
173
174 2017-10-24  Alex Christensen  <achristensen@webkit.org>
175
176         Selecting and right-clicking URL-like strings with IDNA-disallowed characters in host or authority causes rendering engine crash
177         https://bugs.webkit.org/show_bug.cgi?id=174267
178
179         Reviewed by Tim Horton.
180
181         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
182         (WKBundlePageCanHandleRequest):
183
184 2017-10-24  Chris Dumez  <cdumez@apple.com>
185
186         Add initial implementation for serviceWorker.postMessage()
187         https://bugs.webkit.org/show_bug.cgi?id=178534
188
189         Reviewed by Youenn Fablet.
190
191         Add initial implementation for serviceWorker.postMessage():
192         - https://w3c.github.io/ServiceWorker/#service-worker-postmessage
193
194         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
195         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
196         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
197         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
198         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
199         (WebKit::ServiceWorkerContextManager::postMessageToServiceWorkerGlobalScope):
200         * WebProcess/Storage/ServiceWorkerContextManager.h:
201         * WebProcess/Storage/ServiceWorkerContextManager.messages.in:
202         * WebProcess/Storage/WebSWClientConnection.cpp:
203         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
204         * WebProcess/Storage/WebSWClientConnection.h:
205
206 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
207
208         Adopt new secure coding APIs
209         https://bugs.webkit.org/show_bug.cgi?id=178484
210         <rdar://problem/34837193>
211
212         Reviewed by Tim Horton.
213
214         Switch to new NSKeyed[Un]Archiver methods that active and use
215         NSSecureCoding by default.
216
217         * Platform/ios/AccessibilityIOS.mm:
218         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
219         * Shared/Cocoa/DataDetectionResult.mm:
220         (WebKit::DataDetectionResult::encode const): Ditto.
221         (WebKit::DataDetectionResult::decode): Ditto.
222         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
223         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
224         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
225         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
226         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
227         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
228         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
229         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
230         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
231         * Shared/ios/InteractionInformationAtPosition.mm:
232         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
233         (WebKit::InteractionInformationAtPosition::decode): Ditto.
234         * Shared/mac/WebCoreArgumentCodersMac.mm:
235         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
236         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
237         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
238         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
239         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
240         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
241         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
242         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
243         * Shared/mac/WebHitTestResultData.mm:
244         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
245         (WebKit::WebHitTestResultData::platformDecode): Ditto.
246         * UIProcess/API/Cocoa/WKProcessPool.mm:
247         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
248         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
249         * UIProcess/API/Cocoa/WKWebView.mm:
250         (-[WKWebView _setInputDelegate:]): Ditto.
251         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
252         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
253         * UIProcess/ios/PageClientImplIOS.mm:
254         (WebKit::PageClientImpl::startAssistingNode): Ditto.
255         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
256         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
257         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
258         (WebKit::InjectedBundle::initialize): Ditto.
259         (WebKit::InjectedBundle::setBundleParameter): Ditto.
260         (WebKit::InjectedBundle::setBundleParameters): Ditto.
261
262 2017-10-24  Sam Weinig  <sam@webkit.org>
263
264         [Settings] Add initial support for generating preferences related code
265         https://bugs.webkit.org/show_bug.cgi?id=178656
266
267         Reviewed by Dean Jackson.
268
269         As a first step towards getting off the macros in WebPreferencesDefinitions.h
270         and reducing the overhead of adding a preference, this change generates adds
271         WebPreferences.yaml where preference changes will go, and generates much of
272         WebPreferencesDefinitions.h from it (all the custom defaults moved to 
273         WebPreferencesDefinitionsBase.h). Subsequent changes will remove the need for 
274         the macros in WebPreferencesDefinitions.h entirely.
275
276         * CMakeLists.txt:
277         * DerivedSources.make:
278         * WebKit.xcodeproj/project.pbxproj:
279         
280             Add new files / rules to generate WebPreferencesDefinitions.h.
281         
282         * Scripts/GeneratePreferences.rb: Added.
283         * Scripts/PreferencesTemplates: Added.
284         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: Added.
285         
286             Add scripts and template to generate WebPreferencesDefinitions.h from
287             WebPreferences.yaml.
288
289         * Shared/WebPreferences.yaml: Added.
290         
291             Configuration file for preferences.
292         
293         * Shared/WebPreferencesDefinitions.h: Removed.
294         * Shared/WebPreferencesDefinitionsBase.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitions.h.
295         
296             Moved custom defaults to new WebPreferencesDefinitionsBase.h. Removed the need for 
297             FOR_EACH_WEBKIT_STRING_PREFERENCE by using custom defaults for the font family values.
298
299 2017-10-24  Matt Lewis  <jlewis3@apple.com>
300
301         Unreviewed, rolling out r223889.
302
303         This caused multiple crashes on all platforms
304
305         Reverted changeset:
306
307         "Adopt new secure coding APIs"
308         https://bugs.webkit.org/show_bug.cgi?id=178484
309         https://trac.webkit.org/changeset/223889
310
311 2017-10-24  Youenn Fablet  <youenn@apple.com>
312
313         ASSERTION FAILED: !m_serviceWorkerManager in WebProcess::getWorkerContextConnection() on API tests
314         https://bugs.webkit.org/show_bug.cgi?id=178586
315         <rdar://problem/35115902>
316
317         Reviewed by Brady Eidson.
318
319        Covered by API tests no longer crashing.
320
321         * UIProcess/WebProcessPool.cpp:
322         (WebKit::WebProcessPool::getWorkerContextProcessConnection): Sending a worker context process connection message only at creation of the service worker process.
323
324 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
325
326         Adopt new secure coding APIs
327         https://bugs.webkit.org/show_bug.cgi?id=178484
328         <rdar://problem/34837193>
329
330         Reviewed by Tim Horton.
331
332         Switch to new NSKeyed[Un]Archiver methods that active and use
333         NSSecureCoding by default.
334
335         * Platform/ios/AccessibilityIOS.mm:
336         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
337         * Shared/Cocoa/DataDetectionResult.mm:
338         (WebKit::DataDetectionResult::encode const): Ditto.
339         (WebKit::DataDetectionResult::decode): Ditto.
340         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
341         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
342         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
343         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
344         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
345         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
346         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
347         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
348         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
349         * Shared/ios/InteractionInformationAtPosition.mm:
350         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
351         (WebKit::InteractionInformationAtPosition::decode): Ditto.
352         * Shared/mac/WebCoreArgumentCodersMac.mm:
353         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
354         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
355         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
356         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
357         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
358         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
359         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
360         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
361         * Shared/mac/WebHitTestResultData.mm:
362         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
363         (WebKit::WebHitTestResultData::platformDecode): Ditto.
364         * UIProcess/API/Cocoa/WKProcessPool.mm:
365         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
366         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
367         * UIProcess/API/Cocoa/WKWebView.mm:
368         (-[WKWebView _setInputDelegate:]): Ditto.
369         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
370         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
371         * UIProcess/ios/PageClientImplIOS.mm:
372         (WebKit::PageClientImpl::startAssistingNode): Ditto.
373         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
374         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
375         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
376         (WebKit::InjectedBundle::initialize): Ditto.
377         (WebKit::InjectedBundle::setBundleParameter): Ditto.
378         (WebKit::InjectedBundle::setBundleParameters): Ditto.
379
380 2017-10-24  Zan Dobersek  <zdobersek@igalia.com>
381
382         [GTK][WPE] generate-forwarding-headers.pl should also scan derived sources in WebKit framework
383         https://bugs.webkit.org/show_bug.cgi?id=178579
384
385         Reviewed by Carlos Garcia Campos.
386
387         * PlatformGTK.cmake: When generating forwarding headers, derived sources
388         should be scanned as well. The DERIVED_SOURCES_WEBKIT_DIR value has to
389         be passed as an include path to the generate-forward-headers.pl script
390         to achieve that. This target then also has to depend on all the derived
391         source files to be generated before this can be performed.
392         * PlatformWPE.cmake: Ditto.
393
394 2017-10-23  Brian Burg  <bburg@apple.com>
395
396         [Cocoa] Web Automation: add SPI to tell whether the automation session is currently simulating user interactions
397         https://bugs.webkit.org/show_bug.cgi?id=178616
398
399         Reviewed by Joseph Pecoraro.
400
401         This is needed to disambiguate whether an action (such as selectAll:) came from
402         a user clicking on "Edit > Select All" in a menu or whether it was produced by
403         simulating the keystrokes to produce the chord for "Command + a". Some clients,
404         such as Safari, would allow the latter but not the former during automation.
405
406         * UIProcess/API/Cocoa/_WKAutomationSession.h:
407         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
408         (-[_WKAutomationSession isSimulatingUserInteraction]):
409         Add new SPI property that's backed by the same WebAutomationSession method.
410
411         * UIProcess/Automation/WebAutomationSession.h:
412         * UIProcess/Automation/WebAutomationSession.cpp:
413         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
414         (WebKit::WebAutomationSession::performMouseInteraction):
415         (WebKit::WebAutomationSession::performKeyboardInteractions):
416         Set m_simulatingUserInteraction prior to sending the synthesized events. It will
417         be cleared when keyboardEventsFlushedForPage() is called by WebPageProxy.
418
419         * UIProcess/WebPageProxy.cpp:
420         (WebKit::WebPageProxy::didReceiveEvent):
421         Notify the automation session that the key event queue was flushed *after* giving
422         delegates a chance to do something with the key event. This is necessary so that
423         any actions that are created from the NSEvent by the delegates are handled prior
424         to the automation session finishing its keyboard interaction command.
425
426 2017-10-23  Brian Burg  <bburg@apple.com>
427
428         [Mac] Web Automation: key modifiers for synthesized NSEvents are incorrect
429         https://bugs.webkit.org/show_bug.cgi?id=178615
430
431         Reviewed by Joseph Pecoraro.
432
433         In both PLATFORM(MAC) platform methods for simulating keyboard interactions,
434         we errantly relied on +[NSEvent modifierFlags] to get the current state of
435         sticky modifiers when creating synthesized events. This is incorrect for two reasons:
436         modifierFlags is never updated when simulating a sequence of events (because
437         all the events are synthesized before any are delivered); and the NSEvent class
438         method only reflects the modifier state of the primary physical keyboard, which
439         is not affected by synthesized NSEvents that happen to have modifier flags.
440
441         Instead, just keep our own m_currentModifiers state in the session and compute
442         the necessary NSEventModifierFlags to put on each synthesized event. This aligns
443         the implementation with the treatment of sticky keys in the iOS and GTK platform methods.
444
445         * UIProcess/Automation/WebAutomationSession.h: Every port gets this variable now.
446         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
447         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
448         (WebKit::WebAutomationSession::platformSimulateKeySequence):
449         Use and update m_currentModifiers.
450
451 2017-10-23  Alex Christensen  <achristensen@webkit.org>
452
453         Fix ASAN test after r222824
454         https://bugs.webkit.org/show_bug.cgi?id=178688
455         <rdar://problem/35104706>
456
457         Reviewed by Tim Horton.
458
459         * UIProcess/WebBackForwardList.cpp:
460         (WebKit::WebBackForwardList::clear):
461         Resizing a list of Ref<T> after we've WTFMoved all the elements doesn't make ASAN happy.
462
463 2017-10-23  Tim Horton  <timothy_horton@apple.com>
464
465         Stop using _UIApplicationUsesLegacyUI()
466         https://bugs.webkit.org/show_bug.cgi?id=178680
467         <rdar://problem/35131949>
468
469         Reviewed by Dan Bernstein.
470
471         * Platform/spi/ios/UIKitSPI.h:
472         * UIProcess/ios/forms/WKFormSelectPopover.mm:
473         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
474         (-[WKSelectPopover initWithView:hasGroups:]):
475         Resolve _UIApplicationUsesLegacyUI to false and simplify.
476
477 2017-10-23  Ryan Haddad  <ryanhaddad@apple.com>
478
479         Unreviewed, suppress deprecation warnings to fix the build.
480         <rdar://problem/35131949>
481
482         * UIProcess/ios/forms/WKFormSelectPopover.mm:
483         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
484         (-[WKSelectPopover initWithView:hasGroups:]):
485
486 2017-10-23  Youenn Fablet  <youenn@apple.com>
487
488         TestController should clear all fetch caches when resetting its state
489         https://bugs.webkit.org/show_bug.cgi?id=178486
490         <rdar://problem/35066305>
491
492         Reviewed by Chris Dumez.
493
494         Adding a new DidNotHandle message to disambiguate with the DidFail fetch case.
495         With DidNotHandle, the loading should go the network process.
496         With DidFail, the loading should return a network error.
497
498         On receiving an order to start a fetch, ServiceWorkerThread will dispatch a fetch event.
499         The client of this event will retrieve the response and return it to the WebProcess through IPC.
500
501         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
502         (WebKit::WebSWServerConnection::didNotHandleFetch):
503         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
504         * StorageProcess/StorageProcess.cpp:
505         (WebKit::StorageProcess::didNotHandleFetch):
506         * StorageProcess/StorageProcess.h:
507         * StorageProcess/StorageProcess.messages.in:
508         * WebKit.xcodeproj/project.pbxproj:
509         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
510         (WebKit::ServiceWorkerClientFetch::didFail):
511         (WebKit::ServiceWorkerClientFetch::didNotHandle):
512         * WebProcess/Storage/ServiceWorkerClientFetch.h:
513         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
514         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
515         (WebKit::ServiceWorkerContextManager::startFetch):
516         * WebProcess/Storage/ServiceWorkerContextManager.h:
517         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: Added.
518         (WebKit::WebServiceWorkerFetchTaskClient::~WebServiceWorkerFetchTaskClient):
519         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
520         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
521         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
522         (WebKit::WebServiceWorkerFetchTaskClient::didFail):
523         (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
524         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: Added.
525         * WebProcess/WebProcess.cpp:
526         (WebKit::WebProcess::startFetchInServiceWorker):
527         * WebProcess/WebProcess.h:
528
529 2017-10-22  Wenson Hsieh  <wenson_hsieh@apple.com>
530
531         [iOS] WebProcess::initializeWebProcess spends ~150ms spinning up AVSystemController on some devices
532         https://bugs.webkit.org/show_bug.cgi?id=178640
533         <rdar://problem/35113105>
534
535         Reviewed by Youenn Fablet.
536
537         In r213933, we added a mechanism to allow the web process to drive media capture, by setting an attribute on the
538         shared AVSystemController. This requires us to fault in the Celestial framework, which is a slight performance
539         hit on some hardware. Instead of doing this at the start of every web process launch, we can just do this work
540         lazily, the first time the web process requests permissions for user media access.
541
542         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
543         (WebKit::WebUserMediaClient::requestUserMediaAccess):
544         * WebProcess/WebPage/WebPage.cpp:
545         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
546         * WebProcess/WebPage/WebPage.h:
547         * WebProcess/WebPage/ios/WebPageIOS.mm:
548         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
549         * WebProcess/cocoa/WebProcessCocoa.mm:
550         (WebKit::WebProcess::platformInitializeWebProcess):
551
552 2017-10-21  Michael Catanzaro  <mcatanzaro@igalia.com>
553
554         Unreviewed, silence a -Wunused-but-set-variable warning
555
556         * WebProcess/WebPage/EventDispatcher.cpp:
557         (WebKit::EventDispatcher::wheelEvent):
558
559 2017-10-20  Alex Christensen  <achristensen@webkit.org>
560
561         Add FIXME comment after r223803
562         https://bugs.webkit.org/show_bug.cgi?id=178418
563
564         * UIProcess/WebProcessPool.cpp:
565         (WebKit::WebProcessPool::ensureNetworkProcess):
566         We need some work to better support customized persistent data stores.  Add a comment indicating such.
567
568 2017-10-20  Alex Christensen  <achristensen@webkit.org>
569
570         Fix API tests after r223791.
571         https://bugs.webkit.org/show_bug.cgi?id=178418
572
573         * UIProcess/WebProcessPool.cpp:
574         (WebKit::WebProcessPool::ensureNetworkProcess):
575         Whatever NetworkSessionInitializationParameters we send with the NetworkProcess initialization message,
576         that's the default session.  This is needed for WebKit.WebsiteDataStoreCustomPaths.
577         (WebKit::WebProcessPool::createNewWebProcess):
578         Don't change behavior or NetworkProcess initialization like I did in r223791.
579
580 2017-10-20  Alex Christensen  <achristensen@webkit.org>
581
582         Fix download tests on El Capitan after r223730
583         https://bugs.webkit.org/show_bug.cgi?id=178547
584
585         * UIProcess/Downloads/DownloadProxy.cpp:
586         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
587         Revert to original behavior.  This uses suggestedFilename, which may have come from places like
588         the download attribute, instead of always using the filename from CFNetwork.
589
590 2017-10-20  Alex Christensen  <achristensen@webkit.org>
591
592         Expose _boundInterfaceIdentifier and _allowsCellularAccess to WKWebsiteDataStorePrivate
593         https://bugs.webkit.org/show_bug.cgi?id=178418
594         <rdar://problem/29599569>
595
596         Reviewed by Tim Horton.
597         
598         In r213747 I introduced allowsCellularAccess to _WKProcessPoolConfiguration because there
599         was no way to add parameters to the default (and other) NetworkSession constructors.  Since
600         clients have not adopted this SPI, we can introduce such a way in NetworkSessionCreationParameters
601         and move the SPI to WKWebsiteDataStore, which is where it and other NetworkSession properties
602         ought to be instead of making them WKProcessPool global.
603
604         We also need to expose access to NSURLRequest.boundInterfaceIdentifier.  Instead of serializing and
605         deserializing that property for each NSURLRequest and then having subresources mysteriously jump back
606         to having no bound interface identifiers, I'm adding this to WKWebsiteDataStore, too, to make it a
607         session networking property.
608         
609         I manually verified that these properties are being set properly with a custom test app and added logs.
610         Unfortunately, these properties don't do anything under circumstances anywhere close to what we test.
611         The architecture change of having NetworkSessionCreationParameters is verified to not have a change in
612         behavior by existing tests, such as any test that uses TestProtocol (which we should eventually remove).
613
614         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
615         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
616         * NetworkProcess/NetworkProcess.cpp:
617         (WebKit::NetworkProcess::NetworkProcess):
618         (WebKit::NetworkProcess::initializeNetworkProcess):
619         (WebKit::NetworkProcess::clearCachedCredentials):
620         * NetworkProcess/NetworkProcessCreationParameters.cpp:
621         (WebKit::NetworkProcessCreationParameters::encode const):
622         (WebKit::NetworkProcessCreationParameters::decode):
623         * NetworkProcess/NetworkProcessCreationParameters.h:
624         * NetworkProcess/NetworkSession.cpp:
625         (WebKit::NetworkSession::create):
626         (WebKit::NetworkSession::defaultSession): Deleted.
627         * NetworkProcess/NetworkSession.h:
628         * NetworkProcess/NetworkSessionCreationParameters.h: Added.
629         (WebKit::NetworkSessionCreationParameters::encode const):
630         (WebKit::NetworkSessionCreationParameters::decode):
631         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
632         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
633         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
634         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
635         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
636         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
637         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
638         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
639         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
640         (WebKit::NetworkSessionCocoa::create):
641         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
642         (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Deleted.
643         (WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Deleted.
644         (WebKit::NetworkSessionCocoa::defaultSession): Deleted.
645         * NetworkProcess/mac/RemoteNetworkingContext.mm:
646         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
647         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
648         * Shared/SessionTracker.cpp:
649         (WebKit::SessionTracker::networkSession):
650         (WebKit::SessionTracker::setSession):
651         * Shared/WebsiteDataStoreParameters.cpp:
652         (WebKit::WebsiteDataStoreParameters::encode const):
653         (WebKit::WebsiteDataStoreParameters::decode):
654         * Shared/WebsiteDataStoreParameters.h:
655         * UIProcess/API/APIProcessPoolConfiguration.cpp:
656         (API::ProcessPoolConfiguration::copy):
657         * UIProcess/API/APIProcessPoolConfiguration.h:
658         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
659         (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
660         (-[WKWebsiteDataStore _boundInterfaceIdentifier]):
661         (-[WKWebsiteDataStore _setAllowsCellularAccess:]):
662         (-[WKWebsiteDataStore _allowsCellularAccess]):
663         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
664         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
665         (-[_WKProcessPoolConfiguration allowsCellularAccess]):
666         (-[_WKProcessPoolConfiguration setAllowsCellularAccess:]):
667         * UIProcess/WebProcessPool.cpp:
668         (WebKit::WebProcessPool::ensureNetworkProcess):
669         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
670         * UIProcess/WebsiteData/WebsiteDataStore.h:
671         (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier):
672         (WebKit::WebsiteDataStore::boundInterfaceIdentifier):
673         (WebKit::WebsiteDataStore::setAllowsCellularAccess):
674         (WebKit::WebsiteDataStore::allowsCellularAccess):
675         * WebKit.xcodeproj/project.pbxproj:
676         * WebProcess/InjectedBundle/InjectedBundle.cpp:
677         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
678         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
679         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
680         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
681         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
682         * WebProcess/WebProcess.cpp:
683         (WebKit::WebProcess::ensurePrivateBrowsingSession):
684         (WebKit::WebProcess::clearCachedCredentials):
685
686 2017-10-20  Alex Christensen  <achristensen@webkit.org>
687
688         Add ObjC SPI to _WKDownloadDelegate missing from WKContextDownloadClient
689         https://bugs.webkit.org/show_bug.cgi?id=178566
690         <rdar://problem/23041906>
691
692         Reviewed by Brady Eidson.
693
694         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
695         * UIProcess/Cocoa/DownloadClient.h:
696         * UIProcess/Cocoa/DownloadClient.mm:
697         (WebKit::DownloadClient::DownloadClient):
698         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
699         (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType):
700         (WebKit::DownloadClient::didCreateDestination):
701         (WebKit::DownloadClient::processDidCrash):
702
703 2017-10-20  Youenn Fablet  <youenn@apple.com>
704
705         ResourceResponse should have a ServiceWorker source
706         https://bugs.webkit.org/show_bug.cgi?id=178593
707
708         Reviewed by Alex Christensen.
709
710         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
711         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): setting response source to ServiceWorker.
712         * WebProcess/Storage/ServiceWorkerClientFetch.h:
713
714 2017-10-20  Antoine Quint  <graouts@apple.com>
715
716         [Web Animations] Provide basic timeline and animation interfaces
717         https://bugs.webkit.org/show_bug.cgi?id=178526
718
719         Reviewed by Dean Jackson.
720
721         Remove the WEB_ANIMATIONS compile-time flag.
722
723         * Configurations/FeatureDefines.xcconfig:
724         * WebProcess/InjectedBundle/InjectedBundle.cpp:
725         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
726         (WebKit::InjectedBundle::setWebAnimationsEnabled):
727         * WebProcess/WebPage/WebPage.cpp:
728         (WebKit::WebPage::updatePreferences):
729
730 2017-10-02  Brian Burg  <bburg@apple.com>
731
732         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
733         https://bugs.webkit.org/show_bug.cgi?id=177661
734         <rdar://problem/34740286>
735
736         Reviewed by Joseph Pecoraro.
737
738         Move setup and delegates of the inspector frontend page into implementations of
739         WebInspectorProxy::platformCreateFrontendPage. The Mac implementation
740         will be subsumed by WKInspectorViewController, while the GTK implementation
741         is inherited from the cross-platform version that uses C API. Eventually the
742         GTK version should use GTK API rather than the soon to be deprecated C API.
743
744         * UIProcess/WebInspectorProxy.cpp:
745         (WebKit::WebInspectorProxy::createFrontendPage):
746         (WebKit::webProcessDidCrash): Deleted.
747         (WebKit::decidePolicyForNavigationAction): Deleted.
748         (WebKit::getContextMenuFromProposedMenu): Deleted.
749         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
750         (WebKit::exceededDatabaseQuota):
751         (WebKit::webProcessDidCrash):
752         (WebKit::decidePolicyForNavigationAction):
753         (WebKit::getContextMenuFromProposedMenu):
754         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
755         * UIProcess/mac/WebInspectorProxyMac.mm:
756         (WebKit::exceededDatabaseQuota):
757         (WebKit::webProcessDidCrash):
758         (WebKit::decidePolicyForNavigationAction):
759         (WebKit::getContextMenuFromProposedMenu):
760         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
761
762 2017-10-02  Brian Burg  <bburg@apple.com>
763
764         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
765         https://bugs.webkit.org/show_bug.cgi?id=177661
766         <rdar://problem/34740286>
767
768         Reviewed by Joseph Pecoraro.
769
770         Adopt WKInspectorViewController in WebInspectorProxyMac to set up the
771         frontend's web view.
772
773         * UIProcess/WebInspectorProxy.cpp:
774         (WebKit::WebInspectorProxy::invalidate):
775         (WebKit::WebInspectorProxy::close):
776         (WebKit::WebInspectorProxy::didClose):
777         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
778         Make closeFrontendPageAndWindow into the method that does work.
779         Only use didClose() as the IPC message entry point.
780
781         * UIProcess/WebInspectorProxy.h:
782         (WebKit::WebInspectorProxy::isUnderTest const): Make public.
783
784         * UIProcess/mac/WKInspectorViewController.h:
785         * UIProcess/mac/WKInspectorViewController.mm:
786         (+[WKInspectorViewController viewIsInspectorWebView:]):
787         Abstract away the -isInstanceOfClass: check for WKInspectorWKWebView.
788         Clients shouldn't need to know whether we use a subclass or what its name is.
789
790         * UIProcess/mac/WebInspectorProxyMac.mm:
791         (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]):
792         (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]):
793         Hook up view controller delegates.
794
795         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
796         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
797         (WebKit::WebInspectorProxy::closeFrontendPage):
798         New implementation based on the view controller.
799
800         (WebKit::WebInspectorProxy::platformBringToFront):
801         (WebKit::WebInspectorProxy::platformIsFront):
802         (WebKit::WebInspectorProxy::platformCanAttach):
803         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
804         (WebKit::WebInspectorProxy::platformAttach):
805         (WebKit::WebInspectorProxy::platformDetach):
806         (WebKit::WebInspectorProxy::platformStartWindowDrag):
807         Adjust to get the WKWebView out of the view controller for code that needs
808         to do something with the NSView, such as get/set the frame.
809
810         (WebKit::WebInspectorProxy::createFrontendConfiguration): Deleted.
811         (WebKit::exceededDatabaseQuota): Deleted.
812         (WebKit::webProcessDidCrash): Deleted.
813         (WebKit::decidePolicyForNavigationAction): Deleted.
814         (WebKit::getContextMenuFromProposedMenu): Deleted.
815
816 2017-10-02  Brian Burg  <bburg@apple.com>
817
818         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
819         https://bugs.webkit.org/show_bug.cgi?id=177661
820         <rdar://problem/34740286>
821
822         Reviewed by Joseph Pecoraro.
823
824         Introduce new platform methods to open and close the frontend page and window.
825         This matches how RemoteWebInspectorProxy divides work up into platform methods.
826         Move existing code from platformDidClose, platformOpen, and other methods into
827         the new platform methods. Move some identical platform code into WebInspectorProxy.cpp.
828
829         * UIProcess/WebInspectorProxy.h:
830         * UIProcess/WebInspectorProxy.cpp:
831         (WebKit::WebInspectorProxy::connect):
832         (WebKit::WebInspectorProxy::showConsole):
833         (WebKit::WebInspectorProxy::showResources):
834         (WebKit::WebInspectorProxy::showTimelines):
835         (WebKit::WebInspectorProxy::showMainResourceForFrame):
836         (WebKit::WebInspectorProxy::createFrontendPage):
837         (WebKit::WebInspectorProxy::createInspectorPage):
838         (WebKit::WebInspectorProxy::open):
839         (WebKit::WebInspectorProxy::didClose):
840         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Renamed.
841
842         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
843         (WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
844         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
845         Do everything necessary to set up the frontend page WebView.
846
847         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
848         Do everything necessary to set up the detached NSWindow for the frontend.
849
850         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
851         (WebKit::WebInspectorProxy::platformDetach):
852         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
853         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
854         (WebKit::WebInspectorProxy::platformOpen): Deleted.
855         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
856
857         * UIProcess/mac/WebInspectorProxyMac.mm:
858         (WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
859         (WebKit::WebInspectorProxy::platformCreateFrontendPage): Added.
860         Do everything necessary to set up the frontend page WebView.
861
862         (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Added.
863         Do everything necessary to set up the detached NSWindow for the frontend.
864
865         (WebKit::WebInspectorProxy::closeFrontendPage):
866         (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
867         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
868         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
869         (WebKit::WebInspectorProxy::platformInvalidate):
870         (WebKit::WebInspectorProxy::platformBringToFront): Carry through renamings.
871
872         (WebKit::WebInspectorProxy::platformDetach):
873         Defer to the general open() method to create a window if needed and bring it to front.
874
875         (WebKit::WebInspectorProxy::platformCanAttach): Move this below open/close code.
876
877         (WebKit::WebInspectorProxy::closeFrontend): Deleted.
878         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
879         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
880         (WebKit::WebInspectorProxy::platformOpen): Deleted.
881         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
882         Defer to the general open() method to create a window if needed and bring it to front.
883
884         * UIProcess/wpe/WebInspectorProxyWPE.cpp:
885         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
886         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
887         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
888         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
889         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
890         (WebKit::WebInspectorProxy::platformOpen): Deleted.
891         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
892         Update stubs.
893
894 2017-10-02  Brian Burg  <bburg@apple.com>
895
896         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
897         https://bugs.webkit.org/show_bug.cgi?id=177661
898         <rdar://problem/34740286>
899
900         Reviewed by Joseph Pecoraro.
901
902         This patch refactors some Cocoa code pathas.
903         Rename the timer that closes the WebView so it's more obvious what it is for.
904         Extract the common code to close the frontend window so its not implemented by
905         the timer callback.
906
907         In later patches, this will be extracted further into platform methods to open/close
908         the frontend and window, like how it is for RemoteWebInspectorProxy.
909
910         * UIProcess/WebInspectorProxy.cpp:
911         (WebKit::WebInspectorProxy::WebInspectorProxy):
912         * UIProcess/WebInspectorProxy.h:
913         * UIProcess/mac/WebInspectorProxyMac.mm:
914         (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
915         (WebKit::WebInspectorProxy::closeFrontend):
916         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
917         (WebKit::WebInspectorProxy::platformDidClose):
918         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
919         (WebKit::WebInspectorProxy::platformInvalidate):
920         (WebKit::WebInspectorProxy::closeTimerFired): Deleted.
921
922 2017-09-30  Brian Burg  <bburg@apple.com>
923
924         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
925         https://bugs.webkit.org/show_bug.cgi?id=177661
926         <rdar://problem/34740286>
927
928         Reviewed by Joseph Pecoraro.
929
930         Modernize the ObjC adapter and related code a bit before it is hooked
931         into WKInspectorViewController.
932
933         * UIProcess/API/C/mac/WKInspectorPrivateMac.h: No need for the
934         ivar to be declared here, move to @implementation.
935
936         * UIProcess/WebInspectorProxy.h: Simplify the name to match modern convention.
937
938         * UIProcess/mac/WebInspectorProxyMac.mm:
939         (-[WKWebInspectorProxyObjCAdapter inspectorRef]):
940         (-[WKWebInspectorProxyObjCAdapter initWithWebInspectorProxy:]):
941         (-[WKWebInspectorProxyObjCAdapter invalidate]):
942         (-[WKWebInspectorProxyObjCAdapter windowDidMove:]):
943         (-[WKWebInspectorProxyObjCAdapter windowDidResize:]):
944         (-[WKWebInspectorProxyObjCAdapter windowWillClose:]):
945         (-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]):
946         (-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]):
947         (-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]):
948         Remove unnecessary casts to and from void*.
949
950         (WebKit::WebInspectorProxy::attachmentViewDidChange):
951         (WebKit::WebInspectorProxy::setInspectorWindowFrame):
952         (WebKit::WebInspectorProxy::closeTimerFired):
953         (WebKit::WebInspectorProxy::createInspectorWindow):
954         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
955         Fix uses of member variable m_objCAdapter.
956
957         (-[WKWebInspectorProxyObjCAdapter close]): Deleted.
958         Rename this to invalidate to match modern convention. In this context,
959         'close' might trick someone into thinking that this closes a window/page.
960
961 2017-09-30  Brian Burg  <bburg@apple.com>
962
963         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
964         https://bugs.webkit.org/show_bug.cgi?id=177661
965         <rdar://problem/34740286>
966
967         Reviewed by Joseph Pecoraro.
968
969         Move code that sets up and controls the inspector WebView into WKInspectorViewController.
970         This will be shared between RemoteWebInspectorProxy and WebInspectorProxy eventually,
971         but for now just pull out code from RemoteWebInspectorProxy. The next patch will move
972         over WebInspectorProxy.
973
974         WKInspectorViewController uses the ObjC API for setting up the WKWebView's delegates.
975         Previously, a WKWebView was used but the delegates were set up using the C API. In
976         a few cases it uses delegate methods to ask the owning [Remote]WebInspectorProxy some
977         things. In general, WKInspectorViewController doesn't dig into any internals of
978         WebPageProxy or WebInspectorProxy; that is delegated to the client.
979
980         * UIProcess/RemoteWebInspectorProxy.h:
981         (WebKit::RemoteWebInspectorProxy::isUnderTest const): Add a method stub for now.
982         We might want to enable tests for a _WKRemoteWebInspectorViewController-based UI
983         in the future, and WebInspectorProxy has the same method. Add this and connect it
984         to the view controller delegate method.
985
986         (WebKit::RemoteWebInspectorProxy::webView const):
987         This returns a plain WKWebView type now.
988
989         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
990         (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]):
991         (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]):
992         (-[WKRemoteWebInspectorProxyObjCAdapter webViewWebContentProcessDidTerminate:]): Deleted.
993         (-[WKRemoteWebInspectorProxyObjCAdapter webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.
994         Make the ObjCAdapter forward view controller delegate calls to the C++ class.
995         It no longer needs to be the delegate of the WebView, as the view controller handles that.
996
997         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
998         Clean up and move WKWebView setup code into the view controller.
999
1000         (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
1001         The m_inspectorPage is closed by the caller before calling this method, so we don't need to do it here.
1002
1003         (WebKit::RemoteWebInspectorProxy::platformBringToFront):
1004         (WebKit::RemoteWebInspectorProxy::platformSave):
1005         (WebKit::RemoteWebInspectorProxy::platformAppend):
1006         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
1007         Use webView() instead of m_webView.
1008
1009         * UIProcess/mac/WKInspectorViewController.h: Added.
1010         * UIProcess/mac/WKInspectorViewController.mm: Added.
1011         (-[WKInspectorWKWebView tag]):
1012         (-[WKInspectorViewController initWithInspectedPage:]):
1013         (-[WKInspectorViewController dealloc]):
1014         (-[WKInspectorViewController delegate]):
1015         (-[WKInspectorViewController webView]):
1016         (-[WKInspectorViewController setDelegate:]):
1017         (-[WKInspectorViewController configuration]):
1018         (-[WKInspectorViewController _webView:getWindowFrameWithCompletionHandler:]):
1019         (-[WKInspectorViewController _webView:setWindowFrame:]):
1020         (-[WKInspectorViewController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):
1021         (-[WKInspectorViewController _webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:]):
1022         (-[WKInspectorViewController webViewWebContentProcessDidTerminate:]):
1023         (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
1024         Move code from RemoteWebInspectorProxyMac into here.
1025
1026         * UIProcess/mac/WebInspectorProxyMac.mm:
1027         (WebKit::WebInspectorProxy::createFrontendWindow):
1028         Remove commented out code left over from the last time that this method got moved around.
1029
1030         * WebKit.xcodeproj/project.pbxproj:
1031         Add new class.
1032
1033 2017-10-20  Zan Dobersek  <zdobersek@igalia.com>
1034
1035         [WK2] Drop 'CoordinatedGraphics' as a platform prefix from generate-forwarding-headers.pl
1036         https://bugs.webkit.org/show_bug.cgi?id=178575
1037
1038         Reviewed by Carlos Garcia Campos.
1039
1040         * Scripts/generate-forwarding-headers.pl: Remove CoordinatedGraphics as
1041         a supported platform prefix. No one invokes the script with this
1042         argument anymore.
1043
1044 2017-10-19  Alex Christensen  <achristensen@webkit.org>
1045
1046         Introduce completionHandler-based SPI for _WKDownloadDelegate.decideDestinationWithSuggestedFilename
1047         https://bugs.webkit.org/show_bug.cgi?id=178560
1048
1049         Reviewed by Tim Horton.
1050
1051         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
1052         * UIProcess/Cocoa/DownloadClient.h:
1053         * UIProcess/Cocoa/DownloadClient.mm:
1054         (WebKit::DownloadClient::DownloadClient):
1055         (WebKit::DownloadClient::didStart):
1056         (WebKit::DownloadClient::didReceiveResponse):
1057         (WebKit::DownloadClient::didReceiveData):
1058         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
1059         (WebKit::DownloadClient::didFinish):
1060         (WebKit::DownloadClient::didFail):
1061         (WebKit::DownloadClient::didCancel):
1062         (WebKit::DownloadClient::willSendRequest):
1063
1064 2017-10-19  Chris Dumez  <cdumez@apple.com>
1065
1066         ServiceWorkerContextManager should be an IPC::MessageReceiver
1067         https://bugs.webkit.org/show_bug.cgi?id=178552
1068
1069         Reviewed by Youenn Fablet.
1070
1071         ServiceWorkerContextManager should be an IPC::MessageReceiver, to avoid putting too many
1072         ServiceWorker related methods on WebProcess class.
1073
1074         * DerivedSources.make:
1075         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1076         (WebKit::WebSWServerConnection::startServiceWorkerContext):
1077         (WebKit::WebSWServerConnection::startFetch):
1078         * WebKit.xcodeproj/project.pbxproj:
1079         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
1080         (WebKit::ServiceWorkerContextManager::startFetchInServiceWorker):
1081         (WebKit::ServiceWorkerContextManager::startFetch): Deleted.
1082         * WebProcess/Storage/ServiceWorkerContextManager.h:
1083         * WebProcess/Storage/ServiceWorkerContextManager.messages.in: Added.
1084         * WebProcess/WebProcess.cpp:
1085         (WebKit::WebProcess::didReceiveMessage):
1086         (WebKit::WebProcess::getWorkerContextConnection):
1087         (WebKit::WebProcess::startServiceWorkerContext): Deleted.
1088         (WebKit::WebProcess::startFetchInServiceWorker): Deleted.
1089         * WebProcess/WebProcess.h:
1090         * WebProcess/WebProcess.messages.in:
1091
1092 2017-10-19  Alex Christensen  <achristensen@webkit.org>
1093
1094         Modernize authentication challenge handling in WebKit
1095         https://bugs.webkit.org/show_bug.cgi?id=178555
1096
1097         Reviewed by Tim Horton.
1098
1099         * UIProcess/API/APILoaderClient.h:
1100         (API::LoaderClient::didReceiveAuthenticationChallengeInFrame):
1101         * UIProcess/API/APINavigationClient.h:
1102         (API::NavigationClient::didReceiveAuthenticationChallenge):
1103         * UIProcess/API/C/WKPage.cpp:
1104         (WKPageSetPageLoaderClient):
1105         (WKPageSetPageNavigationClient):
1106         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1107         * UIProcess/Cocoa/NavigationState.h:
1108         * UIProcess/Cocoa/NavigationState.mm:
1109         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
1110         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
1111         * UIProcess/WebPageProxy.cpp:
1112         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
1113
1114 2017-10-19  Alex Christensen  <achristensen@webkit.org>
1115
1116         Modernize API::DownloadClient
1117         https://bugs.webkit.org/show_bug.cgi?id=178547
1118
1119         Reviewed by Andy Estes.
1120
1121         Use more C++ references instead of pointers because they're never null.
1122
1123         Remove canAuthenticateAgainstProtectionSpace because there are no implementations
1124         except the default implementation which always returns true and we don't intend to
1125         add this to the SPI because that's just a legacy call anyways from when NSURLConnection
1126         hadn't fully evolved, and we're moving away from NSURLConnection, especially in our API design.
1127
1128         Separate the NetworkSession-only and pre-NetworkSession-only callbacks.  All the synchronous
1129         IPC messages are only used in the pre-NetworkSession code, so once we remove it we can remove them!
1130
1131         Make API::DownloadClient calls that NetworkSession uses use a completion handler so we will be able to
1132         design an asynchronous API.
1133
1134         * NetworkProcess/Downloads/DownloadManager.cpp:
1135         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): Deleted.
1136         * NetworkProcess/Downloads/DownloadManager.h:
1137         * NetworkProcess/Downloads/PendingDownload.cpp:
1138         (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
1139         (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace): Deleted.
1140         * NetworkProcess/Downloads/PendingDownload.h:
1141         * NetworkProcess/NetworkProcess.cpp:
1142         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): Deleted.
1143         * NetworkProcess/NetworkProcess.h:
1144         * NetworkProcess/NetworkProcess.messages.in:
1145         * UIProcess/API/APIDownloadClient.h:
1146         (API::DownloadClient::didStart):
1147         (API::DownloadClient::didReceiveAuthenticationChallenge):
1148         (API::DownloadClient::didReceiveResponse):
1149         (API::DownloadClient::didReceiveData):
1150         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType):
1151         (API::DownloadClient::decideDestinationWithSuggestedFilename):
1152         (API::DownloadClient::didCreateDestination):
1153         (API::DownloadClient::didFinish):
1154         (API::DownloadClient::didFail):
1155         (API::DownloadClient::didCancel):
1156         (API::DownloadClient::processDidCrash):
1157         (API::DownloadClient::willSendRequest):
1158         (API::DownloadClient::canAuthenticateAgainstProtectionSpace): Deleted.
1159         * UIProcess/API/C/WKContext.cpp:
1160         (WKContextSetDownloadClient):
1161         * UIProcess/API/glib/WebKitDownloadClient.cpp:
1162         * UIProcess/Cocoa/DownloadClient.h:
1163         * UIProcess/Cocoa/DownloadClient.mm:
1164         (WebKit::DownloadClient::didStart):
1165         (WebKit::DownloadClient::didReceiveResponse):
1166         (WebKit::DownloadClient::didReceiveData):
1167         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
1168         (WebKit::DownloadClient::didFinish):
1169         (WebKit::DownloadClient::didFail):
1170         (WebKit::DownloadClient::didCancel):
1171         (WebKit::DownloadClient::willSendRequest):
1172         * UIProcess/Downloads/DownloadProxy.cpp:
1173         (WebKit::DownloadProxy::processDidClose):
1174         (WebKit::DownloadProxy::didStart):
1175         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
1176         (WebKit::DownloadProxy::willSendRequest):
1177         (WebKit::DownloadProxy::didReceiveResponse):
1178         (WebKit::DownloadProxy::didReceiveData):
1179         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType):
1180         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
1181         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
1182         (WebKit::DownloadProxy::didCreateDestination):
1183         (WebKit::DownloadProxy::didFinish):
1184         (WebKit::DownloadProxy::didFail):
1185         (WebKit::DownloadProxy::didCancel):
1186         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): Deleted.
1187         * UIProcess/Downloads/DownloadProxy.h:
1188         * UIProcess/Downloads/DownloadProxy.messages.in:
1189
1190 2017-10-19  Nan Wang  <n_wang@apple.com>
1191
1192         AX: Provide a way for Accessibility to cache the selection while retrieving rects for speak selection
1193         https://bugs.webkit.org/show_bug.cgi?id=176247
1194         <rdar://problem/34217143>
1195
1196         Reviewed by Ryosuke Niwa.
1197
1198         When getting the rects for highlighting the spoken text within a selection range on iOS, we can get a
1199         list of totally wrong rects if the user changed the selection to some other text. This is because the
1200         calculation is based on the current selection range. Therefore, we need to provide a way for accessibility
1201         codepath to store the selection during a speaking session.
1202
1203         * UIProcess/API/Cocoa/WKWebView.mm:
1204         (-[WKWebView _accessibilityStoreSelection]):
1205         (-[WKWebView _accessibilityClearSelection]):
1206         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1207         * UIProcess/WebPageProxy.h:
1208         * UIProcess/ios/WKContentViewInteraction.h:
1209         * UIProcess/ios/WKContentViewInteraction.mm:
1210         (-[WKContentView _accessibilityStoreSelection]):
1211         (-[WKContentView _accessibilityClearSelection]):
1212         * UIProcess/ios/WebPageProxyIOS.mm:
1213         (WebKit::WebPageProxy::storeSelectionForAccessibility):
1214         * WebProcess/WebPage/WebPage.h:
1215         * WebProcess/WebPage/WebPage.messages.in:
1216         * WebProcess/WebPage/ios/WebPageIOS.mm:
1217         (WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
1218         (WebKit::WebPage::storeSelectionForAccessibility):
1219         (WebKit::WebPage::getRectsAtSelectionOffsetWithText):
1220
1221 2017-10-19  Sam Weinig  <sam@webkit.org>
1222
1223         [Settings] Move global settings into their own file
1224         https://bugs.webkit.org/show_bug.cgi?id=178512
1225
1226         Reviewed by Darin Adler.
1227
1228         Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.
1229
1230         * NetworkProcess/NetworkProcess.cpp:
1231         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
1232         * Shared/WebPreferencesDefinitions.h:
1233         * Shared/WebPreferencesStore.cpp:
1234         * WebProcess/WebPage/WebPage.cpp:
1235         (WebKit::m_cpuLimit):
1236         (WebKit::WebPage::updatePreferences):
1237         * WebProcess/WebProcess.cpp:
1238         (WebKit::WebProcess::setResourceLoadStatisticsEnabled):
1239         * WebProcess/cocoa/VideoFullscreenManager.mm:
1240         (WebKit::VideoFullscreenManager::supportsVideoFullscreen const):
1241
1242 2017-10-19  Andy Estes  <aestes@apple.com>
1243
1244         [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
1245         https://bugs.webkit.org/show_bug.cgi?id=178181
1246         <rdar://problem/33660282>
1247
1248         Reviewed by Dan Bernstein.
1249
1250         * Configurations/BaseTarget.xcconfig:
1251         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1252         (WebKit::serviceName):
1253         * WebKit.xcodeproj/project.pbxproj:
1254
1255 2017-10-19  Youenn Fablet  <youenn@apple.com>
1256
1257         Add preliminary support for ServiceWorker Handle Fetch
1258         https://bugs.webkit.org/show_bug.cgi?id=178475
1259         <rdar://problem/35066424>
1260
1261         Reviewed by Chris Dumez.
1262
1263         Relanding now that underlying issue is fixed in https://bugs.webkit.org/show_bug.cgi?id=178527.
1264
1265         Preliminary support of Handle Fetch algorithm and integration with fetch spec.
1266         Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker.
1267         It is similar to WebResourceLoader that do the load through NetworkProcess.
1268         In case ServiceWorkerClientFetch is not able to load through ServiceWorker,
1269         it will fallback to WebResourceLoader through a fallback callback.
1270
1271         Loading through Service Worker is done currently if:
1272         - There is a service worker registered for that origin
1273         - Request is a subresource
1274         - service workers mode is all
1275         There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set.
1276         Future work should try to reduce the cases where the IPC dance is done unnecessarily.
1277
1278         ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader.
1279         In particular, it is calling ResourceLoader error callback if response is of type error.
1280         It should call ResourceLoader redirection callback if response is a redirection response.
1281         This will be done as a follow-up.
1282
1283         Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess.
1284         In the future, WebProcess should create a direct IPC communication to the ServiceWorker process.
1285
1286         Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager.
1287         This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate.
1288
1289         * CMakeLists.txt:
1290         * DerivedSources.make:
1291         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1292         (WebKit::WebSWServerConnection::startFetch):
1293         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
1294         (WebKit::WebSWServerConnection::didReceiveFetchData):
1295         (WebKit::WebSWServerConnection::didFinishFetch):
1296         (WebKit::WebSWServerConnection::didFailFetch):
1297         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1298         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1299         * StorageProcess/StorageProcess.cpp:
1300         (WebKit::StorageProcess::didFailFetch):
1301         (WebKit::StorageProcess::didReceiveFetchResponse):
1302         (WebKit::StorageProcess::didReceiveFetchData):
1303         (WebKit::StorageProcess::didFinishFetch):
1304         * StorageProcess/StorageProcess.h:
1305         * StorageProcess/StorageProcess.messages.in:
1306         * WebKit.xcodeproj/project.pbxproj:
1307         * WebProcess/Network/WebLoaderStrategy.cpp:
1308         (WebKit::WebLoaderStrategy::scheduleLoad):
1309         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1310         (WebKit::WebLoaderStrategy::remove):
1311         * WebProcess/Network/WebLoaderStrategy.h:
1312         * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added.
1313         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
1314         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1315         (WebKit::ServiceWorkerClientFetch::didReceiveData):
1316         (WebKit::ServiceWorkerClientFetch::didFinish):
1317         (WebKit::ServiceWorkerClientFetch::didFail):
1318         (WebKit::ServiceWorkerClientFetch::cancel):
1319         * WebProcess/Storage/ServiceWorkerClientFetch.h: Copied from Source/WebKit/WebProcess/Storage/WebSWClientConnection.h.
1320         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Copied from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in.
1321         * WebProcess/Storage/ServiceWorkerContextManager.cpp: Added.
1322         (WebKit::ServiceWorkerContextManager::startServiceWorkerContext):
1323         (WebKit::ServiceWorkerContextManager::startFetch):
1324         * WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h.
1325         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
1326         * WebProcess/Storage/WebSWClientConnection.cpp:
1327         (WebKit::WebSWClientConnection::startFetch):
1328         * WebProcess/Storage/WebSWClientConnection.h:
1329         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1330         (WebKit::shouldHandleFetch):
1331         (WebKit::WebServiceWorkerProvider::handleFetch):
1332         (WebKit::WebServiceWorkerProvider::cancelFetch):
1333         (WebKit::WebServiceWorkerProvider::fetchFinished):
1334         (WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage):
1335         * WebProcess/Storage/WebServiceWorkerProvider.h:
1336         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1337         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
1338         * WebProcess/WebProcess.cpp:
1339         (WebKit::WebProcess::getWorkerContextConnection):
1340         (WebKit::WebProcess::startServiceWorkerContext):
1341         (WebKit::WebProcess::startFetchInServiceWorker):
1342         * WebProcess/WebProcess.h:
1343         * WebProcess/WebProcess.messages.in:
1344
1345 2017-10-19  Youenn Fablet  <youenn@apple.com>
1346
1347         Service Worker process should not be selected to open WebView on it
1348         https://bugs.webkit.org/show_bug.cgi?id=178527
1349
1350         Reviewed by Chris Dumez.
1351
1352         Selection of process to open a page will no longer use an existing web process if it is the service worker process.
1353
1354         * UIProcess/WebProcessPool.cpp:
1355         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
1356
1357 2017-10-19  Tim Horton  <timothy_horton@apple.com>
1358
1359         Display link bringup can block the main thread for ~150ms during WKWebView init
1360         https://bugs.webkit.org/show_bug.cgi?id=178524
1361
1362         Reviewed by Dean Jackson.
1363
1364         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
1365         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1366         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
1367         (WebKit::RemoteLayerTreeDrawingAreaProxy::displayLinkHandler):
1368         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1369         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
1370         Lazily initialize the display link at first use.
1371
1372 2017-10-19  Tim Horton  <timothy_horton@apple.com>
1373
1374         Expand r209943 to suppress paste during provisional navigation as well
1375         https://bugs.webkit.org/show_bug.cgi?id=178429
1376         <rdar://problem/33952830>
1377
1378         Reviewed by Dean Jackson.
1379
1380         * Shared/WebPreferencesDefinitions.h:
1381         * UIProcess/API/C/WKPreferences.cpp:
1382         (WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation):
1383         (WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation):
1384         * UIProcess/API/Cocoa/WKPreferences.mm:
1385         (-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]):
1386         (-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]):
1387         * WebProcess/WebPage/WebPage.cpp:
1388         (WebKit::WebPage::updatePreferences):
1389         Adjust to the changed preference name, except at the SPI level.
1390
1391 2017-10-19  Youenn Fablet  <youenn@apple.com>
1392
1393         Add API to clean CacheStorage data
1394         https://bugs.webkit.org/show_bug.cgi?id=178034
1395
1396         Unreviewed.
1397
1398         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Using WK_IOS_TBA instead of WK_MAC_TBA for iOS.
1399
1400 2017-10-19  Chris Dumez  <cdumez@apple.com>
1401
1402         Unreviewed build fix after r223692.
1403
1404         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1405
1406 2017-10-19  Chris Dumez  <cdumez@apple.com>
1407
1408         Unreviewed, revert r223650 as it caused crashes on the bots.
1409
1410         * CMakeLists.txt:
1411         * DerivedSources.make:
1412         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1413         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1414         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1415         * StorageProcess/StorageProcess.cpp:
1416         * StorageProcess/StorageProcess.h:
1417         * StorageProcess/StorageProcess.messages.in:
1418         * WebKit.xcodeproj/project.pbxproj:
1419         * WebProcess/Network/WebLoaderStrategy.cpp:
1420         (WebKit::WebLoaderStrategy::scheduleLoad):
1421         (WebKit::WebLoaderStrategy::remove):
1422         * WebProcess/Network/WebLoaderStrategy.h:
1423         * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Removed.
1424         * WebProcess/Storage/ServiceWorkerClientFetch.h: Removed.
1425         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Removed.
1426         * WebProcess/Storage/ServiceWorkerContextManager.cpp: Removed.
1427         * WebProcess/Storage/WebSWClientConnection.cpp:
1428         * WebProcess/Storage/WebSWClientConnection.h:
1429         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1430         * WebProcess/Storage/WebServiceWorkerProvider.h:
1431         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1432         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
1433         * WebProcess/WebProcess.cpp:
1434         (WebKit::WebProcess::getWorkerContextConnection):
1435         (WebKit::WebProcess::startServiceWorkerContext):
1436         * WebProcess/WebProcess.h:
1437         * WebProcess/WebProcess.messages.in:
1438
1439 2017-10-19  Chris Dumez  <cdumez@apple.com>
1440
1441         http/tests/workers/service/basic-register.html is a flaky failure.
1442         https://bugs.webkit.org/show_bug.cgi?id=178494
1443         <rdar://problem/35065315>
1444
1445         Reviewed by Youenn Fablet.
1446
1447         In WebSWServerConnection::resolveJobInClient(), when a service worker is
1448         registered, we:
1449         1. Add the origin to the WebSWOriginStore
1450         2. Send the IPC to the WebProcess to notify it that the registration succeeded.
1451
1452         The assumption was that step 1 would be synchronous and would therefore send
1453         the shared memory handle to the WebProcess (if the SharedMemory was invalidated)
1454         *before* step 2.
1455
1456         The issue is that step 1 was scheduling a zero-timer to schedule the addition.
1457         As a result, there was a race and the WebContent process could check the
1458         the WebSWOriginTable *after* being notified that a service worker was registered
1459         but *before* it received the SharedMemory handle for the WebSWOriginTable. This
1460         could lead to false negatives and was causing the layout test to be flaky.
1461
1462         To address the issue, step 1 is now synchronous.
1463
1464         * Shared/SharedStringHashStore.cpp:
1465         (WebKit::SharedStringHashStore::SharedStringHashStore):
1466         (WebKit::SharedStringHashStore::scheduleAddition):
1467         (WebKit::SharedStringHashStore::scheduleRemoval):
1468         (WebKit::SharedStringHashStore::contains):
1469         (WebKit::SharedStringHashStore::flushPendingChanges):
1470         (WebKit::SharedStringHashStore::processPendingOperations):
1471         * Shared/SharedStringHashStore.h:
1472         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
1473         (WebKit::WebSWOriginStore::add):
1474         (WebKit::WebSWOriginStore::addAll):
1475         (WebKit::WebSWOriginStore::remove):
1476         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
1477         * UIProcess/VisitedLinkStore.cpp:
1478         (WebKit::VisitedLinkStore::addVisitedLinkHash):
1479         (WebKit::VisitedLinkStore::removeVisitedLinkHash):
1480
1481 2017-10-18  Ryosuke Niwa  <rniwa@webkit.org>
1482
1483         Don't expose raw HTML in pasteboard to the web content
1484         https://bugs.webkit.org/show_bug.cgi?id=178422
1485
1486         Reviewed by Wenson Hsieh.
1487
1488         Encode & decode the origin string of the copied content written into the system pasteboard.
1489
1490         * Shared/WebCoreArgumentCoders.cpp:
1491         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
1492         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
1493
1494 2017-10-18  Chris Dumez  <cdumez@apple.com>
1495
1496         Implement ServiceWorkerRegistration.scope / updateViaCache
1497         https://bugs.webkit.org/show_bug.cgi?id=178497
1498
1499         Reviewed by Youenn Fablet.
1500
1501         * Shared/WebCoreArgumentCoders.h:
1502         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1503
1504 2017-10-18  Youenn Fablet  <youenn@apple.com>
1505
1506         Add preliminary support for ServiceWorker Handle Fetch
1507         https://bugs.webkit.org/show_bug.cgi?id=178475
1508
1509         Reviewed by Chris Dumez.
1510
1511         Preliminary support of Handle Fetch algorithm and integration with fetch spec.
1512         Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker.
1513         It is similar to WebResourceLoader that do the load through NetworkProcess.
1514         In case ServiceWorkerClientFetch is not able to load through ServiceWorker,
1515         it will fallback to WebResourceLoader through a fallback callback.
1516
1517         Loading through Service Worker is done currently if:
1518         - There is a service worker registered for that origin
1519         - Request is a subresource
1520         - service workers mode is all
1521         There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set.
1522         Future work should try to reduce the cases where the IPC dance is done unnecessarily.
1523
1524         ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader.
1525         In particular, it is calling ResourceLoader error callback if response is of type error.
1526         It should call ResourceLoader redirection callback if response is a redirection response.
1527         This will be done as a follow-up.
1528
1529         Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess.
1530         In the future, WebProcess should create a direct IPC communication to the ServiceWorker process.
1531
1532         Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager.
1533         This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate.
1534
1535         * DerivedSources.make:
1536         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1537         (WebKit::WebSWServerConnection::startFetch):
1538         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
1539         (WebKit::WebSWServerConnection::didReceiveFetchData):
1540         (WebKit::WebSWServerConnection::didFinishFetch):
1541         (WebKit::WebSWServerConnection::failedFetch):
1542         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1543         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1544         * StorageProcess/StorageProcess.cpp:
1545         (WebKit::StorageProcess::failedFetch):
1546         (WebKit::StorageProcess::didReceiveFetchResponse):
1547         (WebKit::StorageProcess::didReceiveFetchData):
1548         (WebKit::StorageProcess::didFinishFetch):
1549         * StorageProcess/StorageProcess.h:
1550         * StorageProcess/StorageProcess.messages.in:
1551         * WebKit.xcodeproj/project.pbxproj:
1552         * WebProcess/Network/WebLoaderStrategy.cpp:
1553         (WebKit::WebLoaderStrategy::scheduleLoad):
1554         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1555         * WebProcess/Network/WebLoaderStrategy.h:
1556         * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added.
1557         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1558         (WebKit::ServiceWorkerClientFetch::didReceiveData):
1559         (WebKit::ServiceWorkerClientFetch::didFinishFetch):
1560         (WebKit::ServiceWorkerClientFetch::didFail):
1561         * WebProcess/Storage/ServiceWorkerClientFetch.h: Added.
1562         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Added.
1563         * WebProcess/Storage/ServiceWorkerContextManager.cpp: Renamed from Source/WebCore/workers/service/context/SWContextManager.cpp.
1564         (WebKit::ServiceWorkerContextManager::startServiceWorkerContext):
1565         (WebKit::ServiceWorkerContextManager::startFetch):
1566         * WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h.
1567         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
1568         * WebProcess/Storage/WebSWClientConnection.cpp:
1569         (WebKit::WebSWClientConnection::startFetch):
1570         * WebProcess/Storage/WebSWClientConnection.h:
1571         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1572         (WebKit::shouldHandleFetch):
1573         (WebKit::WebServiceWorkerProvider::handleFetch):
1574         (WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage):
1575         * WebProcess/Storage/WebServiceWorkerProvider.h:
1576         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1577         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
1578         * WebProcess/WebProcess.cpp:
1579         (WebKit::WebProcess::getWorkerContextConnection):
1580         (WebKit::WebProcess::startServiceWorkerContext):
1581         (WebKit::WebProcess::startFetchInServiceWorker):
1582         * WebProcess/WebProcess.h:
1583         * WebProcess/WebProcess.messages.in:
1584
1585 2017-10-18  Chelsea Pugh  <cpugh@apple.com>
1586
1587         [iOS] Use new class name from UIKit when checking UITextSuggestion type
1588         https://bugs.webkit.org/show_bug.cgi?id=178416
1589         <rdar://problem/35010840>
1590
1591         Reviewed by Tim Horton.
1592
1593         Here we start using UITextAutofillSuggestion instead of the old name that was being used for
1594         AutoFill text suggestions.
1595
1596         * Platform/spi/ios/UIKitSPI.h:
1597         * UIProcess/ios/WKContentViewInteraction.mm:
1598         (-[WKContentView insertTextSuggestion:]): Use UITextAutofillSuggestion when checking the class
1599         and when casting instead of UIKeyboardLoginCredentialsSuggestion.
1600
1601 2017-10-17  Jiewen Tan  <jiewen_tan@apple.com>
1602
1603         Replace some stack raw pointers with RefPtrs within WebCore/html
1604         https://bugs.webkit.org/show_bug.cgi?id=178201
1605         <rdar://problem/34841692>
1606
1607         Reviewed by Ryosuke Niwa.
1608
1609         Change the type of node as toNode() is changed to return RefPtr.
1610
1611         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
1612         (WebKit::wrap):
1613         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1614         (WebKit::WebEditorClient::handleKeyboardEvent):
1615         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
1616         (WebKit::WebEditorClient::handleKeyboardEvent):
1617         * WebProcess/WebPage/WebPage.cpp:
1618         (WebKit::WebPage::handleEditingKeyboardEvent):
1619         * WebProcess/WebPage/mac/WebPageMac.mm:
1620         (WebKit::frameForEvent):
1621
1622 2017-10-18  Chris Dumez  <cdumez@apple.com>
1623
1624         [Service Worker] Add stubs for Client / WindowClient / Clients
1625         https://bugs.webkit.org/show_bug.cgi?id=178469
1626
1627         Reviewed by Youenn Fablet.
1628
1629         Rename PageVisibilityState to VisibilityState.
1630
1631         * Shared/API/c/WKSharedAPICast.h:
1632         (WebKit::toVisibilityState):
1633         * WebProcess/WebPage/WebPage.h:
1634
1635 2017-10-18  John Wilander  <wilander@apple.com>
1636
1637         Check notifyPagesWhenTelemetryWasCaptured before notifying pages if there is no WebPageProxy
1638         https://bugs.webkit.org/show_bug.cgi?id=178470
1639         <rdar://problem/34417518>
1640
1641         Reviewed by Brian Burg.
1642
1643         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1644         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1645             Add a missing check of notifyPagesWhenTelemetryWasCaptured.
1646             The page notification is only for testing purposes.
1647
1648 2017-10-18  Chris Dumez  <cdumez@apple.com>
1649
1650         Unreviewed, fix build error after r223608 with some SDKs.
1651
1652         * StorageProcess/StorageProcess.cpp:
1653         (WebKit::StorageProcess::ensureSWOriginStoreForSession):
1654
1655 2017-10-18  Chris Dumez  <cdumez@apple.com>
1656
1657         Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin
1658         https://bugs.webkit.org/show_bug.cgi?id=177876
1659         <rdar://problem/34813129>
1660
1661         Reviewed by Ryosuke Niwa.
1662
1663         Introduce a Service Worker origin store which gets populated / updated on the StorageProcess side
1664         and queried on the WebContent process side via the WebSWOriginTable so that the WebProcess can
1665         efficiently check if there is a ServiceWorker registered for a given origin without actually doing
1666         an IPC to the StorageProcess.
1667
1668         For efficiency, the hash table is backed by SharedMemory so we only pass shared memory handles
1669         between the StorageProcess and the WebProcesses.
1670
1671         We currently add entries to the WebSWOriginStore whenever a service worker registration succeeds
1672         on the StorageProcess side. We also clear this store whenever the API to clear service worker
1673         registrations is called. Code to query the WebSWOriginTable from the WebContent process side is
1674         there but currently only used by Internals for testing. We will later leverage this code when
1675         integrating with Fetch API.
1676
1677         * CMakeLists.txt:
1678         * Shared/SharedStringHashStore.h:
1679         (WebKit::SharedStringHashStore::Client::didUpdateSharedStringHashes):
1680         * Shared/SharedStringHashTable.cpp:
1681         (WebKit::SharedStringHashTable::clear):
1682         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
1683         (WebKit::WebSWOriginStore::WebSWOriginStore):
1684         (WebKit::WebSWOriginStore::add):
1685         (WebKit::WebSWOriginStore::remove):
1686         (WebKit::WebSWOriginStore::clear):
1687         (WebKit::WebSWOriginStore::registerSWServerConnection):
1688         (WebKit::WebSWOriginStore::unregisterSWServerConnection):
1689         (WebKit::WebSWOriginStore::sendStoreHandle):
1690         (WebKit::WebSWOriginStore::didInvalidateSharedMemory):
1691         * StorageProcess/ServiceWorker/WebSWOriginStore.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
1692         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1693         (WebKit::WebSWServerConnection::WebSWServerConnection):
1694         (WebKit::WebSWServerConnection::resolveJobInClient):
1695         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1696         (WebKit::WebSWServerConnection::sessionID const):
1697         * StorageProcess/StorageProcess.cpp:
1698         (WebKit::StorageProcess::deleteWebsiteData):
1699         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1700         (WebKit::StorageProcess::ensureSWOriginStoreForSession):
1701         (WebKit::StorageProcess::swOriginStoreForSession const):
1702         (WebKit::StorageProcess::serviceWorkerContextStarted):
1703         (WebKit::StorageProcess::registerSWServerConnection):
1704         (WebKit::StorageProcess::unregisterSWServerConnection):
1705         * StorageProcess/StorageProcess.h:
1706         * StorageProcess/StorageProcess.messages.in:
1707         * WebKit.xcodeproj/project.pbxproj:
1708         * WebProcess/Storage/WebSWClientConnection.cpp:
1709         (WebKit::WebSWClientConnection::WebSWClientConnection):
1710         (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const):
1711         (WebKit::WebSWClientConnection::setSWOriginTableSharedMemory):
1712         * WebProcess/Storage/WebSWClientConnection.h:
1713         * WebProcess/Storage/WebSWClientConnection.messages.in:
1714         * WebProcess/Storage/WebSWOriginTable.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
1715         (WebKit::WebSWOriginTable::contains const):
1716         (WebKit::WebSWOriginTable::setSharedMemory):
1717         * WebProcess/Storage/WebSWOriginTable.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
1718         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1719         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
1720         * WebProcess/Storage/WebServiceWorkerProvider.h:
1721         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1722         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
1723         * WebProcess/Storage/WebToStorageProcessConnection.h:
1724         * WebProcess/WebProcess.cpp:
1725         (WebKit::WebProcess::startServiceWorkerContext):
1726
1727 2017-10-16  Andy Estes  <aestes@apple.com>
1728
1729         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
1730         https://bugs.webkit.org/show_bug.cgi?id=178191
1731         <rdar://problem/34906367>
1732
1733         Reviewed by Tim Horton.
1734
1735         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1736         (WebKit::toNSError):
1737
1738 2017-10-17  Sam Weinig  <sam@webkit.org>
1739
1740         [Settings] Generate Settings.h/cpp
1741         https://bugs.webkit.org/show_bug.cgi?id=178361
1742
1743         Reviewed by Dean Jackson.
1744
1745         * PlatformGTK.cmake:
1746         * PlatformWPE.cmake:
1747
1748             Delete the old Settings.h from the forwarding 
1749             headers directory to allow the build to work.
1750
1751 2017-10-17  John Wilander  <wilander@apple.com>
1752
1753         Add and remove cookie partition accordingly in intermediary redirect requests
1754         https://bugs.webkit.org/show_bug.cgi?id=178369
1755         <rdar://problem/34467603>
1756
1757         Reviewed by Brent Fulgham.
1758
1759         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1760         (WebKit::shouldChangePartition):
1761             Convenience function. Comment documents the logic.
1762         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1763             Now adds and removes cookie partition based on the
1764             redirect-to URL's domain.
1765         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1766         (WKBundleResourceLoadStatisticsNotifyObserver):
1767             Test infrastructure.
1768         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1769
1770 2017-10-17  Youenn Fablet  <youenn@apple.com>
1771
1772         Cache API implementation should be able to compute storage size for WebKit client applications.
1773         https://bugs.webkit.org/show_bug.cgi?id=178350
1774
1775         Reviewed by Chris Dumez.
1776
1777         When gathering data from DOM Cache, we compute the size as follows:
1778         - If Caches object is not persistent, size is zero
1779         - If Caches object is persistent, we use the size computed by NetworkCache::Storage. 
1780         Covered by updated tests.
1781
1782         * NetworkProcess/cache/CacheStorageEngine.cpp:
1783         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
1784         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
1785         (WebKit::CacheStorage::Engine::fetchEntries):
1786         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1787         (WebKit::CacheStorage::Caches::storageSize const):
1788         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1789         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1790         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
1791         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1792
1793 2017-10-17  Keith Miller  <keith_miller@apple.com>
1794
1795         Change WebCore sources to work with unified source builds
1796         https://bugs.webkit.org/show_bug.cgi?id=178229
1797
1798         Rubber stamped by Tim Horton.
1799
1800         * Configurations/FeatureDefines.xcconfig:
1801
1802 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
1803
1804         Unreviewed, fix the iOS build after r223431
1805
1806         Remove an unused variable captured in a lambda.
1807
1808         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1809         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1810
1811 2017-10-12  Matt Rajca  <mrajca@apple.com>
1812
1813         Add API support for quirk that lets an arbitrary click allow auto-play.
1814         https://bugs.webkit.org/show_bug.cgi?id=178227
1815
1816         Reviewed by Alex Christensen.
1817
1818         Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets
1819         an arbitrary click allow auto-play via website policies.
1820
1821         * Shared/WebsitePolicies.h:
1822         * UIProcess/API/C/WKWebsitePolicies.cpp:
1823         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
1824         (WKWebsitePoliciesGetAllowedAutoplayQuirks):
1825         * UIProcess/API/C/WKWebsitePolicies.h:
1826         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1827         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1828         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
1829         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
1830         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1831         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
1832         * WebProcess/WebPage/WebPage.cpp:
1833         (WebKit::WebPage::updateWebsitePolicies):
1834
1835 2017-10-16  Andy Estes  <aestes@apple.com>
1836
1837         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
1838         https://bugs.webkit.org/show_bug.cgi?id=178191
1839         <rdar://problem/34906367>
1840
1841         Reviewed by Tim Horton.
1842
1843         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1844         (WebKit::toNSError):
1845
1846 2017-10-16  Tim Horton  <timothy_horton@apple.com>
1847
1848         Safari crashes after searching PDF (under [WKPDFView zoom:to:atPoint:kind:])
1849         https://bugs.webkit.org/show_bug.cgi?id=178358
1850         <rdar://problem/34676899>
1851
1852         Reviewed by Wenson Hsieh.
1853
1854         * UIProcess/ios/WKPDFView.mm:
1855         (-[WKPDFView _didFindMatch:]):
1856         UIPDFSelection can return a null rect as the selection's bounds.
1857         We can't zoom to a null rect (and doing so results in CA throwing an
1858         exception later).
1859
1860 2017-10-16  Alex Christensen  <achristensen@webkit.org>
1861
1862         Add a _WKThumbnailView initializer with a WKWebView
1863         https://bugs.webkit.org/show_bug.cgi?id=178351
1864         <rdar://problem/34979453>
1865
1866         Reviewed by Tim Horton.
1867
1868         * UIProcess/API/Cocoa/WKWebView.mm:
1869         (-[WKWebView _page]):
1870         (-[WKWebView _setThumbnailView:]):
1871         (-[WKWebView _thumbnailView]):
1872         (-[WKWebView _setIgnoresAllEvents:]):
1873         (-[WKWebView _ignoresAllEvents]):
1874         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1875         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1876         * UIProcess/API/Cocoa/_WKThumbnailView.h:
1877         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1878         (-[_WKThumbnailView initWithFrame:fromWKWebView:]):
1879         (-[_WKThumbnailView _viewWasUnparented]):
1880         (-[_WKThumbnailView _viewWasParented]):
1881
1882 2017-10-16  Alex Christensen  <achristensen@webkit.org>
1883
1884         Expose more WKView properties as WKWebViewPrivate SPI
1885         https://bugs.webkit.org/show_bug.cgi?id=178349
1886         <rdar://problem/34980919>
1887
1888         Reviewed by Tim Horton.
1889
1890         _backgroundExtendsBeyondPage was already exposed on iOS, but we need it on Mac, too.
1891         A few other properties also need exposing.
1892
1893         * UIProcess/API/Cocoa/WKWebView.mm:
1894         (toAPIScrollbarStyle):
1895         (toCoreScrollbarStyle):
1896         (-[WKWebView _setBackgroundExtendsBeyondPage:]):
1897         (-[WKWebView _backgroundExtendsBeyondPage]):
1898         (-[WKWebView _setOverlayScrollbarStyle:]):
1899         (-[WKWebView _overlayScrollbarStyle]):
1900         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1901
1902 2017-10-16  Chris Dumez  <cdumez@apple.com>
1903
1904         Log using differential privacy domains where the WebContent process crashes
1905         https://bugs.webkit.org/show_bug.cgi?id=178346
1906         <rdar://problem/33293830>
1907
1908         Reviewed by Alex Christensen.
1909
1910         * UIProcess/WebPageProxy.cpp:
1911         (WebKit::WebPageProxy::reload):
1912         (WebKit::WebPageProxy::currentURL const):
1913         (WebKit::WebPageProxy::processDidTerminate):
1914         * UIProcess/WebPageProxy.h:
1915         * UIProcess/WebProcessProxy.cpp:
1916         (WebKit::WebProcessProxy::didClose):
1917
1918 2017-10-16  Youenn Fablet  <youenn@apple.com>
1919
1920         Activate Cache API by default
1921         https://bugs.webkit.org/show_bug.cgi?id=178186
1922
1923         Reviewed by Chris Dumez.
1924
1925         * Shared/WebPreferencesDefinitions.h:
1926
1927 2017-10-16  Sam Weinig  <sam@webkit.org>
1928
1929         [Settings] Remove all custom code from Settings.h/cpp
1930         https://bugs.webkit.org/show_bug.cgi?id=178330
1931
1932         Reviewed by Simon Fraser.
1933
1934         * Shared/WebPreferencesDefinitions.h:
1935         * UIProcess/API/C/WKPreferences.cpp:
1936         (WKPreferencesSetFrameFlatteningEnabled):
1937         (WKPreferencesGetFrameFlatteningEnabled):
1938         * UIProcess/API/glib/WebKitSettings.cpp:
1939         (webkit_settings_get_enable_frame_flattening):
1940         (webkit_settings_set_enable_frame_flattening):
1941         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1942         (WebKit::InjectedBundle::setFrameFlatteningEnabled):
1943         
1944             Update for naming changes of FrameFlattening now that it is an enum class.
1945
1946         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1947         (WebKit::WebChromeClient::contentsSizeChanged const):
1948
1949             Ge the effectiveFrameFlattening from the FrameView, rather than the Settings.
1950
1951 2017-10-16  Chris Dumez  <cdumez@apple.com>
1952
1953         [WK2][NetworkSession] Add support for resuming downloads
1954         https://bugs.webkit.org/show_bug.cgi?id=177625
1955         <rdar://problem/34345975>
1956
1957         Reviewed by Alex Christensen.
1958
1959         Add support for resuming downloads for the WK2 NETWORK_SESSION code path.
1960
1961         This was tested manually. I was unable to write an API test because our tests
1962         do not run an HTTP server and CFNetwork does not seem to generate resume data
1963         when cancelling a download over non-HTTP.
1964
1965         * NetworkProcess/Downloads/Download.cpp:
1966         (WebKit::Download::didReceiveChallenge):
1967         (WebKit::Download::continueCanAuthenticateAgainstProtectionSpace):
1968         * NetworkProcess/Downloads/Download.h:
1969         * NetworkProcess/Downloads/DownloadManager.cpp:
1970         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
1971         (WebKit::DownloadManager::resumeDownload):
1972         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1973         (WebKit::Download::resume):
1974         This currently includes a workaround for <rdar://problem/34745171>. We update the
1975         resume data to include the NSURLSessionResumeInfoLocalPath key with the final
1976         destination path so that CFNetwork looks for the temporary data at the right
1977         location.
1978
1979         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1980         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1981         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1982         (WebKit::NetworkSessionCocoa::downloadTaskWithResumeData):
1983         * Shared/Authentication/AuthenticationManager.cpp:
1984         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1985         * Shared/Authentication/AuthenticationManager.h:
1986
1987 2017-10-16  Adrian Perez de Castro  <aperez@igalia.com>
1988
1989         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
1990         https://bugs.webkit.org/show_bug.cgi?id=178090
1991
1992         Reviewed by Michael Catanzaro.
1993
1994         EGLNativeWindowType can be aliased to a different type depending (at least) on the EGL
1995         implementation, its build options, and the libepoxy build options.  Using "static_cast"
1996         works when it is a numeric value and the width of the value needs to be optionally
1997         extended to 64 bits (e.g. the EGL type is "int" in a 32-bit CPU) but not for pointers,
1998         and using "reinterpret_cast" works when the size of a pointer is 64 bits but not in other
1999         cases. Therefore it seems reasonable to use a plain C cast expression to solve this
2000         particular situation.
2001
2002         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
2003         (WebKit::AcceleratedSurfaceWPE::window const): Use a good old plain C cast expression.
2004
2005 2017-10-16  Chris Dumez  <cdumez@apple.com>
2006
2007         Clicks on Link with download attribute causes all (other) links to trigger download when clicked
2008         https://bugs.webkit.org/show_bug.cgi?id=178267
2009         <rdar://problem/34985016>
2010
2011         Reviewed by Darin Adler.
2012
2013         When clicking on an anchor with the download attribute, the m_syncNavigationActionHasDownloadAttribute
2014         flag on WebPageProxy would get set. This flag would not get reset right away and instead, it would get
2015         updated during the next call to WebPageProxy::decidePolicyForNavigationAction(). The issue is that if
2016         you later click on a link with target="_blank", WebPageProxy::decidePolicyForNewWindowAction() gets
2017         called instead of WebPageProxy::decidePolicyForNavigationAction() and we do not reset the
2018         m_syncNavigationActionHasDownloadAttribute flag and we force a download.
2019
2020         To address the problem, I got rid of this flag on WebPageProxy and it is error-prone and should really
2021         not be at page-level. Instead, I added a shouldForceDownload flag on the navigation object. It makes
2022         more sense to associate the flag with the navigation and makes it less error-prone.
2023
2024         * UIProcess/API/APINavigation.h:
2025         (API::Navigation::setShouldForceDownload):
2026         (API::Navigation::shouldForceDownload const):
2027         * UIProcess/WebPageProxy.cpp:
2028         (WebKit::WebPageProxy::receivedPolicyDecision):
2029         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2030         * UIProcess/WebPageProxy.h:
2031
2032 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
2033
2034         Unreviewed, rolling out r223271.
2035
2036         This change introduced LayoutTest failures on WK1.
2037
2038         Reverted changeset:
2039
2040         "Use asynchronous ResourceHandleClient calls for WebKit1"
2041         https://bugs.webkit.org/show_bug.cgi?id=160677
2042         https://trac.webkit.org/changeset/223271
2043
2044 2017-10-13  Youenn Fablet  <youenn@apple.com>
2045
2046         Implement listing origins for which CacheStorage is storing data
2047         https://bugs.webkit.org/show_bug.cgi?id=178236
2048
2049         Reviewed by Chris Dumez.
2050
2051         Cache storage is split on per-origin folders which name is obfuscated through salting.
2052         To retrieve the origin for each folder, an origin file is now stored within each folder.
2053         This file contains the actual origin.
2054
2055         Adding support to get the list of origin by iterating through each folder and
2056         getting the actual origin by reading the content of the 'origin' file.
2057
2058         Adding C API for WebKitTestRunner.
2059
2060         * NetworkProcess/cache/CacheStorageEngine.cpp:
2061         (WebKit::CacheStorage::Engine::fetchEntries):
2062         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
2063         (WebKit::CacheStorage::ReadOriginsTaskCounter::~ReadOriginsTaskCounter):
2064         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
2065         (WebKit::CacheStorage::ReadOriginsTaskCounter::ReadOriginsTaskCounter):
2066         * NetworkProcess/cache/CacheStorageEngine.h:
2067         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2068         (WebKit::CacheStorage::cachesOriginFilename):
2069         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
2070         (WebKit::CacheStorage::Caches::Caches):
2071         (WebKit::CacheStorage::Caches::storeOrigin):
2072         (WebKit::CacheStorage::Caches::readOrigin):
2073         (WebKit::CacheStorage::Caches::initialize):
2074         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2075         (WebKit::CacheStorage::Caches::origin const):
2076         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2077         (WKWebsiteDataStoreGetFetchCacheOrigins):
2078         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2079
2080 2017-10-13  Alex Christensen  <achristensen@webkit.org>
2081
2082         Fix API tests after r223269.
2083         https://bugs.webkit.org/show_bug.cgi?id=178246
2084
2085         * UIProcess/API/APIContentRuleListStore.cpp:
2086         (API::ContentRuleListStore::getContentRuleListSource):
2087         Version 10 also has the ability to recover content rule list source.
2088
2089 2017-10-11  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2090
2091         [GLib] WebKitNavigationAction should tell whether it is a redirect
2092         https://bugs.webkit.org/show_bug.cgi?id=178178
2093
2094         There is no good way to know whether a given navigation action has been caused
2095         by a redirect through the glib API. This is necessary to implement some app mode
2096         heuristics for Epiphany.
2097
2098         Reviewed by Carlos Garcia Campos.
2099
2100         * UIProcess/API/glib/WebKitNavigationAction.cpp:
2101         (webkit_navigation_action_is_redirect): returns whether the navigation action is a redirect.
2102         * UIProcess/API/glib/WebKitNavigationActionPrivate.h: add isRedirect to the wrapper object.
2103         (_WebKitNavigationAction::_WebKitNavigationAction):
2104         * UIProcess/API/gtk/WebKitNavigationAction.h: add the new API.
2105         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: ditto.
2106         * UIProcess/API/wpe/WebKitNavigationAction.h: ditto.
2107
2108 2017-10-12  Brady Eidson  <beidson@apple.com>
2109
2110         SW "Hello world".
2111         https://bugs.webkit.org/show_bug.cgi?id=178187
2112
2113         Reviewed by Andy Estes.
2114
2115         * WebProcess/WebProcess.cpp:
2116         (WebKit::WebProcess::startServiceWorkerContext):
2117
2118 2017-10-12  Alex Christensen  <achristensen@webkit.org>
2119
2120         Remove unnecessary includes in WebKit
2121         https://bugs.webkit.org/show_bug.cgi?id=178235
2122
2123         Reviewed by Tim Horton.
2124
2125         * Platform/IPC/ArgumentCoders.h:
2126         * WebProcess/WebProcess.cpp:
2127         * WebProcess/WebStorage/StorageAreaImpl.h:
2128
2129 2017-10-12  Alex Christensen  <achristensen@webkit.org>
2130
2131         Increment ContentRuleListStore::CurrentContentRuleListFileVersion
2132         https://bugs.webkit.org/show_bug.cgi?id=178246
2133         <rdar://problem/34890057>
2134
2135         Reviewed by Tim Horton.
2136
2137         * UIProcess/API/APIContentRuleListStore.h:
2138         Things are crashing.  Something isn't binary reverse compatible.
2139         Probably something related to r222602.
2140         This is why we have a version number to update.
2141
2142 2017-10-12  Alex Christensen  <achristensen@webkit.org>
2143
2144         Expose some of WKView's WebViewImpl accessors through WKWebViewPrivate
2145         https://bugs.webkit.org/show_bug.cgi?id=178240
2146         <rdar://problem/34962720>
2147
2148         Reviewed by Tim Horton.
2149         
2150         Also renamed createFullScreenWindow to fullScreenWindow to reflect the fact that it returns
2151         an autoreleased NSWindow so we don't make the same naming mistake in the WKWebView SPI.
2152
2153         * UIProcess/API/Cocoa/WKWebView.mm:
2154         (-[WKWebView _dismissContentRelativeChildWindows]):
2155         (-[WKWebView _setFrame:andScrollBy:]):
2156         (-[WKWebView _setTotalHeightOfBanners:]):
2157         (-[WKWebView _totalHeightOfBanners]):
2158         (-[WKWebView _beginDeferringViewInWindowChanges]):
2159         (-[WKWebView _endDeferringViewInWindowChanges]):
2160         (-[WKWebView _endDeferringViewInWindowChangesSync]):
2161         (-[WKWebView _gestureEventWasNotHandledByWebCore:]):
2162         (-[WKWebView _setIgnoresNonWheelEvents:]):
2163         (-[WKWebView _ignoresNonWheelEvents]):
2164         (-[WKWebView _setCustomSwipeViews:]):
2165         (-[WKWebView _setCustomSwipeViewsTopContentInset:]):
2166         (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
2167         (-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
2168         (-[WKWebView _fullScreenPlaceholderView]):
2169         (-[WKWebView _fullScreenWindow]):
2170         (-[WKWebView _disableFrameSizeUpdates]):
2171         (-[WKWebView _enableFrameSizeUpdates]):
2172         (-[WKWebView _canChangeFrameLayout:]):
2173         (-[WKWebView _underlayColor]):
2174         (-[WKWebView _setUnderlayColor:]):
2175         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2176         * UIProcess/API/mac/WKView.mm:
2177         (-[WKView createFullScreenWindow]):
2178         * UIProcess/Cocoa/WebViewImpl.h:
2179         * UIProcess/Cocoa/WebViewImpl.mm:
2180         (WebKit::WebViewImpl::fullScreenWindowController):
2181         (WebKit::WebViewImpl::fullScreenWindow):
2182         (WebKit::WebViewImpl::createFullScreenWindow): Deleted.
2183
2184 2017-10-12  Youenn Fablet  <youenn@apple.com>
2185
2186         Layout Test http/tests/cache-storage/cache-clearing.https.html is failing
2187         https://bugs.webkit.org/show_bug.cgi?id=178200
2188
2189         Reviewed by Chris Dumez.
2190
2191         Deleting only the per-origin folders inside the CacheStorage engine root folder.
2192
2193         * NetworkProcess/cache/CacheStorageEngine.cpp:
2194         (WebKit::CacheStorage::Engine::clearAllCaches):
2195         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2196         (WKWebsiteDataStoreRemoveAllFetchCaches):
2197         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
2198         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2199
2200 2017-10-12  Chris Dumez  <cdumez@apple.com>
2201
2202         [Mac] Add support for MouseEvent.buttons
2203         https://bugs.webkit.org/show_bug.cgi?id=178214
2204
2205         Reviewed by Ryosuke Niwa.
2206
2207         * Shared/WebEvent.h:
2208         (WebKit::WebMouseEvent::buttons const):
2209         * Shared/WebEventConversion.cpp:
2210         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
2211         * Shared/WebMouseEvent.cpp:
2212         (WebKit::WebMouseEvent::WebMouseEvent):
2213         (WebKit::WebMouseEvent::encode const):
2214         (WebKit::WebMouseEvent::decode):
2215         * Shared/mac/WebEventFactory.mm:
2216         (WebKit::currentlyPressedMouseButtons):
2217         (WebKit::WebEventFactory::createWebMouseEvent):
2218         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2219         (WebKit::PDFPlugin::showContextMenuAtPoint):
2220         * WebProcess/Plugins/PluginView.cpp:
2221         (WebKit::PluginView::createWebEvent const):
2222         * WebProcess/WebPage/WebPage.cpp:
2223         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
2224         (WebKit::WebPage::simulateMouseDown):
2225         (WebKit::WebPage::simulateMouseUp):
2226         (WebKit::WebPage::simulateMouseMotion):
2227
2228 2017-10-12  Youenn Fablet  <youenn@apple.com>
2229
2230         Add API to clean CacheStorage data
2231         https://bugs.webkit.org/show_bug.cgi?id=178034
2232
2233         Unreviewed.
2234
2235         * Shared/WebsiteData/WebsiteDataType.h: fixing the DOMCache value. 
2236
2237 2017-10-12  Stephan Szabo  <stephan.szabo@sony.com>
2238
2239         [WinCairo] add WebProcess files for wincairo webkit
2240         https://bugs.webkit.org/show_bug.cgi?id=178024
2241
2242         Reviewed by Alex Christensen.
2243
2244         * PlatformWin.cmake:
2245         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Added.
2246         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
2247         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
2248         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: Added.
2249         (WebKit::InjectedBundle::initialize):
2250         (WebKit::InjectedBundle::setBundleParameter):
2251         (WebKit::InjectedBundle::setBundleParameters):
2252         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2253         * WebProcess/Plugins/Netscape/win/PluginProxyWin.cpp: Added.
2254         (WebKit::PluginProxy::needsBackingStore const):
2255         * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp: Added.
2256         (WebKit::WebContextMenuClient::lookUpInDictionary):
2257         (WebKit::WebContextMenuClient::isSpeaking):
2258         (WebKit::WebContextMenuClient::speak):
2259         (WebKit::WebContextMenuClient::stopSpeaking):
2260         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp: Added.
2261         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
2262         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2263         (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
2264         (WebKit::WebFrameNetworkingContext::storageSession const):
2265         (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const):
2266         (WebKit::WebFrameNetworkingContext::blockedError const):
2267         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h: Added.
2268         (WebKit::WebFrameNetworkingContext::create):
2269         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Added.
2270         (WebKit::WebPopupMenu::setUpPlatformData):
2271         * WebProcess/WebPage/win/WebInspectorUIWin.cpp: Added.
2272         (WebKit::WebInspectorUI::canSave):
2273         (WebKit::WebInspectorUI::localizedStringsURL):
2274         (WebKit::RemoteWebInspectorUI::localizedStringsURL):
2275         * WebProcess/WebPage/win/WebPageWin.cpp: Added.
2276         (WebKit::WebPage::platformInitialize):
2277         (WebKit::WebPage::platformDetach):
2278         (WebKit::WebPage::platformEditorState const):
2279         (WebKit::WebPage::platformPreferencesDidChange):
2280         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
2281         (WebKit::WebPage::platformHasLocalDataForURL):
2282         (WebKit::WebPage::cachedResponseMIMETypeForURL):
2283         (WebKit::WebPage::platformCanHandleRequest):
2284         (WebKit::WebPage::cachedSuggestedFilenameForURL):
2285         (WebKit::WebPage::cachedResponseDataForURL):
2286         (WebKit::WebPage::platformUserAgent const):
2287         (WebKit::WebPage::interpretKeyEvent):
2288         * WebProcess/WebProcess.cpp:
2289         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
2290         * WebProcess/win/WebProcessWin.cpp: Added.
2291         (loadResourceIntoBuffer):
2292         (WebKit::WebProcess::platformInitializeWebProcess):
2293         (WebKit::WebProcess::platformTerminate):
2294         (WebKit::WebProcess::platformSetCacheModel):
2295
2296 2017-10-12  David Kilzer  <ddkilzer@apple.com>
2297
2298         [iOS] Fix -Wunused-lambda-capture warnings in WebCore/WebKit with new clang compiler
2299         <https://webkit.org/b/178226>
2300
2301         Reviewed by Chris Fleizach.
2302
2303         * UIProcess/ios/WKContentViewInteraction.mm:
2304         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]):
2305         - Remove unused lambda variable 'touch' which was also passed as
2306           an argument.
2307         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
2308         - Remove unused lambda variable 'gestureState' which was also
2309           passed as an argument.
2310         (-[WKContentView _simulateLongPressActionAtLocation:]):
2311         - Remove unused lambda variable 'location'.
2312
2313 2017-10-12  John Wilander  <wilander@apple.com>
2314
2315         ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
2316         https://bugs.webkit.org/show_bug.cgi?id=175257
2317         <rdar://problem/33359866>
2318
2319         Reviewed by Brent Fulgham.
2320
2321         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2322         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]):
2323         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]):
2324             Test infrastructure.
2325         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2326         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2327         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
2328         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
2329             Test infrastructure.
2330         * UIProcess/WebResourceLoadStatisticsStore.h:
2331
2332 2017-10-12  Andy Estes  <aestes@apple.com>
2333
2334         [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
2335         https://bugs.webkit.org/show_bug.cgi?id=178181
2336         <rdar://problem/33660282>
2337
2338         Reviewed by Dan Bernstein.
2339
2340         * Configurations/BaseTarget.xcconfig:
2341         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2342         (WebKit::serviceName):
2343         * WebKit.xcodeproj/project.pbxproj:
2344
2345 2017-10-12  Youenn Fablet  <youenn@apple.com>
2346
2347         CacheStorage persistent folder should be in /Library/Cache
2348         https://bugs.webkit.org/show_bug.cgi?id=178193
2349
2350         Reviewed by Brady Eidson.
2351
2352         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2353         (API::WebsiteDataStore::defaultCacheStorageDirectory): Making CacheStorage
2354         directory a subfolder of Caches folder.
2355         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2356         * UIProcess/WebProcessPool.cpp:
2357         (WebKit::legacyWebsiteDataStoreConfiguration):
2358         (WebKit::WebProcessPool::ensureNetworkProcess): Make sure the web site data store
2359         has the right cache directory path. Also make sure that the quota is set even if there is no folder specified.
2360         Quota may still be useful in case of non persistent sessions.
2361         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2362         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
2363         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
2364         (API::WebsiteDataStore::defaultCacheStorageDirectory):
2365
2366 2017-10-11  Sam Weinig  <sam@webkit.org>
2367
2368         Remove out-parameter variants of copyToVector
2369         https://bugs.webkit.org/show_bug.cgi?id=178155
2370
2371         Reviewed by Tim Horton.
2372
2373         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
2374         (-[_WKRemoteObjectInterface debugDescription]):
2375         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2376         (WebKit::dump):
2377         * UIProcess/WebPageProxy.cpp:
2378         (WebKit::WebPageProxy::resetState):
2379         * UIProcess/WebProcessPool.cpp:
2380         (WebKit::WebProcessPool::createNewWebProcess):
2381         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2382         (WebKit::WebsiteDataStore::parameters):
2383         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2384         (WebKit::WebsiteDataStore::pendingCookies const):
2385         * UIProcess/ios/ProcessAssertionIOS.mm:
2386         (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
2387         * WebProcess/Cookies/WebCookieManager.cpp:
2388         (WebKit::WebCookieManager::getHostnamesWithCookies):
2389         * WebProcess/Geolocation/WebGeolocationManager.cpp:
2390         (WebKit::WebGeolocationManager::didChangePosition):
2391         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
2392         * WebProcess/Network/WebLoaderStrategy.cpp:
2393         (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired):
2394
2395             Replace out-parameter based copyToVector, with one that returns a Vector.
2396
2397 2017-10-11  Jaehun Lim  <ljaehun.lim@samsung.com>
2398
2399         Fix debug build
2400
2401         Unreviewed.
2402
2403         Add ENABLE(SERVICE_WORKER) guard.
2404
2405         * UIProcess/WebProcessPool.cpp:
2406         (WebKit::WebProcessPool::createWebPage):
2407
2408 2017-10-11  Youenn Fablet  <youenn@apple.com>
2409
2410         Add API to clean CacheStorage data
2411         https://bugs.webkit.org/show_bug.cgi?id=178034
2412
2413         Unreviewed.
2414
2415         * NetworkProcess/NetworkProcess.cpp:
2416         (WebKit::NetworkProcess::fetchWebsiteData): Fixing lifetime of aggregator.
2417
2418 2017-10-11  Youenn Fablet  <youenn@apple.com>
2419
2420         Add API to clean CacheStorage data
2421         https://bugs.webkit.org/show_bug.cgi?id=178034
2422
2423         Reviewed by Chris Dumez.
2424
2425         Introducing a new website data type for DOMCache.
2426         Adding API to delete DOMCache for a given origin or for all origins.
2427         This is added to WKWebsiteDataStore.
2428
2429         Cleaning a CacheStorage will remove all data in the Cache object but the object will stay live
2430         for the duration of the NetworkProcess.
2431         This allows ensuring that once a cache is cleaned, WebProcess will update to this new state.
2432
2433         Fetching of WebsiteData for DOMCache is not implemented yet since we do not keep a list of all origins for which we have data.
2434
2435         * NetworkProcess/NetworkProcess.cpp:
2436         (WebKit::fetchDOMCacheEntries):
2437         (WebKit::NetworkProcess::fetchWebsiteData):
2438         (WebKit::NetworkProcess::deleteWebsiteData):
2439         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2440         * NetworkProcess/cache/CacheStorageEngine.cpp:
2441         (WebKit::CacheStorage::Engine::cachesRootPath):
2442         (WebKit::CacheStorage::Engine::fetchEntries):
2443         (WebKit::CacheStorage::ClearTasksHandler::ClearTasksHandler):
2444         (WebKit::CacheStorage::ClearTasksHandler::~ClearTasksHandler):
2445         (WebKit::CacheStorage::Engine::clearEngines):
2446         (WebKit::CacheStorage::Engine::clearCachesForOrigins):
2447         (WebKit::CacheStorage::Engine::readCachesFromDisk):
2448         (WebKit::CacheStorage::deleteFolder):
2449         (WebKit::CacheStorage::Engine::clearCaches):
2450         (WebKit::CacheStorage::Engine::unlock): Removing the assertion as Cache objects are removed when clearing data.
2451         * NetworkProcess/cache/CacheStorageEngine.h:
2452         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2453         (WebKit::CacheStorage::Caches::Caches):
2454         (WebKit::CacheStorage::Caches::clear):
2455         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2456         (WebKit::CacheStorage::Caches::create):
2457         * Shared/WebsiteData/WebsiteDataType.h:
2458         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2459         (WKWebsiteDataStoreRemoveAllDOMCaches):
2460         (WKWebsiteDataStoreRemoveDOMCacheForOrigin):
2461         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2462         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2463         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2464         (dataTypesToString):
2465         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2466         (WebKit::toWebsiteDataType):
2467         (WebKit::toWKWebsiteDataTypes):
2468         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2469         (+[WKWebsiteDataStore allWebsiteDataTypes]):
2470         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2471         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
2472         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
2473
2474 2017-10-11  Chris Dumez  <cdumez@apple.com>
2475
2476         [Geolocation] Expose Coordinates.floorLevel
2477         https://bugs.webkit.org/show_bug.cgi?id=178173
2478         <rdar://problem/34918936>
2479
2480         Reviewed by Ryosuke Niwa.
2481
2482         * UIProcess/API/C/WKGeolocationPosition.cpp:
2483         (WKGeolocationPositionCreate):
2484         (WKGeolocationPositionCreate_b):
2485         (WKGeolocationPositionCreate_c):
2486         * UIProcess/API/C/WKGeolocationPosition.h:
2487
2488 2017-10-11  Youenn Fablet  <youenn@apple.com>
2489
2490         Bump default cache storage quota to 20MB
2491         https://bugs.webkit.org/show_bug.cgi?id=178132
2492
2493         Reviewed by Alex Christensen.
2494
2495         Adding the ability to set the quota per origin through WebsiteDataStore.
2496         Moving cache storage directory setting also in WebsiteDataStore.
2497
2498         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2499         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
2500         * NetworkProcess/NetworkProcess.cpp:
2501         (WebKit::NetworkProcess::initializeNetworkProcess):
2502         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2503         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2504         * Shared/WebsiteDataStoreParameters.cpp:
2505         (WebKit::WebsiteDataStoreParameters::encode const):
2506         (WebKit::WebsiteDataStoreParameters::decode):
2507         * Shared/WebsiteDataStoreParameters.h:
2508         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2509         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2510         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
2511         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
2512         (API::ProcessPoolConfiguration::copy):
2513         * UIProcess/API/APIProcessPoolConfiguration.h:
2514         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2515         * UIProcess/API/C/WKContextConfigurationRef.h:
2516         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2517         (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]):
2518         (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]):
2519         (-[WKWebsiteDataStore _cacheStorageDirectory]):
2520         (-[WKWebsiteDataStore _setCacheStorageDirectory:]):
2521         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2522         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2523         * UIProcess/WebProcessPool.cpp:
2524         (WebKit::legacyWebsiteDataStoreConfiguration):
2525         (WebKit::WebProcessPool::ensureNetworkProcess):
2526         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
2527         * UIProcess/WebProcessPool.h:
2528         * UIProcess/WebsiteData/WebsiteDataStore.h:
2529         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
2530         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
2531         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
2532         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
2533
2534 2017-10-11  Myles C. Maxfield  <mmaxfield@apple.com>
2535
2536         Allow PAL to log messages
2537         https://bugs.webkit.org/show_bug.cgi?id=171523
2538
2539         Reviewed by Alex Christensen.
2540
2541         * Platform/Logging.h:
2542         * Scripts/generate-forwarding-headers.pl:
2543
2544 2017-10-11  Ryosuke Niwa  <rniwa@webkit.org>
2545
2546         Sanitize URL in pasteboard for other applications and cross origin content
2547         https://bugs.webkit.org/show_bug.cgi?id=178060
2548         <rdar://problem/34874518>
2549
2550         Reviewed by Wenson Hsieh.
2551
2552         Plubmed the origin identifier through IPC from Pasteboard in WebContent process to PlatformPasteboard in UIProcess.
2553
2554         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2555         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2556         * UIProcess/WebPasteboardProxy.cpp:
2557         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2558         * UIProcess/WebPasteboardProxy.h:
2559         * UIProcess/WebPasteboardProxy.messages.in:
2560         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2561         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
2562         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2563
2564 2017-10-11  Chris Dumez  <cdumez@apple.com>
2565
2566         Modernize Geolocation code
2567         https://bugs.webkit.org/show_bug.cgi?id=178148
2568
2569         Reviewed by Ryosuke Niwa.
2570
2571         * Shared/WebGeolocationPosition.cpp:
2572         (WebKit::WebGeolocationPosition::create):
2573         (WebKit::WebGeolocationPosition::~WebGeolocationPosition):
2574         * Shared/WebGeolocationPosition.h:
2575         (WebKit::WebGeolocationPosition::timestamp const):
2576         (WebKit::WebGeolocationPosition::latitude const):
2577         (WebKit::WebGeolocationPosition::longitude const):
2578         (WebKit::WebGeolocationPosition::accuracy const):
2579         (WebKit::WebGeolocationPosition::altitude const):
2580         (WebKit::WebGeolocationPosition::altitudeAccuracy const):
2581         (WebKit::WebGeolocationPosition::heading const):
2582         (WebKit::WebGeolocationPosition::speed const):
2583         (WebKit::WebGeolocationPosition::corePosition const):
2584         (WebKit::WebGeolocationPosition::WebGeolocationPosition):
2585         * UIProcess/API/C/WKGeolocationPosition.cpp:
2586         (WKGeolocationPositionCreate_b):
2587         * UIProcess/API/Cocoa/_WKGeolocationPosition.mm:
2588         (WebKit::wrapper):
2589         * UIProcess/API/glib/WebKitGeolocationProvider.cpp:
2590         (WebKit::WebKitGeolocationProvider::notifyPositionChanged):
2591         * UIProcess/WebGeolocationManagerProxy.cpp:
2592         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition):
2593         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2594         (-[WKLegacyCoreLocationProvider positionChanged:]):
2595         * WebProcess/Geolocation/WebGeolocationManager.cpp:
2596         (WebKit::WebGeolocationManager::didChangePosition):
2597         * WebProcess/Geolocation/WebGeolocationManager.h:
2598         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
2599         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
2600         (WebKit::WebGeolocationClient::lastPosition):
2601         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
2602
2603 2017-10-11  Brady Eidson  <beidson@apple.com>
2604
2605         Add a SW context process (where SW scripts will actually execute).
2606         https://bugs.webkit.org/show_bug.cgi?id=178156
2607
2608         Reviewed by Andy Estes.
2609
2610         This patch adds an auxiliary "ServiceWorker context" WebProcess to a WebProcessPool.
2611
2612         This process is where ServiceWorker scripts will execute, separate from the client WebProcess
2613         hosting the page(s) they are serving.
2614
2615         This patch also adds all of the plumbing to pass along a fetched service worker script to this
2616         context WebProcess, as well as message back failure to actually start the script so we can test.
2617
2618         Touches lots of code sites but is basically just a lot of plumbing.
2619
2620         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2621         (WebKit::WebSWServerConnection::WebSWServerConnection):
2622         (WebKit::WebSWServerConnection::startServiceWorkerContext):
2623         (WebKit::WebSWServerConnection::sendToContextProcess):
2624         (WebKit::WebSWServerConnection::setContextConnection):
2625         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2626
2627         * StorageProcess/StorageProcess.cpp:
2628         (WebKit::StorageProcess::workerContextProcessConnection):
2629         (WebKit::StorageProcess::createWorkerContextProcessConnection):
2630         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
2631         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
2632         (WebKit::StorageProcess::registerSWServerConnection):
2633         (WebKit::StorageProcess::unregisterSWServerConnection):
2634         * StorageProcess/StorageProcess.h:
2635         * StorageProcess/StorageProcess.messages.in:
2636
2637         * StorageProcess/StorageToWebProcessConnection.cpp:
2638         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
2639         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2640         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
2641         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
2642         * StorageProcess/StorageToWebProcessConnection.h:
2643
2644         * UIProcess/Storage/StorageProcessProxy.cpp:
2645         (WebKit::StorageProcessProxy::create):
2646         (WebKit::StorageProcessProxy::StorageProcessProxy):
2647         (WebKit::StorageProcessProxy::didClose):
2648         (WebKit::StorageProcessProxy::getWorkerContextProcessConnection):
2649         (WebKit::StorageProcessProxy::didGetWorkerContextProcessConnection):
2650         * UIProcess/Storage/StorageProcessProxy.h:
2651         * UIProcess/Storage/StorageProcessProxy.messages.in:
2652
2653         * UIProcess/WebProcessPool.cpp:
2654         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
2655         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
2656         (WebKit::WebProcessPool::didGetWorkerContextProcessConnection):
2657         (WebKit::WebProcessPool::disconnectProcess):
2658         (WebKit::WebProcessPool::createWebPage):
2659         * UIProcess/WebProcessPool.h:
2660
2661         * UIProcess/WebProcessProxy.cpp:
2662         (WebKit::WebProcessProxy::didGetWorkerContextConnection):
2663         * UIProcess/WebProcessProxy.h:
2664         * UIProcess/WebProcessProxy.messages.in:
2665
2666         * WebProcess/WebProcess.cpp:
2667         (WebKit::WebProcess::getWorkerContextConnection):
2668         (WebKit::WebProcess::startServiceWorkerContext):
2669         * WebProcess/WebProcess.h:
2670         * WebProcess/WebProcess.messages.in:
2671
2672 2017-10-11  Don Olmstead  <don.olmstead@sony.com>
2673
2674         Remove ENABLE_NETWORK_CACHE
2675         https://bugs.webkit.org/show_bug.cgi?id=177424
2676
2677         Reviewed by Antti Koivisto.
2678
2679         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2680         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
2681         * NetworkProcess/NetworkConnectionToWebProcess.h:
2682         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2683         * NetworkProcess/NetworkProcess.cpp:
2684         (WebKit::fetchDiskCacheEntries):
2685         (WebKit::clearDiskCacheEntries):
2686         (WebKit::NetworkProcess::setCacheModel):
2687         * NetworkProcess/NetworkProcess.h:
2688         (WebKit::NetworkProcess::cache):
2689         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2690         (WebKit::NetworkProcessCreationParameters::encode const):
2691         (WebKit::NetworkProcessCreationParameters::decode):
2692         * NetworkProcess/NetworkProcessCreationParameters.h:
2693         * NetworkProcess/NetworkResourceLoader.cpp:
2694         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2695         (WebKit::NetworkResourceLoader::canUseCachedRedirect const):
2696         (WebKit::NetworkResourceLoader::start):
2697         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2698         (WebKit::NetworkResourceLoader::startNetworkLoad):
2699         (WebKit::NetworkResourceLoader::abort):
2700         (WebKit::NetworkResourceLoader::didReceiveResponse):
2701         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2702         (WebKit::NetworkResourceLoader::didFinishLoading):
2703         (WebKit::NetworkResourceLoader::didFailLoading):
2704         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
2705         (WebKit::NetworkResourceLoader::continueWillSendRequest):
2706         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
2707         * NetworkProcess/NetworkResourceLoader.h:
2708         * NetworkProcess/cache/NetworkCache.cpp:
2709         * NetworkProcess/cache/NetworkCache.h:
2710         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2711         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
2712         * NetworkProcess/cache/NetworkCacheCoders.cpp:
2713         * NetworkProcess/cache/NetworkCacheCoders.h:
2714         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
2715         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
2716         * NetworkProcess/cache/NetworkCacheData.cpp:
2717         * NetworkProcess/cache/NetworkCacheData.h:
2718         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
2719         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
2720         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2721         * NetworkProcess/cache/NetworkCacheEntry.h:
2722         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2723         * NetworkProcess/cache/NetworkCacheFileSystem.h:
2724         * NetworkProcess/cache/NetworkCacheIOChannel.h:
2725         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2726         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2727         * NetworkProcess/cache/NetworkCacheKey.cpp:
2728         * NetworkProcess/cache/NetworkCacheKey.h:
2729         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2730         * NetworkProcess/cache/NetworkCacheStatistics.h:
2731         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2732         * NetworkProcess/cache/NetworkCacheStorage.h:
2733         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2734         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2735         (WebKit::NetworkProcess::clearDiskCache):
2736         * NetworkProcess/ios/NetworkProcessIOS.mm:
2737         (WebKit::NetworkProcess::clearCacheForAllOrigins):
2738         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2739         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2740         (WebKit::NetworkProcess::clearDiskCache):
2741         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2742         (WebKit::registerUserDefaultsIfNeeded):
2743         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2744         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2745         (WebKit::WebProcessPool::isNetworkCacheEnabled):
2746         * UIProcess/soup/WebProcessPoolSoup.cpp:
2747         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2748         * WebProcess/Network/WebLoaderStrategy.cpp:
2749         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
2750         * config.h:
2751
2752 2017-10-11  Michael Catanzaro  <mcatanzaro@igalia.com>
2753
2754         Unreviewed, rolling out r223146.
2755
2756         Better to not expose cairo in the WPE API
2757
2758         Reverted changeset:
2759
2760         "[WPE] Header cairo.h is used in GLib API headers but cannot
2761         be found"
2762         https://bugs.webkit.org/show_bug.cgi?id=178100
2763         http://trac.webkit.org/changeset/223146
2764
2765 2017-09-27  Frederic Wang  <fwang@igalia.com>
2766
2767         [iOS] Do not flatten frames when async frame scrolling is enabled
2768         https://bugs.webkit.org/show_bug.cgi?id=173704
2769
2770         Reviewed by Simon Fraser.
2771
2772         This patch disables frame flattening when async frame scrolling is enabled on iOS, as
2773         otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
2774         developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
2775         in the "Experimental WebKit Features" menu of Safari iOS.
2776
2777         Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
2778
2779         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2780         (WebKit::WebChromeClient::contentsSizeChanged): Use effectiveFrameFlattening() introduced in
2781         Source/WebCore.
2782
2783 2017-10-10  Ryosuke Niwa  <rniwa@webkit.org>
2784
2785         Enable custom pasteboard data in DumpRenderTree and WebKitTestRunner
2786         https://bugs.webkit.org/show_bug.cgi?id=178154
2787
2788         Reviewed by Wenson Hsieh.
2789
2790         Plumbed customPasteboardDataEnabled flag to be used in WebKitTestRunner.
2791
2792         * Shared/WebPreferencesDefinitions.h:
2793         * UIProcess/API/C/WKPreferences.cpp:
2794         (WKPreferencesSetCustomPasteboardDataEnabled):
2795         (WKPreferencesGetCustomPasteboardDataEnabled):
2796         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2797         * WebProcess/WebPage/WebPage.cpp:
2798         (WebKit::WebPage::updatePreferences):
2799
2800 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2801
2802         [WPE] Remove the possibility of installing the old WebKit2 C API
2803         https://bugs.webkit.org/show_bug.cgi?id=178125
2804
2805         Reviewed by Michael Catanzaro.
2806
2807         * PlatformWPE.cmake: Remove support for installing the deprecated C API.
2808
2809 2017-10-10  Chris Dumez  <cdumez@apple.com>
2810
2811         [WK2] Add API to clear service worker registrations
2812         https://bugs.webkit.org/show_bug.cgi?id=178085
2813         <rdar://problem/34866025>
2814
2815         Reviewed by Ryosuke Niwa.
2816
2817         Add API to clear service worker registrations. Although the request to
2818         clear the registration is passed on to the StorageProcess, it is currently
2819         a no-op on StorageProcess side until we actually persist service worker
2820         registrations on disk.
2821
2822         * Shared/WebsiteData/WebsiteDataType.h:
2823         * StorageProcess/StorageProcess.cpp:
2824         (WebKit::StorageProcess::fetchWebsiteData):
2825         (WebKit::StorageProcess::deleteWebsiteData):
2826         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2827         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2828         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
2829         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2830         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2831         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2832         (dataTypesToString):
2833         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2834         (WebKit::toWebsiteDataType):
2835         (WebKit::toWKWebsiteDataTypes):
2836         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2837         (+[WKWebsiteDataStore allWebsiteDataTypes]):
2838         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2839         (WebKit::WebsiteDataStore::fetchDataAndApply):
2840         (WebKit::WebsiteDataStore::removeData):
2841
2842 2017-10-10  Commit Queue  <commit-queue@webkit.org>
2843
2844         Unreviewed, rolling out r223130.
2845         https://bugs.webkit.org/show_bug.cgi?id=178147
2846
2847         Breaks the build when EGLNativeWindowType is a pointer
2848         (Requested by aperezdc on #webkit).
2849
2850         Reverted changeset:
2851
2852         "[WPE] Build failure due to invalid cast of
2853         EGLNativeWindowType when targetting 64-bit ARM"
2854         https://bugs.webkit.org/show_bug.cgi?id=178090
2855         http://trac.webkit.org/changeset/223130
2856
2857 2017-10-10  Sam Weinig  <sam@webkit.org>
2858
2859         Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
2860         https://bugs.webkit.org/show_bug.cgi?id=178102
2861
2862         Reviewed by Tim Horton.
2863
2864         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2865         (WebKit::NetworkConnectionToWebProcess::didClose):
2866         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
2867         (WebKit::dumpChangedLayers):
2868         * UIProcess/API/glib/WebKitWebContext.cpp:
2869         (webkitWebContextInvalidateCustomProtocolRequests):
2870         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2871         (webkitWebViewBaseContainerForall):
2872         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
2873         (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]):
2874         * UIProcess/GenericCallback.h:
2875         (WebKit::invalidateCallbackMap):
2876         * UIProcess/WebProcessProxy.cpp:
2877         (WebKit::WebProcessProxy::shutDown):
2878         (WebKit::WebProcessProxy::didClose):
2879         (WebKit::WebProcessProxy::didBecomeUnresponsive):
2880         (WebKit::WebProcessProxy::didBecomeResponsive):
2881         (WebKit::WebProcessProxy::willChangeIsResponsive):
2882         (WebKit::WebProcessProxy::didChangeIsResponsive):
2883         (WebKit::WebProcessProxy::disconnectFramesFromPage):
2884         (WebKit::WebProcessProxy::frameCountInPage const):
2885         (WebKit::WebProcessProxy::requestTermination):
2886         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2887         (WebKit::NPRuntimeObjectMap::invalidate):
2888         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2889         (WebKit::NetscapePlugin::stopAllStreams):
2890         * WebProcess/Plugins/PluginView.cpp:
2891         (WebKit::PluginView::cancelAllStreams):
2892         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
2893         (WebKit::RemoteLayerTreeContext::buildTransaction):
2894         * WebProcess/WebProcess.cpp:
2895         (WebKit::WebProcess::didClose):
2896
2897 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2898
2899         [WPE] Header cairo.h is used in GLib API headers but cannot be found
2900         https://bugs.webkit.org/show_bug.cgi?id=178100
2901
2902         Reviewed by Michael Catanzaro.
2903
2904         * wpe/wpe-webkit.pc.in: Add Cairo to the "Requires" field, so its flags get pulled
2905         in and the "cairo.h", used in the WPE WebKit GLib API headers, can be found.
2906
2907 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2908
2909         CSS constant properties should not be enabled by default
2910         https://bugs.webkit.org/show_bug.cgi?id=177416
2911
2912         Reviewed by Darin Adler.
2913
2914         * Shared/WebPreferencesDefinitions.h:
2915
2916 2017-10-10  Brady Eidson  <beidson@apple.com>
2917
2918         Random StorageProcess and SWServer cleanup.
2919         https://bugs.webkit.org/show_bug.cgi?id=178141
2920
2921         Reviewed by Andy Estes.
2922
2923         -StorageProcess should own the set of SWServers
2924         -Some renaming and cleanup
2925
2926         * StorageProcess/StorageProcess.cpp:
2927         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2928         (WebKit::StorageProcess::swServerForSession):
2929         * StorageProcess/StorageProcess.h:
2930         (WebKit::StorageProcess::queue):
2931
2932         * StorageProcess/StorageToWebProcessConnection.cpp:
2933         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2934         * StorageProcess/StorageToWebProcessConnection.h:
2935
2936 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2937
2938         Unreviewed, rolling out r223136.
2939
2940         Forgot to update GTK API header
2941
2942         Reverted changeset:
2943
2944         "[WPE] Header cairo.h is used in GLib API headers but cannot
2945         be found"
2946         https://bugs.webkit.org/show_bug.cgi?id=178100
2947         http://trac.webkit.org/changeset/223136
2948
2949 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2950
2951         [WPE] Header cairo.h is used in GLib API headers but cannot be found
2952         https://bugs.webkit.org/show_bug.cgi?id=178100
2953
2954         Reviewed by Žan Doberšek.
2955
2956         Instead of including <cairo.h>, it is better to forward-declare cairo_surface_t,
2957         which is the one and only Cairo declaration needed by the WPE API header.
2958
2959         * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Add inclusion of <cairo.h>.
2960         * UIProcess/API/glib/WebKitWebView.cpp: Add inclusion of <cairo.h>.
2961         * UIProcess/API/wpe/WebKitFaviconDatabase.h: Add forward declaration of cairo_surface_t.
2962
2963 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2964
2965         [WPE] Cannot link against libWPEWebkit due to wrong contents of wpe-webkit.pc
2966         https://bugs.webkit.org/show_bug.cgi?id=178133
2967
2968         Reviewed by Žan Doberšek.
2969
2970         * wpe/wpe-webkit.pc.in: Remove "-lWPE" and replace "Requires.private" with a plain "Requires".
2971
2972 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2973
2974         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
2975         https://bugs.webkit.org/show_bug.cgi?id=178090
2976
2977         Reviewed by Žan Doberšek.
2978
2979         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
2980         (WebKit::AcceleratedSurfaceWPE::window const): Use static_cast instead of reinterpret_cast,
2981         this way extending values of EGLNativeWindowType to 64 bits is allowed.
2982
2983 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2984
2985         [WPE] GLib API headers WebKitScriptDialog.h and WebKitFileChooserRequest.h are not installed
2986         https://bugs.webkit.org/show_bug.cgi?id=178104
2987
2988         Reviewed by Žan Doberšek.
2989
2990         * PlatformWPE.cmake: Add missing header paths to the WPE_API_INSTALLED_HEADERS variable.
2991
2992 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2993
2994         [WPE][CMake] The “install” target should install all public API headers
2995         https://bugs.webkit.org/show_bug.cgi?id=176475
2996
2997         Reviewed by Žan Doberšek.
2998
2999         Install the WPE port GLib-based API headers. The deprecated C API is still available,
3000         but disabled by default behind the "EXPORT_DEPRECATED_WEBKIT2_C_API" CMake option.
3001
3002         * PlatformWPE.cmake: Always install "wpe-webkit.pc" and the GLib C API for WPE.
3003
3004 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
3005
3006         Fix typo of virtual keyword in PageClientImplIOS.h
3007         https://bugs.webkit.org/show_bug.cgi?id=178088
3008
3009         Reviewed by Simon Fraser.
3010
3011         This compile error happens when FULLSCREEN_API is enabled for iOS.
3012         Remove the redundant virtual keyword since function is marked override.
3013
3014         * UIProcess/ios/PageClientImplIOS.h:
3015
3016 2017-10-09  Chris Dumez  <cdumez@apple.com>
3017
3018         [iOS][WK2] Tiles outsides the viewport are sometimes missing after relaunching a crashes WebProcess
3019         https://bugs.webkit.org/show_bug.cgi?id=178095
3020         <rdar://problem/34415016>
3021
3022         Reviewed by Simon Fraser.
3023
3024         Make sure we reset WKWebView._hasScheduledVisibleRectUpdate to NO in WKWebView._processDidExit.
3025         _scheduleVisibleContentRectUpdateAfterScrollInView would otherwise return early because
3026         WKWebView._hasScheduledVisibleRectUpdate is always YES. Normally,
3027         _addUpdateVisibleContentRectPreCommitHandler sets a CATransaction commit handler that
3028         resets _hasScheduledVisibleRectUpdate to NO, but it does not do so when ![webView _isValid]
3029         (which is true when the WebProcess has crashed.
3030
3031         Also reset WKWebView._commitDidRestoreScrollPosition to NO in WKWebView._processDidExit even
3032         though it does not seem to be the cause of this bug. It seems to make sense to reset this member
3033         when the process crashes.
3034
3035         * UIProcess/API/Cocoa/WKWebView.mm:
3036         (-[WKWebView _processDidExit]):
3037
3038 2017-10-09  Youenn Fablet  <youenn@apple.com>
3039
3040         Add quota to cache API
3041         https://bugs.webkit.org/show_bug.cgi?id=177552
3042
3043         Reviewed by Alex Christensen.
3044
3045         Adding support for quota checking in CacheStorage::Caches.
3046         It is passed to NetworkProcess at creation time.
3047         Default quota size is configured to 400Ko by origin per default.
3048         This value is suitable for testing.
3049         Future patch should raise this default value and allows configuring it.
3050
3051         Quota is computed based on the response body size.
3052         This size is padded at WebCore for opaque responses.
3053         Size is stored persistently as opaque response padded size should remain stable.
3054         See https://github.com/whatwg/storage/issues/31 for the rationale about this padding.
3055
3056         In case of putting several records at the same time, the size of all records
3057         is computed so that all records will be written or rejected together.
3058
3059         Sending QuotaExceeded error when quota is exceeded.
3060         Future effort should allow asking UIProcess for quota extension.
3061
3062         * NetworkProcess/NetworkProcess.cpp:
3063         (WebKit::NetworkProcess::cacheStoragePerOriginQuota const):
3064         * NetworkProcess/NetworkProcess.h:
3065         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3066         (WebKit::NetworkProcessCreationParameters::encode const):
3067         (WebKit::NetworkProcessCreationParameters::decode):
3068         * NetworkProcess/NetworkProcessCreationParameters.h:
3069         * NetworkProcess/cache/CacheStorageEngine.cpp:
3070         (WebKit::CacheStorage::Engine::readCachesFromDisk):
3071         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3072         (WebKit::CacheStorage::Cache::toRecordInformation):
3073         (WebKit::CacheStorage::isolatedCopy):
3074         (WebKit::CacheStorage::Cache::open):
3075         (WebKit::CacheStorage::Cache::storeRecords):
3076         (WebKit::CacheStorage::Cache::put):
3077         (WebKit::CacheStorage::Cache::writeRecordToDisk):
3078         (WebKit::CacheStorage::Cache::updateRecordToDisk):
3079         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
3080         (WebKit::CacheStorage::Cache::encode):
3081         (WebKit::CacheStorage::Cache::decodeRecordHeader):
3082         (WebKit::CacheStorage::Cache::decode):
3083         * NetworkProcess/cache/CacheStorageEngineCache.h:
3084         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3085         (WebKit::CacheStorage::Caches::Caches):
3086         (WebKit::CacheStorage::Caches::initialize):
3087         (WebKit::CacheStorage::Caches::initializeSize):
3088         (WebKit::CacheStorage::Caches::requestSpace):
3089         (WebKit::CacheStorage::Caches::writeRecord):
3090         (WebKit::CacheStorage::Caches::removeRecord):
3091         (WebKit::CacheStorage::Caches::removeCacheEntry):
3092         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3093         (WebKit::CacheStorage::Caches::create):
3094         (WebKit::CacheStorage::Caches::hasEnoughSpace const):
3095         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3096         (WebKit::NetworkCache::Storage::traverse):
3097         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3098         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3099         * Shared/WebCoreArgumentCoders.cpp:
3100         (IPC::ArgumentCoder<DOMCacheEngine::Record>::encode):
3101         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
3102         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3103         (API::ProcessPoolConfiguration::copy):
3104         * UIProcess/API/APIProcessPoolConfiguration.h:
3105         * UIProcess/WebProcessPool.cpp:
3106         (WebKit::WebProcessPool::ensureNetworkProcess):
3107
3108 2017-10-09  Sam Weinig  <sam@webkit.org>
3109
3110         Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
3111         https://bugs.webkit.org/show_bug.cgi?id=178072
3112
3113         Reviewed by Darin Adler.
3114
3115         * Shared/AsyncRequest.h:
3116         (WebKit::AsyncRequestMap::values):
3117         * UIProcess/WebProcessProxy.h:
3118         (WebKit::WebProcessProxy::pages const):
3119
3120             Update for type change for HashMap::values().
3121
3122 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
3123
3124         Incorrect fullscreen animation when element has a transform.
3125         https://bugs.webkit.org/show_bug.cgi?id=177558
3126         rdar://problem/29603741
3127
3128         Reviewed by Jer Noble.
3129
3130         Use a bit of code from element fullscreen to do this correctly for video fullscreen.
3131         The key is to get the absolute quad from the renderer. This will work for scaling,
3132         But since we still take the bounding box, it won't work for rotations.
3133
3134         * WebProcess/cocoa/VideoFullscreenManager.mm:
3135         (WebKit::inlineVideoFrame):
3136
3137 2017-10-09  Robin Morisset  <rmorisset@apple.com>
3138
3139         Make the names of the options consistent
3140         https://bugs.webkit.org/show_bug.cgi?id=177933
3141
3142         Reviewed by Saam Barati.
3143
3144         * NetworkProcess/capture/json.hpp:
3145         * Platform/IPC/Connection.cpp:
3146         (IPC::Connection::connectionDidClose):
3147         * UIProcess/API/Cocoa/WKWebView.mm:
3148         (-[WKWebView _keyboardWillHide:]):
3149         * UIProcess/WebPageProxy.cpp:
3150         (WebKit::WebPageProxy::runModal):
3151         * UIProcess/mac/WebInspectorProxyMac.mm:
3152         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
3153         * WebProcess/WebPage/ios/WebPageIOS.mm:
3154         (WebKit::WebPage::selectWithGesture):
3155
3156 2017-10-09  Adrian Perez de Castro  <aperez@igalia.com>
3157
3158         [WPE][GTK] Propagate libepoxy compiler flags obtained from pkg-config
3159         https://bugs.webkit.org/show_bug.cgi?id=178081
3160
3161         Reviewed by Carlos Alberto Lopez Perez.
3162
3163         * CMakeLists.txt: Use ${LIBEPOXY_DEFINITIONS} for building WebKit.
3164
3165 2017-10-08  Tim Horton  <timothy_horton@apple.com>
3166
3167         mediaPlaybackRequiresUserAction API replacement annotation is wrong
3168         https://bugs.webkit.org/show_bug.cgi?id=178063
3169
3170         Reviewed by Dan Bernstein.
3171
3172         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3173         mediaPlaybackRequiresUserAction suggests that you should use 
3174         requiresUserActionForMediaPlayback instead, but that is also deprecated.
3175         Instead, follow the chain and suggest mediaTypesRequiringUserActionForPlayback.
3176
3177 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3178
3179         [iOS WK2] API tests added in r222991 are failing in iOS 11 test runners
3180         https://bugs.webkit.org/show_bug.cgi?id=178037
3181
3182         Reviewed by Tim Horton.
3183
3184         This patch carries out some minor cleanup around UIKitSPI.h in WebKit2, so that the internal SDK isn't required
3185         to implement -[WKContentView insertTextSuggestion:].
3186
3187         * Platform/spi/ios/UIKitSPI.h:
3188         * UIProcess/ios/WKContentViewInteraction.mm:
3189         (-[WKContentView insertTextSuggestion:]):
3190
3191 2017-10-06  Chris Dumez  <cdumez@apple.com>
3192
3193         [Beacon][Cocoa] Beacon requests with BufferSource payload should not have a Content-Type HTTP header
3194         https://bugs.webkit.org/show_bug.cgi?id=178027
3195         <rdar://problem/34748470>
3196
3197         Reviewed by Youenn Fablet.
3198
3199         Use new NSURLSessionConfiguration._suppressedAutoAddedHTTPHeaders CFNetwork SPI to
3200         make sure that CFNetwork never adds a Content-Type HTTP headers to our requests
3201         when we did not add one.
3202
3203         This is covered by the following tests on newer OSes:
3204         - imported/w3c/web-platform-tests/beacon/headers/header-content-type.html
3205         - http/tests/blink/sendbeacon/beacon-same-origin.html
3206
3207         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3208         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3209
3210 2017-10-06  Aishwarya Nirmal  <anirmal@apple.com>
3211
3212         [iOS] Respect the "caret-color" CSS property when editing 
3213         https://bugs.webkit.org/show_bug.cgi?id=177489
3214         <rdar://problem/34600419>
3215
3216         Reviewed by Tim Horton.
3217
3218         This change adds support for the caret-color property on iOS.
3219
3220         * Shared/EditorState.cpp:
3221         (WebKit::EditorState::PostLayoutData::encode const):
3222         (WebKit::EditorState::PostLayoutData::decode):
3223         * Shared/EditorState.h:
3224         * UIProcess/ios/WKContentViewInteraction.mm:
3225         (-[WKContentView insertionPointColor]):
3226         * WebProcess/WebPage/ios/WebPageIOS.mm:
3227         (WebKit::WebPage::platformEditorState const):
3228
3229 2017-10-06  Brian Burg  <bburg@apple.com>
3230
3231         Web Inspector: clicking in Inspector webview clears the selection in the inspected page
3232         https://bugs.webkit.org/show_bug.cgi?id=178014
3233         <rdar://problem/12706857>
3234
3235         Reviewed by Timothy Hatcher.
3236
3237         If the Inspector is docked to the inspected view, clicking on the Inspector
3238         webview will cause selection in the inspected view to be lost. This is because
3239         the selection is lost when the web view resigns first responder.
3240
3241         Add a check in maintainsInactiveSelection to always retain selection if
3242         Web Inspector is open. This approach seems simpler than trying to sync a client's
3243         usage of WKPageSetMaintainsInactiveSelection with overrides that need to be applied
3244         and unapplied when an inspector web view is shown or hidden.
3245
3246         * UIProcess/WebPageProxy.cpp:
3247         (WebKit::WebPageProxy::maintainsInactiveSelection const):
3248         (WebKit::WebPageProxy::inspector const): Drive by, use nullptr.
3249
3250         * UIProcess/WebPageProxy.h:
3251         (WebKit::WebPageProxy::maintainsInactiveSelection const): Deleted.
3252
3253 2017-10-06  Alex Christensen  <achristensen@webkit.org>
3254
3255         Add more infrastructure to apply custom headers to same-origin requests
3256         https://bugs.webkit.org/show_bug.cgi?id=177629
3257
3258         Reviewed by Ryosuke Niwa.
3259
3260         * UIProcess/API/C/WKWebsitePolicies.cpp:
3261         (WKWebsitePoliciesCopyCustomHeaderFields):
3262         (WKWebsitePoliciesSetCustomHeaderFields):
3263         * UIProcess/API/C/WKWebsitePolicies.h:
3264         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3265         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
3266         (-[_WKWebsitePolicies customHeaderFields]):
3267         (-[_WKWebsitePolicies setCustomHeaderFields:]):
3268
3269         Make the SPI for setting custom header fields take a dictionary<String, String>
3270         instead of an array of Strings with colons. This matches NSURLRequest and other
3271         APIs that deal with header fields.
3272
3273 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3274
3275         [iOS] Tweak support for classifying form controls (followup to r222487)
3276         https://bugs.webkit.org/show_bug.cgi?id=177917
3277         <rdar://problem/34820122>
3278
3279         Reviewed by Dean Jackson.
3280
3281         This patch follows up with <http://trac.webkit.org/r222487>. It combines the functionality of two SPI hooks
3282         implemented on WKContentView into a single method that vends a context dictionary, and additionally addresses an
3283         issue with the original implementation, wherein some cached state on WebPageProxy is set upon starting node
3284         assistance, but is never unset when stopping node assistance, nor set anywhere else. See per-method comments for
3285         more detail.
3286
3287         * UIProcess/WebPageProxy.h:
3288
3289         Remove members m_acceptsAutofilledLoginCredentials and m_representingPageURL from WebPageProxy. This state is
3290         retrieved from the AssistedNodeInformation struct when starting node assistance, but is never reset anywhere
3291         else. Instead of introducing new members to remember this state, we can just use the WKContentView's current
3292         assisted node information.
3293
3294         This also means that programmatically focusing forms (without user gesture) will no longer cause WKContentView
3295         to accept autofilled login credentials, since we bail out of node assistance and don't begin an input session.
3296
3297         * UIProcess/ios/WKContentView.mm:
3298         (-[WKContentView acceptsAutofilledLoginCredentials]): Deleted.
3299         (-[WKContentView representingPageURL]): Deleted.
3300         * UIProcess/ios/WKContentViewInteraction.mm:
3301         (-[WKContentView _autofillContext]):
3302
3303         Merge functionality of the previous two SPI hooks, such that -_autofillContext will return a non-null dictionary
3304         containing the URL of the focused element's document if and only if WKContentView accepts autofilled login
3305         credentials, and there exists a representing page URL.
3306
3307         When the page stops assisting the focused node, we set the AssistedNodeInformation's element type to None, so we
3308         additionally bail and return nil if the element type is None. As an aside, it seems a more reasonable approach to
3309         resetting state upon stopping node assistance is to just completely reset _assistedNodeInformation to its initial
3310         value, i.e. via _assistedNodeInformation = { }. It's not clear whether there are behaviors relying on the fact
3311         that all members but the element type in the content view's assisted node information could be stale, so this
3312         seems worthy of some investigation.
3313
3314         * UIProcess/ios/WebPageProxyIOS.mm:
3315         (WebKit::WebPageProxy::startAssistingNode):
3316         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Deleted.
3317         (WebKit::WebPageProxy::representingPageURL): Deleted.
3318
3319 2017-10-06  Yousuke Kimoto  <yousuke.kimoto@sony.com>
3320
3321         [WinCairo] Add shared curl files
3322         https://bugs.webkit.org/show_bug.cgi?id=177999
3323
3324         Reviewed by Alex Christensen.
3325
3326         * PlatformWin.cmake:
3327         * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Added.
3328         (WebKit::AuthenticationManager::receivedCredential):
3329         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
3330         (WebKit::AuthenticationManager::receivedCancellation):
3331         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
3332         (WebKit::AuthenticationManager::receivedChallengeRejection):
3333         * Shared/curl/WebCoreArgumentCodersCurl.cpp: Added.
3334         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3335         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3336         (IPC::ArgumentCoder<CertificateInfo>::encode):
3337         (IPC::ArgumentCoder<CertificateInfo>::decode):
3338         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
3339         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
3340         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
3341         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
3342         (IPC::ArgumentCoder<Credential>::encodePlatformData):
3343         (IPC::ArgumentCoder<Credential>::decodePlatformData):
3344
3345 2017-10-06  Brent Fulgham  <bfulgham@apple.com>
3346
3347         Sandbox rules block PluginProcess using "File Open/Save" dialogs
3348         https://bugs.webkit.org/show_bug.cgi?id=177965
3349         <rdar://problem/33976846>
3350
3351         Reviewed by Alexey Proskuryakov.
3352
3353         Update the PluginProcess sandboxes to allow the same XPC services as
3354         the WebContent process. Also allow access to the openAndSavePanelServices.
3355
3356         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 
3357
3358 2017-10-06  Brady Eidson  <beidson@apple.com>
3359
3360         Add (entirely incorrect) fetching of ServiceWorker scripts.
3361         https://bugs.webkit.org/show_bug.cgi?id=176179
3362
3363         Reviewed by Andy Estes.
3364
3365         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3366         (WebKit::WebSWServerConnection::startScriptFetchInClient):
3367         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3368         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3369
3370         * WebProcess/Storage/WebSWClientConnection.cpp:
3371         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
3372         * WebProcess/Storage/WebSWClientConnection.h:
3373         * WebProcess/Storage/WebSWClientConnection.messages.in:
3374
3375 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3376
3377         [GTK][WPE] Add API to configure and enable resource load statistics
3378         https://bugs.webkit.org/show_bug.cgi?id=177943
3379
3380         Reviewed by Michael Catanzaro.
3381
3382         Add new WebKitWebsiteDataManager construct only property to set the directory where the persistent stats are
3383         stored, and methods to enable resource load statistics and query whether it's currently enabled. Also add a new
3384         Website data type to be able to remove the persistent stats using WebKitWebsiteDataManager existing API.
3385
3386         * UIProcess/API/glib/WebKitWebContext.cpp:
3387         (websiteDataStoreConfigurationForWebProcessPoolConfiguration):
3388         (webkitWebContextConstructed):
3389         * UIProcess/API/glib/WebKitWebsiteData.cpp:
3390         (recordContainsSupportedDataTypes):
3391         (toWebKitWebsiteDataTypes):
3392         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
3393         (webkitWebsiteDataManagerGetProperty):
3394         (webkitWebsiteDataManagerSetProperty):
3395         (webkitWebsiteDataManagerConstructed):
3396         (webkit_website_data_manager_class_init):
3397         (webkitWebsiteDataManagerGetDataStore):
3398         (webkit_website_data_manager_get_resource_load_stats_directory):
3399         (webkit_website_data_manager_set_resource_load_stats_enabled):
3400         (webkit_website_data_manager_get_resource_load_stats_enabled):
3401         (toWebsiteDataTypes):
3402         * UIProcess/API/gtk/WebKitWebsiteData.h:
3403         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
3404         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3405         * UIProcess/API/wpe/WebKitWebsiteData.h:
3406         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
3407
3408 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3409
3410         [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049
3411         https://bugs.webkit.org/show_bug.cgi?id=168171
3412
3413         Reviewed by Chris Dumez.
3414
3415         Add C API to handle all resource load statistics requests made by the layout tests.
3416
3417         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3418         (WKWebsiteDataStoreSetStatisticsLastSeen):
3419         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
3420         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
3421         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
3422         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
3423         (WKWebsiteDataStoreSetStatisticsGrandfathered):
3424         (WKWebsiteDataStoreIsStatisticsGrandfathered):
3425         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
3426         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
3427         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
3428         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
3429         (WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree):
3430         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
3431         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
3432         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
3433         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
3434         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
3435         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
3436         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
3437         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
3438         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
3439         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
3440         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
3441         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
3442         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
3443         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
3444         (WKWebsiteDataStoreStatisticsResetToConsistentState):
3445         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3446
3447 2017-10-05  Tim Horton  <timothy_horton@apple.com>
3448
3449         Fix the Mac CMake build
3450         https://bugs.webkit.org/show_bug.cgi?id=177985
3451
3452         Unreviewed build fix.
3453
3454         * CMakeLists.txt:
3455         * PlatformMac.cmake:
3456         After r222917, there's one more piece of WebKitSystemInterface left.
3457         And some missing bits of PaymentRequest.
3458
3459 2017-10-05  Keith Miller  <keith_miller@apple.com>
3460
3461         Unreviewed, tapi builds without optimization so we should have TAPI passes -DRELEASE_WITHOUT_OPTIMIZATIONS.
3462
3463         * Configurations/Base.xcconfig:
3464
3465 2017-10-05  Jer Noble  <jer.noble@apple.com>
3466
3467         [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
3468         https://bugs.webkit.org/show_bug.cgi?id=177261
3469
3470         Reviewed by Eric Carlson.
3471
3472         * Configurations/FeatureDefines.xcconfig:
3473
3474 2017-10-05  Alex Christensen  <achristensen@webkit.org>
3475
3476         Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList
3477         https://bugs.webkit.org/show_bug.cgi?id=177966
3478         <rdar://problem/22387135>
3479
3480         Reviewed by Tim Horton.
3481
3482         * UIProcess/API/APINavigationClient.h:
3483         (API::NavigationClient::didChangeBackForwardList):
3484         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3485         * UIProcess/Cocoa/NavigationState.h:
3486         * UIProcess/Cocoa/NavigationState.mm:
3487         (WebKit::NavigationState::setNavigationDelegate):
3488         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
3489         (WebKit::NavigationState::NavigationClient::didChangeBackForwardList):
3490         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
3491         (WebKit::NavigationState::NavigationClient::didCancelClientRedirect):
3492         (WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
3493         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
3494         (WebKit::NavigationState::NavigationClient::processDidTerminate):
3495         (WebKit::NavigationState::NavigationClient::processDidBecomeResponsive):
3496         (WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive):
3497         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
3498         (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
3499         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
3500         (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
3501         (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
3502         (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
3503         * UIProcess/WebPageProxy.cpp:
3504         (WebKit::WebPageProxy::didChangeBackForwardList):
3505
3506 2017-10-05  Alex Christensen  <achristensen@webkit.org>
3507
3508         Add ObjC SPI with userInfo corresponding to WKPageNavigationClient's decidePolicyForNavigationAction, didStartProvisionalNavigation, and didFailNavigation
3509         https://bugs.webkit.org/show_bug.cgi?id=177974
3510         <rdar://problem/22888802>
3511
3512         Reviewed by Tim Horton.
3513
3514         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3515         * UIProcess/Cocoa/NavigationState.h:
3516         * UIProcess/Cocoa/NavigationState.mm:
3517         (WebKit::NavigationState::setNavigationDelegate):
3518         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3519         (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
3520         (WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
3521         * UIProcess/Cocoa/UIDelegate.mm:
3522         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
3523
3524 2017-10-05  John Wilander  <wilander@apple.com>
3525
3526         Storage Access API: Web process should ask UI process for grant/deny
3527         https://bugs.webkit.org/show_bug.cgi?id=176941
3528         <rdar://problem/34440036>
3529
3530         Reviewed by Chris Dumez and Sam Weinig.
3531
3532         This patch adds infrastructure to let WebCore::Document call
3533         WebKit::WebResourceLoadStatisticsStore and ask for storage
3534         access on behalf of an iframe. The communication goes through
3535         the ChromeClient since we might want to add a native prompt.
3536         From the ChromeClient it continues to the WebPage which
3537         messages the WebPageProxy. The WebPageProxy calls the
3538         WebsiteDataStore which owns the WebResourceLoadStatisticsStore.
3539         A uint64_t is used to match the right callback with the boolean
3540         result.
3541
3542         * UIProcess/WebPageProxy.cpp:
3543         (WebKit::WebPageProxy::requestStorageAccess):
3544         * UIProcess/WebPageProxy.h:
3545         * UIProcess/WebPageProxy.messages.in:
3546         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3547         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
3548         * UIProcess/WebResourceLoadStatisticsStore.h:
3549         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3550         (WebKit::WebsiteDataStore::requestStorageAccess):
3551         * UIProcess/WebsiteData/WebsiteDataStore.h:
3552         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3553         (WebKit::WebChromeClient::requestStorageAccess):
3554         * WebProcess/WebCoreSupport/WebChromeClient.h:
3555         * WebProcess/WebPage/WebPage.cpp:
3556         (WebKit::nextRequestStorageAccessContextId):
3557         (WebKit::WebPage::requestStorageAccess):
3558         (WebKit::WebPage::storageAccessResponse):
3559         * WebProcess/WebPage/WebPage.h:
3560         * WebProcess/WebPage/WebPage.messages.in:
3561
3562 2017-10-05  Chris Dumez  <cdumez@apple.com>
3563
3564         Drop unused parameters for CookiesStrategy::cookiesEnabled()
3565         https://bugs.webkit.org/show_bug.cgi?id=177957
3566
3567         Reviewed by Alex Christensen.
3568
3569         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3570         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
3571         * NetworkProcess/NetworkConnectionToWebProcess.h:
3572         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3573         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3574         (WebKit::WebPlatformStrategies::cookiesEnabled):
3575         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3576
3577 2017-10-05  Tim Horton  <timothy_horton@apple.com>
3578
3579         Make progress toward properly-formed XPC services in the Mac CMake build
3580         https://bugs.webkit.org/show_bug.cgi?id=177918
3581
3582         Reviewed by Alex Christensen.
3583
3584         * CMakeLists.txt:
3585         * PlatformMac.cmake:
3586         Turn on the storage process on Mac, and fix its build.
3587         Move XPC services to Versions/A/XPCServices and add the toplevel
3588         XPCServices as a symlink of that.
3589         Run the XPC services' Info.plists through configure_file, and substitute
3590         the important variables (most critically the bundle identifier).
3591         Factor out the service setup so we don't keep duplicating it as it
3592         gets more complicated.
3593
3594 2017-10-05  Andy Estes  <aestes@apple.com>
3595
3596         [Payment Request] Add a payment method that supports Apple Pay
3597         https://bugs.webkit.org/show_bug.cgi?id=177850
3598
3599         Reviewed by Youenn Fablet.
3600
3601         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3602         (toShippingMethod): Converted the NSDecimalNumber amount to a string rather than an integer.
3603         (WebKit::toDecimalNumber): used -decimalNumberWithString:locale: rather than
3604         -initWithMantissa:exponent:isNegative: to create an NSDecimalNumber.
3605         (WebKit::toPKPaymentSummaryItem):
3606         (WebKit::toPKShippingMethod):
3607
3608 2017-10-05  Youenn Fablet  <youenn@apple.com>
3609
3610         Make LibWebRTCProvider port agnostic
3611         https://bugs.webkit.org/show_bug.cgi?id=177747
3612
3613         Reviewed by Alex Christensen & Alex Garcia.
3614
3615         * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure Mac/iOS provider creates the codec factories.
3616
3617 2017-10-04  Alex Christensen  <achristensen@webkit.org>
3618
3619         Stop linking with WebKitSystemInterface
3620         https://bugs.webkit.org/show_bug.cgi?id=177915
3621
3622         Reviewed by Antti Koivisto.
3623
3624         * Configurations/DebugRelease.xcconfig:
3625         * WebKit.xcodeproj/project.pbxproj:
3626
3627 2017-10-04  Alex Christensen  <achristensen@webkit.org>
3628
3629         Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
3630         https://bugs.webkit.org/show_bug.cgi?id=177912
3631
3632         Reviewed by Saam Barati.
3633
3634         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3635         * NetworkProcess/mac/NetworkProcessMac.mm:
3636         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3637         * Platform/IPC/mac/ConnectionMac.mm:
3638         * Platform/mac/LayerHostingContext.mm:
3639         * PluginProcess/mac/PluginProcessMac.mm:
3640         * PluginProcess/mac/PluginProcessShim.mm:
3641         * Shared/ios/ChildProcessIOS.mm:
3642         * Shared/mac/ChildProcessMac.mm:
3643         * Shared/mac/SandboxExtensionMac.mm:
3644         * Shared/mac/WebCoreArgumentCodersMac.mm:
3645         * Shared/mac/WebEventFactory.mm:
3646         * StorageProcess/ios/StorageProcessIOS.mm:
3647         * StorageProcess/mac/StorageProcessMac.mm:
3648         * UIProcess/API/Cocoa/WKWebView.mm:
3649         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
3650         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3651         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3652         * UIProcess/Cocoa/WebViewImpl.mm:
3653         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3654         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3655         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3656         * UIProcess/mac/PageClientImplMac.mm:
3657         * UIProcess/mac/WKTextInputWindowController.mm:
3658         * UIProcess/mac/WebContextMenuProxyMac.mm:
3659         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3660         * UIProcess/mac/WindowServerConnection.mm:
3661         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3662         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
3663         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3664         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3665         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3666         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3667         * WebProcess/WebPage/ios/WebPageIOS.mm:
3668         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
3669         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
3670         * WebProcess/WebPage/mac/WebPageMac.mm:
3671         * WebProcess/cocoa/WebProcessCocoa.mm:
3672
3673 2017-10-04  Youenn Fablet  <youenn@apple.com>
3674
3675         rtc::PacketOptions should have its own IPC encoding/decoding routines
3676         https://bugs.webkit.org/show_bug.cgi?id=177812
3677
3678         Reviewed by Alex Christensen.
3679
3680         Replacing rtc::PacketOptions IPC encoding/decoding from passing the structure as individual parameters to the structure as a parameter.
3681         Introducing WebKit::RTCPacketOptions as a wrapper around it for which encode/decode routines are added.
3682         Updating code using rtc::PacketOptions accordingly.
3683
3684         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
3685         (WebKit::NetworkRTCSocket::sendTo):
3686         * NetworkProcess/webrtc/NetworkRTCSocket.h:
3687         * NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
3688         * Platform/IPC/Decoder.cpp:
3689         (IPC::Decoder::operator>>):
3690         (IPC::Decoder::decode):
3691         * Platform/IPC/Decoder.h:
3692         * Platform/IPC/Encoder.cpp:
3693         (IPC::Encoder::encode):
3694         * Platform/IPC/Encoder.h:
3695         * Shared/RTCPacketOptions.cpp: Added.
3696         (WebKit::RTCPacketOptions::encode const):
3697         (WebKit::RTCPacketOptions::decode):
3698         * Shared/RTCPacketOptions.h: Added.
3699         * WebKit.xcodeproj/project.pbxproj:
3700         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
3701         (WebKit::LibWebRTCSocket::SendTo):
3702
3703 2017-10-04  Don Olmstead  <don.olmstead@sony.com>
3704
3705         Include Pasteboard.h for all in WebCoreArgumentCoders
3706         https://bugs.webkit.org/show_bug.cgi?id=177902
3707
3708         Reviewed by Alex Christensen.
3709
3710         * Shared/WebCoreArgumentCoders.cpp:
3711
3712 2017-10-04  David Kilzer  <ddkilzer@apple.com>
3713
3714         Remove unused variables in lambdas for network process cache
3715         <https://webkit.org/b/177878>
3716         <rdar://problem/34038482>
3717
3718         Reviewed by Tim Horton.
3719
3720         * NetworkProcess/cache/CacheStorageEngine.cpp:
3721         (WebKit::CacheStorage::Engine::open):
3722         (WebKit::CacheStorage::Engine::putRecords):
3723         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
3724         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3725         (WebKit::CacheStorageEngineConnection::reference):
3726         - Remove unused |this| from lambda captures.
3727
3728 2017-10-04  Stephan Szabo  <stephan.szabo@sony.com>
3729
3730         [WinCairo] add PLATFORM(WIN) configurations to config.h
3731         https://bugs.webkit.org/show_bug.cgi?id=177846
3732
3733         Reviewed by Alex Christensen.
3734
3735         * config.h:
3736
3737 2017-10-04  Adrian Perez de Castro  <aperez@igalia.com>
3738
3739         [GTK] WebKit2GTK+ does not handle touchmove and touchend events correctly
3740         https://bugs.webkit.org/show_bug.cgi?id=158531
3741
3742         Reviewed by Carlos Alberto Lopez Perez.
3743
3744         Do not bypass WebCore event handling when receiving touch events.
3745
3746         Based on a patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk>.
3747         Thanks to Carlos Garnacho <carlosg@gnome.org> for helping out reviewing the code.
3748
3749         * UIProcess/API/gtk/PageClientImpl.cpp:
3750         (WebKit::PageClientImpl::doneWithTouchEvent): Make sure touchend reaches gesture controller if touchbegin evet got to it.
3751         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3752         (webkitWebViewBaseTouchEvent): Do not invoke gesture controller directly by bypassing WebCore event handling.
3753         * UIProcess/gtk/GestureController.cpp:
3754         (WebKit::GestureController::reset): Added.
3755         (WebKit::GestureController::handleEvent): Reset gesture controller when touchpadupdate/end is received without touchbegin.
3756         (WebKit::GestureController::Gesture::reset): Added.
3757         * UIProcess/gtk/GestureController.h:
3758
3759 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
3760
3761         Unreviewed WPE build fix after r222837
3762         https://bugs.webkit.org/show_bug.cgi?id=177449
3763
3764         * Shared/wpe/WebEventFactory.cpp:
3765         (WebKit::wallTimeForEventTime):
3766
3767 2017-10-04  Ryosuke Niwa  <rniwa@webkit.org>
3768
3769         Use blob URL when pasting RTFD instead of overriding DocumentLoader
3770         https://bugs.webkit.org/show_bug.cgi?id=177801
3771         <rdar://problem/34542270>
3772
3773         Reviewed by Wenson Hsieh.
3774
3775         Fixed the assertion failure when RTFD content is empty.
3776
3777         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3778         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
3779
3780 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
3781
3782         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
3783         https://bugs.webkit.org/show_bug.cgi?id=177449
3784
3785         Reviewed by Chris Dumez.
3786
3787         * Shared/wpe/WebEventFactory.cpp:
3788         (WebKit::wallTimeForEventTime):
3789
3790 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
3791
3792         Correct nullptr dereference during shutdown
3793         https://bugs.webkit.org/show_bug.cgi?id=177845
3794         <rdar://problem/33651405>
3795
3796         Reviewed by Chris Dumez.
3797
3798         It looks like the ResourceLoadStatisticsPersistentStorage destructor is calling code that attempts
3799         to use member variables in its owning class (WebResourceLoadStatisticsStore). Since these may have
3800         already been destroyed, they are in an invalid state when accessed.
3801
3802         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
3803         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): Do not call
3804         finishAllPendingWorkSynchronously() in the destructor, since it relies on the m_memoryStore to be
3805         a reference to completely valid object.
3806         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3807         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): Instead, call
3808         'finishAllPendingWorkSynchronously' here, when the object is still in a known valid state.
3809
3810 2017-10-03  Alex Christensen  <achristensen@webkit.org>
3811
3812         Moderize WebKit's back forward list code
3813         https://bugs.webkit.org/show_bug.cgi?id=177843
3814
3815         Reviewed by Tim Horton.
3816
3817         Use Ref instead of RefPtr when possible.
3818         Use references instead of pointers when possible.
3819         Remove unnecessary null checks.
3820         Reduce unnecessary Vector copying.
3821
3822         * Shared/SessionState.h:
3823         * Shared/WebBackForwardListItem.h:
3824         * UIProcess/API/APILoaderClient.h:
3825         (API::LoaderClient::didChangeBackForwardList):
3826         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
3827         * UIProcess/API/C/WKPage.cpp:
3828         (WKPageSetPageLoaderClient):
3829         * UIProcess/WebBackForwardList.cpp:
3830         (WebKit::WebBackForwardList::pageClosed):
3831         (WebKit::WebBackForwardList::addItem):
3832         (WebKit::WebBackForwardList::goToItem):
3833         (WebKit::WebBackForwardList::currentItem const):
3834         (WebKit::WebBackForwardList::backItem const):
3835         (WebKit::WebBackForwardList::forwardItem const):
3836         (WebKit::WebBackForwardList::itemAtIndex const):
3837         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
3838         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
3839         (WebKit::WebBackForwardList::removeAllItems):
3840         (WebKit::WebBackForwardList::clear):
3841         (WebKit::WebBackForwardList::backForwardListState const):
3842         (WebKit::WebBackForwardList::restoreFromState):
3843         * UIProcess/WebBackForwardList.h:
3844         * UIProcess/WebPageProxy.cpp:
3845         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
3846         (WebKit::WebPageProxy::initializeWebPage):
3847         (WebKit::WebPageProxy::didChangeBackForwardList):
3848         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
3849         (WebKit::WebPageProxy::backForwardGoToItem):
3850         * UIProcess/WebPageProxy.h:
3851         * UIProcess/WebProcessProxy.cpp:
3852         (WebKit::WebProcessProxy::registerNewWebBackForwardListItem):
3853         * UIProcess/WebProcessProxy.h:
3854         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3855         (WebKit::WebBackForwardListProxy::itemAtIndex):
3856
3857 2017-10-03  Chris Dumez  <cdumez@apple.com>
3858
3859         SharedStringHashStore should support removing hashes
3860         https://bugs.webkit.org/show_bug.cgi?id=177770
3861
3862         Reviewed by Alex Christensen.
3863
3864         SharedStringHashStore should support removing hashes. It currently only supports adding hashes or
3865         clearing all of them, which is sufficient for the VisitedLinkStore but will not be for Service
3866         Worker purposes.
3867
3868         * Shared/SharedStringHashStore.cpp:
3869         (WebKit::SharedStringHashStore::SharedStringHashStore):
3870         (WebKit::SharedStringHashStore::add):
3871         (WebKit::SharedStringHashStore::remove):
3872         (WebKit::SharedStringHashStore::contains):
3873         (WebKit::SharedStringHashStore::clear):
3874         (WebKit::SharedStringHashStore::resizeTable):
3875         (WebKit::SharedStringHashStore::pendingOperationsTimerFired):
3876         * Shared/SharedStringHashStore.h:
3877         * Shared/SharedStringHashTable.cpp:
3878         (WebKit::SharedStringHashTable::remove):
3879         * Shared/SharedStringHashTable.h:
3880         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
3881         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
3882         (-[_WKVisitedLinkStore containsVisitedLinkWithURL:]):
3883         (-[_WKVisitedLinkStore removeVisitedLinkWithURL:]):
3884         * UIProcess/VisitedLinkStore.cpp:
3885         (WebKit::VisitedLinkStore::containsVisitedLinkHash):
3886         (WebKit::VisitedLinkStore::removeVisitedLinkHash):
3887         (WebKit::VisitedLinkStore::didUpdateSharedStringHashes):
3888         * UIProcess/VisitedLinkStore.h:
3889
3890 2017-10-03  Alex Christensen  <achristensen@webkit.org>
3891
3892         Fix API tests after r222794.
3893         https://bugs.webkit.org/show_bug.cgi?id=177825
3894
3895         * UIProcess/WebPageProxy.cpp:
3896         (WebKit::WebPageProxy::willGoToBackForwardListItem):
3897         Sometimes there's no navigation client.
3898
3899 2017-10-03  Alex Christensen  <achristensen@webkit.org>
3900
3901         Add ObjC equivalent of WKPageLoaderClient.pluginDidFail
3902         https://bugs.webkit.org/show_bug.cgi?id=177787
3903         <rdar://problem/22387633>
3904
3905         Reviewed by Tim Horton.
3906
3907         * UIProcess/API/APILoaderClient.h:
3908         (API::LoaderClient::didFailToInitializePlugin):
3909         * UIProcess/API/APINavigationClient.h:
3910         (API::NavigationClient::canHandleDidFailToInitializePlugIn const):
3911         (API::NavigationClient::didFailToInitializePlugIn):
3912         * UIProcess/API/C/WKPage.cpp:
3913         (WKPageSetPageLoaderClient):
3914         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3915         * UIProcess/Cocoa/NavigationState.h:
3916         * UIProcess/Cocoa/NavigationState.mm:
3917         (WebKit::NavigationState::setNavigationDelegate):
3918         (WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const):
3919         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
3920         * UIProcess/WebPageProxy.cpp:
3921         (WebKit::WebPageProxy::didFailToInitializePlugin):
3922
3923 2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>
3924
3925         [GTK] Prefer -webkit-system-font
3926         https://bugs.webkit.org/show_bug.cgi?id=177814
3927
3928         Reviewed by Carlos Garcia Campos.
3929
3930         Use "font-family: -webkit-system-font" instead of "font: menu".
3931
3932         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
3933         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet.
3934
3935 2017-10-03  Alex Christensen  <achristensen@webkit.org>
3936
3937         Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
3938         https://bugs.webkit.org/show_bug.cgi?id=177825
3939         <rdar://problem/22387505>
3940
3941         Reviewed by Tim Horton.
3942
3943         * UIProcess/API/APILoaderClient.h:
3944         (API::LoaderClient::willGoToBackForwardListItem):
3945         * UIProcess/API/APINavigationClient.h:
3946         (API::NavigationClient::canHandleWillGoToBackForwardListItem const):
3947         (API::NavigationClient::willGoToBackForwardListItem):
3948         * UIProcess/API/C/WKPage.cpp:
3949         (WKPageSetPageLoaderClient):
3950         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3951         * UIProcess/Cocoa/NavigationState.h:
3952         * UIProcess/Cocoa/NavigationState.mm:
3953         (WebKit::NavigationState::setNavigationDelegate):
3954         (WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const):
3955         (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
3956         * UIProcess/WebPageProxy.cpp:
3957         (WebKit::WebPageProxy::willGoToBackForwardListItem):
3958         * UIProcess/WebPageProxy.h:
3959         * UIProcess/WebPageProxy.messages.in:
3960         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3961         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
3962
3963 2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
3964
3965         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
3966         https://bugs.webkit.org/show_bug.cgi?id=177449
3967
3968         Reviewed by Chris Dumez.
3969
3970         * Shared/gtk/WebEventFactory.cpp:
3971         (WebKit::WebEventFactory::createWebMouseEvent):
3972         (WebKit::WebEventFactory::createWebWheelEvent):
3973         (WebKit::WebEventFactory::createWebKeyboardEvent):
3974         (WebKit::WebEventFactory::createWebTouchEvent):
3975         * Shared/wpe/WebEventFactory.cpp:
3976         (WebKit::wallTimeForEventTime):
3977         (WebKit::WebEventFactory::createWebKeyboardEvent):
3978         (WebKit::WebEventFactory::createWebMouseEvent):
3979         (WebKit::WebEventFactory::createWebWheelEvent):
3980         (WebKit::WebEventFactory::createWebTouchEvent):
3981
3982 2017-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3983
3984         [GTK][WPE] WebProcess should run cleanup on quit to release resources
3985         https://bugs.webkit.org/show_bug.cgi?id=168126
3986
3987         Reviewed by Michael Catanzaro.
3988
3989         Do not call exit on sync message send failure for GTK and WPE ports.
3990
3991         * WebProcess/WebProcess.cpp:
3992         (WebKit::WebProcess::initializeConnection):
3993
3994 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
3995
3996         Move more code into PasteboardCustomData
3997         https://bugs.webkit.org/show_bug.cgi?id=177795
3998
3999         Reviewed by Wenson Hsieh.
4000
4001         Added the support for encoding and decoding the origin string in PasteboardCustomData.
4002
4003         * Shared/WebCoreArgumentCoders.cpp:
4004         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
4005         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
4006
4007 2017-10-02  Adrian Perez de Castro  <aperez@igalia.com>
4008
4009         [GTK] Do not hardcode font family in served remote inspector HTML snippets
4010         https://bugs.webkit.org/show_bug.cgi?id=177742
4011
4012         Reviewed by Carlos Garcia Campos.
4013
4014         Instead of hardcoding Cantarell as the font used for the HTML snippets served
4015         by the remote inspector handler, use "font: menu" to obtain the system UI
4016         font, plus a "font-size" rule for adjusting the size.
4017
4018         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
<