[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
2
3         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
4         https://bugs.webkit.org/show_bug.cgi?id=174816
5
6         Reviewed by Michael Catanzaro.
7
8         Add webkit_uri_for_display for GTK and WPE.
9
10         * PlatformGTK.cmake:
11         * PlatformWPE.cmake:
12         * SourcesGTK.txt:
13         * SourcesWPE.txt:
14         * UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
15         (webkit_uri_for_display):
16         * UIProcess/API/gtk/WebKitURIUtilities.h: Added.
17         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
18         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
19         * UIProcess/API/gtk/webkit2.h:
20         * UIProcess/API/wpe/WebKitURIUtilities.h: Added.
21         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
22         * UIProcess/API/wpe/docs/wpe-docs.sgml:
23         * UIProcess/API/wpe/webkit.h:
24
25 2018-12-17  Carlos Garcia Campos  <cgarcia@igalia.com>
26
27         [WPE] Add API to notify about frame displayed view backend callback
28         https://bugs.webkit.org/show_bug.cgi?id=192224
29
30         Reviewed by Michael Catanzaro.
31
32         Add API to add a callback to the view to be called when the view backend notifies that a frame has been
33         displayed.
34
35         * UIProcess/API/glib/WebKitWebView.cpp:
36         (FrameDisplayedCallback::FrameDisplayedCallback):
37         (FrameDisplayedCallback::~FrameDisplayedCallback):
38         (webkit_web_view_add_frame_displayed_callback):
39         (webkit_web_view_remove_frame_displayed_callback):
40         * UIProcess/API/wpe/WebKitWebView.h:
41         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
42
43 2018-12-16  Chris Fleizach  <cfleizach@apple.com>
44
45         AX: Support keyboard access preference for iOS in WebKit
46         https://bugs.webkit.org/show_bug.cgi?id=192373
47         <rdar://problem/46462670>
48
49         Reviewed by Tim Horton.
50
51         * Platform/spi/ios/AccessibilitySupportSPI.h:
52         * PlatformMac.cmake:
53         * SourcesCocoa.txt:
54         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h: Added.
55         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Added.
56         (platformIsFullKeyboardAccessEnabled):
57         (-[WKFullKeyboardAccessWatcher notifyAllProcessPools]):
58         (-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
59         (-[WKFullKeyboardAccessWatcher init]):
60         (+[WKFullKeyboardAccessWatcher fullKeyboardAccessEnabled]):
61         * UIProcess/ios/WebProcessProxyIOS.mm:
62         (WebKit::WebProcessProxy::fullKeyboardAccessEnabled):
63         * UIProcess/mac/WKFullKeyboardAccessWatcher.h: Removed.
64         * UIProcess/mac/WKFullKeyboardAccessWatcher.mm: Removed.
65         * WebKit.xcodeproj/project.pbxproj:
66
67 2018-12-16  Adrian Perez de Castro  <aperez@igalia.com>
68
69         Unreviewed follow up after r239260
70         https://bugs.webkit.org/show_bug.cgi?id=192714
71         <rdar://problem/46762407>
72
73         * Platform/win/SharedMemoryWin.cpp:
74         (WebKit::SharedMemory::allocate): Use PAGE_READWRITE directly instead
75         of going through the protectAttribute() function, which is removed
76         because it is now unused.
77
78 2018-12-16  Adrian Perez de Castro  <aperez@igalia.com>
79
80         Unify SharedMemory factory functions
81         https://bugs.webkit.org/show_bug.cgi?id=192714
82
83         Reviewed by Darin Adler.
84
85         This unifies SharedMemory so in the following way, across platforms:
86
87         - SharedMemory::create() is removed, to avoid ambiguity.
88         - SharedMemory::allocate() always allocates a new block of shared memory.
89         - SharedMemory::wrapMap() always creates a SharedMemory object which refers to an
90           existing region of memory resulting from memory-mapping a file.
91
92         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
93         (WebKit::NetworkCache::Data::tryCreateSharedMemory const): Use SharedMemory::wrapMap().
94         * Platform/SharedMemory.h: Remove the definition of SharedMemory::create(), and make
95         SharedMemory::wrapMap() available on OS(DARWIN) as well.
96         * Platform/cocoa/SharedMemoryCocoa.cpp:
97         (WebKit::SharedMemory::wrapMap): Renamed from ::create().
98         * Platform/unix/SharedMemoryUnix.cpp:
99         (WebKit::SharedMemory::allocate): Renamed from ::create().
100         * Platform/win/SharedMemoryWin.cpp:
101         (WebKit::SharedMemory::allocate): Renamed from ::create()
102         * UIProcess/API/APIContentRuleListStore.cpp:
103         (API::createExtension): Use NetworkCache::Data::tryCreateSharedMemory() instead of
104         SharedMemory::create().
105
106 2018-12-15  Chris Fleizach  <cfleizach@apple.com>
107
108         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
109         https://bugs.webkit.org/show_bug.cgi?id=192449
110         <rdar://problem/46595508>
111
112         Reviewed by Darin Adler.
113
114         Part 7: Files in UIProcess/API
115
116         * UIProcess/API/APIContentRuleListStore.cpp:
117         * UIProcess/API/APIHitTestResult.cpp:
118         * UIProcess/API/APINavigation.cpp:
119         * UIProcess/API/APIOpenPanelParameters.cpp:
120         * UIProcess/API/APIPageConfiguration.cpp:
121         * UIProcess/API/C/WKApplicationCacheManager.cpp:
122         (WKApplicationCacheManagerGetTypeID):
123         (WKApplicationCacheManagerGetApplicationCacheOrigins):
124         (WKApplicationCacheManagerDeleteEntriesForOrigin):
125         (WKApplicationCacheManagerDeleteAllEntries):
126         * UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
127         (WKAuthenticationDecisionListenerGetTypeID):
128         (WKAuthenticationDecisionListenerUseCredential):
129         (WKAuthenticationDecisionListenerCancel):
130         (WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue):
131         * UIProcess/API/C/WKBackForwardListItemRef.cpp:
132         (WKBackForwardListItemGetTypeID):
133         (WKBackForwardListItemCopyURL):
134         (WKBackForwardListItemCopyTitle):
135         (WKBackForwardListItemCopyOriginalURL):
136         * UIProcess/API/C/WKContext.cpp:
137         (WKContextGetTypeID):
138         (WKContextCreate):
139         (WKContextCreateWithInjectedBundlePath):
140         (WKContextCreateWithConfiguration):
141         (WKContextSetClient):
142         (WKContextSetInjectedBundleClient):
143         (WKContextSetHistoryClient):
144         (WKContextSetDownloadClient):
145         (WKContextSetConnectionClient):
146         (WKContextDownloadURLRequest):
147         (WKContextResumeDownload):
148         (WKContextSetInitializationUserDataForInjectedBundle):
149         (WKContextPostMessageToInjectedBundle):
150         (WKContextGetGlobalStatistics):
151         (WKContextAddVisitedLink):
152         (WKContextClearVisitedLinks):
153         (WKContextSetCacheModel):
154         (WKContextGetCacheModel):
155         (WKContextSetMaximumNumberOfProcesses):
156         (WKContextGetMaximumNumberOfProcesses):
157         (WKContextSetAlwaysUsesComplexTextCodePath):
158         (WKContextSetShouldUseFontSmoothing):
159         (WKContextSetAdditionalPluginsDirectory):
160         (WKContextRefreshPlugIns):
161         (WKContextRegisterURLSchemeAsEmptyDocument):
162         (WKContextRegisterURLSchemeAsSecure):
163         (WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy):
164         (WKContextRegisterURLSchemeAsCachePartitioned):
165         (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
166         (WKContextSetDomainRelaxationForbiddenForURLScheme):
167         (WKContextSetCanHandleHTTPSServerTrustEvaluation):
168         (WKContextSetPrewarmsProcessesAutomatically):
169         (WKContextSetCustomWebContentServiceBundleIdentifier):
170         (WKContextSetDiskCacheSpeculativeValidationEnabled):
171         (WKContextPreconnectToServer):
172         (WKContextGetCookieManager):
173         (WKContextGetWebsiteDataStore):
174         (WKContextGetGeolocationManager):
175         (WKContextGetMediaSessionFocusManager):
176         (WKContextGetNotificationManager):
177         (WKContextStartMemorySampler):
178         (WKContextStopMemorySampler):
179         (WKContextAllowSpecificHTTPSCertificateForHost):
180         (WKContextDisableProcessTermination):
181         (WKContextEnableProcessTermination):
182         (WKContextSetHTTPPipeliningEnabled):
183         (WKContextWarmInitialProcess):
184         (WKContextGetStatistics):
185         (WKContextGetStatisticsWithOptions):
186         (WKContextJavaScriptConfigurationFileEnabled):
187         (WKContextSetJavaScriptConfigurationFileEnabled):
188         (WKContextGarbageCollectJavaScriptObjects):
189         (WKContextSetJavaScriptGarbageCollectorTimerEnabled):
190         (WKContextUseTestingNetworkSession):
191         (WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
192         (WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
193         (WKContextClearCachedCredentials):
194         (WKContextCopyPlugInAutoStartOriginHashes):
195         (WKContextSetPlugInAutoStartOriginHashes):
196         (WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
197         (WKContextSetPlugInAutoStartOrigins):
198         (WKContextSetInvalidMessageFunction):
199         (WKContextSetMemoryCacheDisabled):
200         (WKContextSetFontWhitelist):
201         (WKContextTerminateNetworkProcess):
202         (WKContextTerminateServiceWorkerProcess):
203         (WKContextGetNetworkProcessIdentifier):
204         (WKContextAddSupportedPlugin):
205         (WKContextClearSupportedPlugins):
206         (WKContextSetIDBPerOriginQuota):
207         * UIProcess/API/C/WKPage.cpp:
208         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
209         (WKPageLoadURLWithUserData):
210         (WKPageLoadURLRequestWithUserData):
211         (WKPageSetPaginationMode):
212         (WKPageGetPaginationMode):
213         (WKPageSetPageLoaderClient):
214         (WKPageSetPagePolicyClient):
215         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
216
217 2018-12-15  Darin Adler  <darin@apple.com>
218
219         Use warning-ignoring macros more consistently and simply
220         https://bugs.webkit.org/show_bug.cgi?id=192743
221
222         Reviewed by Mark Lam.
223
224         * UIProcess/ios/WKDrawingView.mm:
225         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
226         Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
227         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
228         (-[WKFullScreenWindowController _EVOrganizationName]): Ditto.
229
230         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Use
231         IGNORE_WARNINGS_BEGIN/END instead of IGNORE_CLANG_WARNINGS_BEGIN/END
232         because there is no need to accomodate non-clang compilers here.
233         Also use #pragma once, add a missing "explicit", and fix conditionals.
234
235 2018-12-15  Darin Adler  <darin@apple.com>
236
237         Replace many uses of String::format with more type-safe alternatives
238         https://bugs.webkit.org/show_bug.cgi?id=192742
239
240         Reviewed by Mark Lam.
241
242         * Shared/WebMemorySampler.cpp:
243         (WebKit::WebMemorySampler::writeHeaders): Use makeString.
244
245         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
246         (WebKit::LocalAuthenticator::makeCredential): Use string concatentation.
247
248         * UIProcess/WebInspectorUtilities.cpp:
249         (WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
250         * UIProcess/WebProcessPool.cpp:
251         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
252         (WebKit::WebProcessPool::startMemorySampler): Ditto.
253
254 2018-12-14  Ryan Haddad  <ryanhaddad@apple.com>
255
256         Unreviewed, fix the build with recent SDKs.
257
258         * UIProcess/ios/WKDrawingView.mm:
259         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
260
261 2018-12-14  Jiewen Tan  <jiewen_tan@apple.com>
262
263         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
264         https://bugs.webkit.org/show_bug.cgi?id=192061
265
266         Reviewed by Dewei Zhu.
267
268         Part 2.
269
270         Add some additional temporary logging info. Since the failure cannot be reproduced easily by human, we have to
271         rely on the test infrastructure to reporoduce it. Once the bug is determined and fixed, we should remove all
272         logging added in this patch.
273
274         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
275         (WebKit::HidService::deviceAdded):
276         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
277         (WebKit::CtapHidAuthenticator::makeCredential):
278         (WebKit::CtapHidAuthenticator::getAssertion):
279         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
280         (WebKit::CtapHidDriver::Worker::write):
281         (WebKit::CtapHidDriver::Worker::read):
282         (WebKit::CtapHidDriver::Worker::returnMessage):
283         (WebKit::CtapHidDriver::transact):
284         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
285         (WebKit::CtapHidDriver::continueAfterResponseReceived):
286
287 2018-12-14  Adrian Perez de Castro  <aperez@igalia.com>
288
289         [GTK] Unreviewed build fix.
290
291         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Add missing WebPolicyAction.h include.
292
293 2018-12-14  Chris Dumez  <cdumez@apple.com>
294
295         Unreviewed, fix assertion failure in API test after r239210.
296
297         * WebProcess/WebPage/WebPage.cpp:
298         (WebKit::WebPage::createDocumentLoader):
299
300 2018-12-14  Adrian Perez de Castro  <aperez@igalia.com>
301
302         [SOUP] Unreviewed build fix after r239219
303
304         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
305         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Remove
306         handling of PolicyAction::Suspend, which is no longer available.
307
308 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
309
310         Unreviewed, apply post-landing review comments after r239221.
311
312         * UIProcess/WebPageDebuggable.cpp:
313         (WebKit::WebPageDebuggable::url const):
314         Switch to WTF::blankURL() instead of using "about:blank" directly.
315
316 2018-12-14  Chris Dumez  <cdumez@apple.com>
317
318         [PSON] Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls
319         https://bugs.webkit.org/show_bug.cgi?id=192704
320
321         Reviewed by Geoffrey Garen.
322
323         Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls. This
324         is because we were failing to pass the ShouldTreatAsContinuingLoad flag to the WebContent process when
325         doing a LoadData.
326
327         * UIProcess/WebPageProxy.cpp:
328         (WebKit::WebPageProxy::loadData):
329         (WebKit::WebPageProxy::loadDataWithNavigation):
330         (WebKit::WebPageProxy::continueNavigationInNewProcess):
331         * UIProcess/WebPageProxy.h:
332         * WebProcess/WebPage/WebPage.cpp:
333         (WebKit::WebPage::loadDataImpl):
334         (WebKit::WebPage::loadData):
335         (WebKit::WebPage::loadAlternateHTML):
336         * WebProcess/WebPage/WebPage.h:
337
338 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
339
340         Web Inspector: Prefer "about:blank" instead of an empty string for WebPageDebuggable url
341         https://bugs.webkit.org/show_bug.cgi?id=192691
342         <rdar://problem/46719798>
343
344         Reviewed by Darin Adler.
345
346         * UIProcess/WebPageDebuggable.cpp:
347         (WebKit::WebPageDebuggable::url const):
348         Instead of an empty string, return "about:blank" in bail cases.
349         When inspecting the page that matches the contents.
350
351 2018-12-14  Chris Dumez  <cdumez@apple.com>
352
353         [PSON] Stop exposing PolicyAction::Suspend to WebCore
354         https://bugs.webkit.org/show_bug.cgi?id=192701
355
356         Reviewed by Brady Eidson.
357
358         Introduce a new WebPolicyAction enum that is used at WebKit2 layer and augments
359         WebCore::PolicyAction with a "Suspend" value.
360
361         * NetworkProcess/NetworkDataTaskBlob.cpp:
362         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
363         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
364         (toNSURLSessionResponseDisposition):
365         * Shared/WebPolicyAction.h: Added.
366         * UIProcess/WebFramePolicyListenerProxy.cpp:
367         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
368         (WebKit::WebFramePolicyListenerProxy::use):
369         (WebKit::WebFramePolicyListenerProxy::download):
370         (WebKit::WebFramePolicyListenerProxy::ignore):
371         * UIProcess/WebFramePolicyListenerProxy.h:
372         * UIProcess/WebFrameProxy.cpp:
373         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
374         * UIProcess/WebFrameProxy.h:
375         * UIProcess/WebPageProxy.cpp:
376         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
377         (WebKit::WebPageProxy::receivedPolicyDecision):
378         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
379         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
380         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
381         (WebKit::WebPageProxy::decidePolicyForResponse):
382         * UIProcess/WebPageProxy.h:
383         * UIProcess/WebPageProxy.messages.in:
384         * WebKit.xcodeproj/project.pbxproj:
385         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
386         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
387         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
388         * WebProcess/WebPage/WebFrame.cpp:
389         (WebKit::toPolicyAction):
390         (WebKit::WebFrame::didReceivePolicyDecision):
391         * WebProcess/WebPage/WebFrame.h:
392         * WebProcess/WebPage/WebPage.cpp:
393         (WebKit::WebPage::didReceivePolicyDecision):
394         * WebProcess/WebPage/WebPage.h:
395         * WebProcess/WebPage/WebPage.messages.in:
396
397 2018-12-14  David Quesada  <david_quesada@apple.com>
398
399         Remove a global 'using namespace WebKit' in WebViewImpl.mm
400         https://bugs.webkit.org/show_bug.cgi?id=192690
401
402         Reviewed by Tim Horton.
403
404         * UIProcess/Cocoa/WebViewImpl.mm:
405         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
406         (-[WKTextListTouchBarViewController _selectList:]):
407         (-[WKTextListTouchBarViewController setCurrentListType:]):
408         (-[WKTextTouchBarItemController initWithWebViewImpl:]):
409
410 2018-12-14  Chris Dumez  <cdumez@apple.com>
411
412         [PSON] WebsitePolicies are lost on process-swap
413         https://bugs.webkit.org/show_bug.cgi?id=192694
414         <rdar://problem/46715748>
415
416         Reviewed by Brady Eidson.
417
418         In case of process-swap on navigation, instead of sending the websitePolicies to the old
419         process, send them to the new process as we trigger the navigation. We tell the new process
420         that it is continuing a load and it will therefore not re-trigger a decidePolicyForNavigationAction.
421
422         * Shared/LoadParameters.cpp:
423         (WebKit::LoadParameters::encode const):
424         (WebKit::LoadParameters::decode):
425         * Shared/LoadParameters.h:
426         * UIProcess/WebPageProxy.cpp:
427         (WebKit::WebPageProxy::reattachToWebProcessForReload):
428         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
429         (WebKit::WebPageProxy::loadRequestWithNavigation):
430         (WebKit::WebPageProxy::loadDataWithNavigation):
431         (WebKit::WebPageProxy::goToBackForwardItem):
432         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
433         (WebKit::WebPageProxy::continueNavigationInNewProcess):
434         * UIProcess/WebPageProxy.h:
435         * WebProcess/WebPage/WebPage.cpp:
436         (WebKit::WebPage::loadRequest):
437         (WebKit::WebPage::loadDataImpl):
438         (WebKit::WebPage::loadData):
439         (WebKit::WebPage::loadAlternateHTML):
440         (WebKit::WebPage::goToBackForwardItem):
441         (WebKit::WebPage::createDocumentLoader):
442         * WebProcess/WebPage/WebPage.h:
443         * WebProcess/WebPage/WebPage.messages.in:
444
445 2018-12-14  Patrick Griffis  <pgriffis@igalia.com>
446
447         [GTK][WPE] Fix forwarding webkit socket to flatpak sandbox
448         https://bugs.webkit.org/show_bug.cgi?id=192622
449
450         Reviewed by Michael Catanzaro.
451
452         This fixes running with the sandbox enabled in Flatpak.
453
454         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
455         (WebKit::flatpakSpawn):
456         * UIProcess/Launcher/glib/FlatpakLauncher.h:
457         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
458         (WebKit::ProcessLauncher::launchProcess):
459
460 2018-12-14  Carlos Garcia Campos  <cgarcia@igalia.com>
461
462         [WPE] Use new view state API from libwpe
463         https://bugs.webkit.org/show_bug.cgi?id=191906
464
465         Reviewed by Žan Doberšek.
466
467         Remove WKViewSetViewState from the C API.
468
469         * UIProcess/API/C/wpe/WKAPICastWPE.h:
470         * UIProcess/API/C/wpe/WKView.cpp:
471         * UIProcess/API/C/wpe/WKView.h:
472         * UIProcess/API/wpe/WPEView.cpp:
473         (WKWPE::View::View): Add implementation for activity_state_changed vfunc of the view backend client.):
474         (WKWPE::View::setViewState): Remove the default flags.
475         * UIProcess/API/wpe/WPEView.h:
476         (WKWPE::View::setViewState const): Make it private.
477
478 2018-12-13  Joseph Pecoraro  <pecoraro@apple.com>
479
480         [iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIndication
481         https://bugs.webkit.org/show_bug.cgi?id=192689
482         <rdar://problem/46323610>
483
484         Reviewed by Simon Fraser.
485
486         * UIProcess/WebPageProxy.cpp:
487         (WebKit::WebPageProxy::close):
488         * UIProcess/WebPageProxy.h:
489         Don't wait until ~WebPageProxy to destroy the WebPageProxyDebuggable
490         which broadcasts it as a remote inspector target. Terminate this
491         as soon as the WebPageProxy closes and becomes invalid.
492
493 2018-12-13  Chris Dumez  <cdumez@apple.com>
494
495         Unreviewed build fix for tvOS.
496
497         * Platform/cocoa/WKCrashReporter.mm:
498
499 2018-12-13  Chris Dumez  <cdumez@apple.com>
500
501         Unreviewed build fix for tvOS.
502
503         * Platform/cocoa/WKCrashReporter.mm:
504
505 2018-12-13  Chris Dumez  <cdumez@apple.com>
506
507         [PSON] We should not need to navigate to 'about:blank' to suspend pages
508         https://bugs.webkit.org/show_bug.cgi?id=192668
509         <rdar://problem/46701466>
510
511         Reviewed by Alex Christensen.
512
513         To support PageCache when process-swap on cross-site navigation is enabled,
514         we've been navigating the previous process to 'about:blank' when swapping.
515         This would trigger PageCaching of the page in the old process. While
516         convenient, this design has led to a lot of bugs because we did not really
517         want a navigation to happen in the old process.
518
519         To address the issue, when a WebPage is asked to suspend (for process-swap),
520         we now attempt to add it to PageCache and save it on the current HistoryItem,
521         *without* triggering any navigation. Any pending navigation gets cancelled
522         and we just suspend in place.
523
524         Later on, when we want to go back to this HistoryItem, we simply leverage the
525         existing WebPage::goToBackForwardItem() code path. The only subtlety is that
526         we're actually asking the WebPage to load a HistoryItem that is the current
527         one in the History. I had to tweak a some logic / assertions to support this
528         as this is not something we usually do. However, it actually works with very
529         little changes and successfully restores the PageCache entry on the current
530         HistoryItem.
531
532         There is no expected overall behavior change and ProcessSwap API tests (which
533         cover PageCache) still pass. This is merely a simpler design because it avoids
534         navigating to about:blank.
535
536         * UIProcess/SuspendedPageProxy.cpp:
537         (WebKit::SuspendedPageProxy::didSuspend):
538         (WebKit::SuspendedPageProxy::didReceiveMessage):
539         * UIProcess/SuspendedPageProxy.h:
540         * UIProcess/WebPageProxy.cpp:
541         (WebKit::WebPageProxy::didSuspendAfterProcessSwap):
542         * UIProcess/WebPageProxy.h:
543         * UIProcess/WebPageProxy.messages.in:
544         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
545         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
546         * WebProcess/WebPage/WebDocumentLoader.cpp:
547         (WebKit::WebDocumentLoader::setNavigationID):
548         * WebProcess/WebPage/WebFrame.cpp:
549         (WebKit::WebFrame::didReceivePolicyDecision):
550         * WebProcess/WebPage/WebPage.cpp:
551         (WebKit::WebPage::suspendForProcessSwap):
552         * WebProcess/WebPage/WebPage.h:
553         * WebProcess/cocoa/WebProcessCocoa.mm:
554         (WebKit::origin):
555
556 2018-12-13  Per Arne Vollan  <pvollan@apple.com>
557
558         [macOS] Remove with-report from 3 services that are currently needed on macOS
559         https://bugs.webkit.org/show_bug.cgi?id=192593
560         <rdar://problem/46604752>
561
562         Reviewed by Brent Fulgham.
563
564         * WebProcess/com.apple.WebProcess.sb.in:
565
566 2018-12-13  Youenn Fablet  <youenn@apple.com>
567
568         On page close, WebPage::m_userMediaPermissionRequestManager is nullified too early
569         https://bugs.webkit.org/show_bug.cgi?id=192657
570
571         Reviewed by Eric Carlson.
572
573         Instead of nullifying the manager, make it a UniqueRef and clear it on closing the page.
574         This ensures we revoke the sandbox extensions as early as possible and keep the manager lifetime simple.
575
576         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
577         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager):
578         (WebKit::UserMediaPermissionRequestManager::clear):
579         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
580         * WebProcess/WebPage/WebPage.cpp:
581         (WebKit::WebPage::close):
582         * WebProcess/WebPage/WebPage.h:
583         (WebKit::WebPage::userMediaPermissionRequestManager):
584
585 2018-12-13  Chris Fleizach  <cfleizach@apple.com>
586
587         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
588         https://bugs.webkit.org/show_bug.cgi?id=192449
589         <rdar://problem/46595508>
590
591         Reviewed by Darin Adler.
592
593         Part 6: Files in plugin process and UI process.
594
595         * PluginProcess/PluginControllerProxy.cpp:
596         * PluginProcess/PluginProcess.cpp:
597         * PluginProcess/WebProcessConnection.cpp:
598         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
599         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
600         * UIProcess/mac/WebPageProxyMac.mm:
601
602 2018-12-13  Eric Carlson  <eric.carlson@apple.com>
603
604         [MediaStream] Calculate width or height when constraints contain only the other
605         https://bugs.webkit.org/show_bug.cgi?id=192632
606         <rdar://problem/46665734>
607
608         Reviewed by Youenn Fablet.
609
610         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
611         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable): Deleted,
612         replaced with videoSampleAvailable.
613
614         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
615         (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Use original frame
616         size if necessary when calculating new frame size.
617
618 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
619
620         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
621         https://bugs.webkit.org/show_bug.cgi?id=192449
622         <rdar://problem/46595508>
623
624         Reviewed by Darin Adler.
625
626         Part 5: Files in WebProcess folder.
627
628         * WebProcess/Cache/WebCacheStorageConnection.cpp:
629         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
630         (mediaTimeToCurrentTime):
631         (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
632         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
633         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
634
635 2018-12-12  Ross Kirsling  <ross.kirsling@sony.com>
636
637         [MSVC] Unreviewed build fix for r239080.
638
639         * UIProcess/WebPageProxy.cpp:
640         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
641
642 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
643
644         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
645         https://bugs.webkit.org/show_bug.cgi?id=192449
646         <rdar://problem/46595508>
647
648         Reviewed by Darin Adler.
649
650         Part 4: Handling NetworkProcess folder.
651
652         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
653         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
654         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
655         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
656         * NetworkProcess/ios/NetworkProcessIOS.mm:
657         * NetworkProcess/mac/NetworkProcessMac.mm:
658         * NetworkProcess/mac/RemoteNetworkingContext.mm:
659
660 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
661
662         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
663         https://bugs.webkit.org/show_bug.cgi?id=192449
664         <rdar://problem/46595508>
665
666         Reviewed by Tim Horton.
667
668         Fix iosmac build.
669
670         * UIProcess/ios/WKContentViewInteraction.mm:
671         (-[WKContentView _hoverGestureRecognizerChanged:]):
672
673 2018-12-12  Alex Christensen  <achristensen@webkit.org>
674
675         Implement safe browsing in WebKit on WatchOS
676         https://bugs.webkit.org/show_bug.cgi?id=192641
677         <rdar://problem/46376188>
678
679         Reviewed by Geoff Garen.
680
681         WatchOS has a few special requirements:
682         1. The margin size needs to be smaller and the title font smaller to fit on the screen.
683         2. The exclamation point cannot be beside the title or it won't fit on the screen.  I put it above the title.
684         3. The application must be told when the safe browsing warning has been shown.  I added a new delegate callback.
685         4. The UIScrollView's contentSize must be set even before the details are shown to be able to scroll down to the buttons.
686            This was already an issue on small WKWebViews on iOS, so this fixes both operating systems.
687
688         * Configurations/WebKit.xcconfig:
689         * UIProcess/API/APIUIClient.h:
690         (API::UIClient::didShowSafeBrowsingWarning):
691         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
692         * UIProcess/Cocoa/UIDelegate.h:
693         * UIProcess/Cocoa/UIDelegate.mm:
694         (WebKit::UIDelegate::setDelegate):
695         (WebKit::UIDelegate::UIClient::didShowSafeBrowsingWarning):
696         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
697         (fontOfSize):
698         (buttonSize):
699         (-[WKSafeBrowsingWarning addContent]):
700         (-[WKSafeBrowsingWarning showDetailsClicked]):
701         (-[WKSafeBrowsingWarning updateContentSize]):
702         (buttonWidth): Deleted.
703         * UIProcess/WebPageProxy.cpp:
704         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
705
706 2018-12-12  Commit Queue  <commit-queue@webkit.org>
707
708         Unreviewed, rolling out r239129 and r239131.
709         https://bugs.webkit.org/show_bug.cgi?id=192646
710
711         Casued macOS and iOS Debug testing to fail early (Requested by
712         Truitt on #webkit).
713
714         Reverted changesets:
715
716         "Unreviewed build fix for WinCairo Debug after r239080(?)."
717         https://trac.webkit.org/changeset/239129
718
719         "Unreviewed fix for Cocoa Debug test instability following
720         r239129."
721         https://trac.webkit.org/changeset/239131
722
723 2018-12-12  Vivek Seth  <v_seth@apple.com>
724
725         HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
726         https://bugs.webkit.org/show_bug.cgi?id=192375
727         <rdar://problem/45851159>
728
729         Reviewed by Chris Dumez.
730
731         Use simulated redirect to tell clients that HTTPS Upgrade happened.
732
733         * NetworkProcess/NetworkLoadChecker.cpp:
734         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
735         (WebKit::NetworkLoadChecker::checkRedirection):
736         (WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler):
737         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
738         (WebKit::NetworkLoadChecker::checkRequest):
739         (WebKit::NetworkLoadChecker::continueCheckingRequestOrDoSyntheticRedirect):
740         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
741         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded): Deleted.
742         * NetworkProcess/NetworkLoadChecker.h:
743         * NetworkProcess/NetworkResourceLoader.cpp:
744         (WebKit::NetworkResourceLoader::start):
745         * NetworkProcess/PingLoad.cpp:
746
747 2018-12-12  Ross Kirsling  <ross.kirsling@sony.com>
748
749         Unreviewed fix for Cocoa Debug test instability following r239129.
750
751         * UIProcess/WebPageProxy.cpp:
752         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap): Deleted.
753         * UIProcess/WebPageProxy.h:
754         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
755         Move the whole assertion to the declaration site.
756
757 2018-12-12  Chris Dumez  <cdumez@apple.com>
758
759         Add a preference to enable / disable devicemotion and deviceorientation events
760         https://bugs.webkit.org/show_bug.cgi?id=192631
761         <rdar://problem/46646244>
762
763         Reviewed by Geoffrey Garen.
764
765         Add setting to toggle support for the deviceorientation / devicemotion events:
766         - https://w3c.github.io/deviceorientation/
767
768         * Shared/WebPreferences.yaml:
769         * UIProcess/API/Cocoa/WKPreferences.mm:
770         (-[WKPreferences _setDeviceOrientationEventEnabled:]):
771         (-[WKPreferences _deviceOrientationEventEnabled]):
772         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
773
774 2018-12-12  Ross Kirsling  <ross.kirsling@sony.com>
775
776         Unreviewed build fix for WinCairo Debug after r239080(?).
777
778         MSVC gives a redefinition error if noreturn is specified on the definition instead of the declaration.
779
780         * UIProcess/WebPageProxy.cpp:
781         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
782         * UIProcess/WebPageProxy.h:
783         Move NO_RETURN_DUE_TO_ASSERT to the declaration site.
784
785 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
786
787         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
788         https://bugs.webkit.org/show_bug.cgi?id=192449
789         <rdar://problem/46595508>
790
791         Reviewed by Darin Adler.
792
793         Part 2: UIProcess/Cocoa and UIProcess/ios folders.
794
795         * UIProcess/Cocoa/WebViewImpl.h:
796         * UIProcess/Cocoa/WebViewImpl.mm:
797         * UIProcess/ios/WKContentView.mm:
798         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
799         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
800         (-[WKContentView dealloc]):
801         (-[WKContentView page]):
802         (-[WKContentView updateFixedClippingView:]):
803         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
804         (-[WKContentView _updateForScreen:]):
805         (-[WKContentView _accessibilityRegisterUIProcessTokens]):
806         (-[WKContentView _createDrawingAreaProxy]):
807         (-[WKContentView _didCommitLayerTree:]):
808         (-[WKContentView _wk_pageCountForPrintFormatter:]):
809         * UIProcess/ios/WKContentViewInteraction.mm:
810         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
811         (hasAssistedNode):
812         (-[WKContentView setupInteraction]):
813         (-[WKContentView positionInformation]):
814         (-[WKContentView _webTouchEventsRecognized:]):
815         (inflateQuad):
816         (-[WKContentView _updateTapHighlight]):
817         (-[WKContentView _showTapHighlight]):
818         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
819         (-[WKContentView _displayFormNodeInputView]):
820         (-[WKContentView inputView]):
821         (-[WKContentView _actionForLongPressFromPositionInformation:]):
822         (-[WKContentView currentPositionInformation]):
823         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
824         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
825         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
826         (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
827         (-[WKContentView gestureRecognizerShouldBegin:]):
828         (-[WKContentView hasSelectablePositionAtPoint:]):
829         (-[WKContentView pointIsNearMarkedText:]):
830         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
831         (-[WKContentView webSelectionRectsForSelectionRects:]):
832         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
833         (-[WKContentView _stylusSingleTapRecognized:]):
834         (-[WKContentView _singleTapCommited:]):
835         (-[WKContentView _attemptClickAtLocation:]):
836         (-[WKContentView _positionInformationDidChange:]):
837         (-[WKContentView requiresAccessoryView]):
838         (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
839         (-[WKContentView _lookupForWebView:]):
840         (-[WKContentView _shareForWebView:]):
841         (-[WKContentView textStylingAtPosition:inDirection:]):
842         (-[WKContentView canPerformActionForWebView:withSender:]):
843         (-[WKContentView selectForWebView:]):
844         (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
845         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
846         (toGestureType):
847         (toUIWKGestureType):
848         (toSelectionTouch):
849         (toUIWKSelectionTouch):
850         (toGestureRecognizerState):
851         (toUIGestureRecognizerState):
852         (toUIWKSelectionFlags):
853         (toWKTextGranularity):
854         (toWKSelectionDirection):
855         (selectionChangedWithGesture):
856         (selectionChangedWithTouch):
857         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
858         (-[WKContentView autocorrectionData]):
859         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
860         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
861         (-[WKContentView _updateAccessory]):
862         (-[WKContentView selectedTextRange]):
863         (-[WKContentView setMarkedText:selectedRange:]):
864         (coreWritingDirection):
865         (-[WKContentView closestPositionToPoint:]):
866         (-[WKContentView insertText:]):
867         (-[WKContentView textInputTraits]):
868         (-[WKContentView handleKeyWebEvent:]):
869         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
870         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
871         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
872         (-[WKContentView assistedNodeInformation]):
873         (-[WKContentView assistedNodeSelectOptions]):
874         (isAssistableInputType):
875         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
876         (-[WKContentView _stopAssistingNode]):
877         (-[WKContentView updateCurrentAssistedNodeInformation:]):
878         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
879         (-[WKContentView actionNameForFocusedFormControlView:]):
880         (-[WKContentView selectWordForReplacement]):
881         (-[WKContentView _updateChangedSelection:]):
882         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
883         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
884         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
885         (-[WKContentView _showRunOpenPanel:resultListener:]):
886         (-[WKContentView _showShareSheet:completionHandler:]):
887         (-[WKContentView positionInformationForActionSheetAssistant:]):
888         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
889         (-[WKContentView _startDrag:item:]):
890         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
891         (-[WKContentView _didHandleStartDataInteractionRequest:]):
892         (dropOperationForWebCoreDragOperation):
893         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
894         (-[WKContentView _didConcludeEditDataInteraction:]):
895         (-[WKContentView _didPerformDragOperation:]):
896         (-[WKContentView _prepareToDragPromisedAttachment:]):
897         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
898         (-[WKContentView _autofillContext]):
899         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
900         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
901         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
902         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
903         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
904         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
905         (-[WKContentView dropInteraction:performDrop:]):
906         (-[WKContentView dropInteraction:sessionDidEnd:]):
907         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
908         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
909         (-[WKContentView numericInputModeForListViewController:]):
910         (-[WKContentView textContentTypeForListViewController:]):
911         (-[WKContentView allowsDictationInputForListViewController:]):
912         (-[WKContentView _simulateLongPressActionAtLocation:]):
913         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
914         (-[WKContentView _presentationRectsForPreviewItemController:]):
915         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
916         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
917         (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
918         (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
919         (-[WKFullScreenViewController videoControlsManagerDidChange]):
920         (-[WKFullScreenViewController _manager]):
921         (-[WKFullScreenViewController _togglePiPAction:]):
922         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
923         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
924         (-[WKFullScreenWindowController isFullScreen]):
925         (-[WKFullScreenWindowController enterFullScreen]):
926         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
927         (-[WKFullScreenWindowController exitFullScreen]):
928         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
929         (-[WKFullScreenWindowController _completedExitFullScreen]):
930         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
931         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
932         (-[WKFullScreenWindowController _manager]):
933
934 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
935
936         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
937         https://bugs.webkit.org/show_bug.cgi?id=192449
938         <rdar://problem/46595508>
939
940         Reviewed by Darin Adler.
941
942         Part 1: Files in Shared folder.
943
944         * Shared/API/c/WKRenderLayer.cpp:
945         (WKRenderLayerGetFrameContentsLayer):
946         * Shared/API/c/cf/WKErrorCF.cpp:
947         (WKErrorCreateWithCFError):
948         (WKErrorCopyCFError):
949         * Shared/API/c/cg/WKImageCG.cpp:
950         (WKImageCreateCGImage):
951         (WKImageCreateFromCGImage):
952         * Shared/API/c/mac/WKWebArchive.cpp:
953         (WKWebArchiveGetTypeID):
954         (WKWebArchiveCreate):
955         (WKWebArchiveCreateWithData):
956         (WKWebArchiveCreateFromRange):
957         (WKWebArchiveCopyMainResource):
958         (WKWebArchiveCopySubresources):
959         (WKWebArchiveCopySubframeArchives):
960         (WKWebArchiveCopyData):
961         * Shared/API/c/mac/WKWebArchiveResource.cpp:
962         (WKWebArchiveResourceGetTypeID):
963         (WKWebArchiveResourceCreate):
964         (WKWebArchiveResourceCopyData):
965         (WKWebArchiveResourceCopyURL):
966         (WKWebArchiveResourceCopyMIMEType):
967         (WKWebArchiveResourceCopyTextEncoding):
968         * Shared/ChildProcess.cpp:
969         * Shared/ContextMenuContextData.cpp:
970         * Shared/EditorState.cpp:
971         * Shared/Plugins/NPIdentifierData.cpp:
972         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
973         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
974         * Shared/SessionState.cpp:
975         * Shared/SessionTracker.cpp:
976         * Shared/ShareableBitmap.cpp:
977         * Shared/ShareableResource.cpp:
978         * Shared/VisibleContentRectUpdateInfo.cpp:
979         * Shared/WebBackForwardListItem.cpp:
980         * Shared/WebContextMenuItemData.cpp:
981         * Shared/WebCoreArgumentCoders.cpp:
982         * Shared/WebHitTestResultData.cpp:
983         * Shared/WebImage.cpp:
984         * Shared/WebMediaSessionMetadata.cpp:
985         * Shared/WebMemorySampler.cpp:
986         * Shared/WebMouseEvent.cpp:
987         * Shared/WebRenderObject.cpp:
988         * Shared/WebSQLiteDatabaseTracker.cpp:
989         * Shared/WebWheelEvent.cpp:
990         * Shared/cf/ArgumentCodersCF.cpp:
991         * Shared/ios/WebPlatformTouchPointIOS.cpp:
992
993 2018-12-12  Chris Fleizach  <cfleizach@apple.com>
994
995         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
996         https://bugs.webkit.org/show_bug.cgi?id=192449
997         <rdar://problem/46595508>
998
999         Reviewed by Darin Adler.
1000
1001         Part 1: Files in NetworkProcess.
1002
1003         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
1004         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1005         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1006         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1007         * NetworkProcess/ios/NetworkProcessIOS.mm:
1008         * NetworkProcess/mac/NetworkProcessMac.mm:
1009         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1010
1011 2018-12-12  Chris Dumez  <cdumez@apple.com>
1012
1013         Unreviewed build with with recent macOS SDKs.
1014
1015         * Platform/cocoa/WKCrashReporter.mm:
1016
1017 2018-12-12  Chris Dumez  <cdumez@apple.com>
1018
1019         Unreviewed attempt to fix GTK build after r239104.
1020
1021         * UIProcess/WebPageProxy.cpp:
1022         (WebKit::WebPageProxy::performDragControllerAction):
1023
1024 2018-12-12  Chris Dumez  <cdumez@apple.com>
1025
1026         Unreviewed attempt to fix build with older SDKs after r239110.
1027
1028         * Platform/cocoa/WKCrashReporter.mm:
1029
1030 2018-12-12  Chris Dumez  <cdumez@apple.com>
1031
1032         Unreviewed, fix build with recent SDKs.
1033
1034         * Platform/cocoa/WKCrashReporter.mm:
1035
1036 2018-12-09  Darin Adler  <darin@apple.com>
1037
1038         [iOS] Zero memory containing the password for PDF documents when a WKPDFView is deallocated
1039         https://bugs.webkit.org/show_bug.cgi?id=192536
1040         rdar://problem/41174451
1041
1042         Reviewed by Tim Horton.
1043
1044         * UIProcess/ios/WKPDFView.mm: Took out PLATFORM(IOSMAC) since
1045         this class is not compiled on that platform at this time. Can always
1046         add it back later.
1047         (-[WKPDFView dealloc]): Zero out characters of _passwordForPrinting.
1048         (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]):
1049         Initialize _passwordForPrinting; use a CString instead of retaining
1050         an NSString since we can zero that out easily.
1051         (-[WKPDFView _ensureDocumentForPrinting]): Use _passwordForPrinting.
1052
1053 2018-12-12  Commit Queue  <commit-queue@webkit.org>
1054
1055         Unreviewed, rolling out r239103.
1056         https://bugs.webkit.org/show_bug.cgi?id=192627
1057
1058         It broke the built because it depends on another patch that
1059         didn't land yet (Requested by KaL on #webkit).
1060
1061         Reverted changeset:
1062
1063         "[WPE] Add API to notify about frame displayed view backend
1064         callback"
1065         https://bugs.webkit.org/show_bug.cgi?id=192224
1066         https://trac.webkit.org/changeset/239103
1067
1068 2018-12-12  Chris Dumez  <cdumez@apple.com>
1069
1070         Restore MESSAGE_CHECK_URL() security check on sourceURL in didPerformClientRedirect()
1071         https://bugs.webkit.org/show_bug.cgi?id=191982
1072         <rdar://problem/46258054>
1073
1074         Reviewed by Alex Christensen.
1075
1076         Have the WebPageProxy remember the local paths it previously visited so that the
1077         MESSAGE_CHECK_URL() checks still work when process-swap on navigation is enabled.
1078
1079         Add back MESSAGE_CHECK_URL() on sourceURL in didPerformClientRedirect().
1080
1081         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1082         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
1083         * UIProcess/RemoteWebInspectorProxy.cpp:
1084         (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
1085         * UIProcess/WebInspectorProxy.cpp:
1086         (WebKit::WebInspectorProxy::createFrontendPage):
1087         * UIProcess/WebPageProxy.cpp:
1088         (WebKit::WebPageProxy::loadRequestWithNavigation):
1089         (WebKit::WebPageProxy::loadFile):
1090         (WebKit::WebPageProxy::loadDataWithNavigation):
1091         (WebKit::WebPageProxy::loadAlternateHTML):
1092         (WebKit::WebPageProxy::reload):
1093         (WebKit::WebPageProxy::didPerformClientRedirect):
1094         (WebKit::WebPageProxy::backForwardGoToItem):
1095         (WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
1096         (WebKit::WebPageProxy::addPreviouslyVisitedPath):
1097         (WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
1098         * UIProcess/WebPageProxy.h:
1099         * UIProcess/WebProcessProxy.cpp:
1100         (WebKit::WebProcessProxy::assumeReadAccessToBaseURL):
1101         * UIProcess/WebProcessProxy.h:
1102         * UIProcess/mac/WebPageProxyMac.mm:
1103
1104 2018-11-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1105
1106         [WPE] Add API to notify about frame displayed view backend callback
1107         https://bugs.webkit.org/show_bug.cgi?id=192224
1108
1109         Reviewed by Michael Catanzaro.
1110
1111         Add API to add a callback to the view to be called when the view backend notifies that a frame has been
1112         displayed.
1113
1114         * UIProcess/API/glib/WebKitWebView.cpp:
1115         (FrameDisplayedCallback::FrameDisplayedCallback):
1116         (FrameDisplayedCallback::~FrameDisplayedCallback):
1117         (webkit_web_view_add_frame_displayed_callback):
1118         (webkit_web_view_remove_frame_displayed_callback):
1119         * UIProcess/API/wpe/WebKitWebView.h:
1120
1121 2018-12-11  Justin Michaud  <justin_michaud@apple.com>
1122
1123         Implement feature flag for CSS Typed OM
1124         https://bugs.webkit.org/show_bug.cgi?id=192610
1125
1126         Reviewed by Ryosuke Niwa.
1127
1128         * Configurations/FeatureDefines.xcconfig:
1129         * Shared/WebPreferences.yaml:
1130         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1131         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1132
1133 2018-12-11  Fujii Hironori  <Hironori.Fujii@sony.com>
1134
1135         [Win][Clang] Fix warning -Wmissing-field-initializers
1136         https://bugs.webkit.org/show_bug.cgi?id=192584
1137
1138         Reviewed by Yusuke Suzuki.
1139
1140         Initialize a struct with '{ }' instead of '= {0}'.
1141
1142         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
1143         (WebKit::ProcessLauncher::launchProcess):
1144         * UIProcess/win/WebPopupMenuProxyWin.cpp:
1145         (WebKit::WebPopupMenuProxyWin::showPopupMenu):
1146         * UIProcess/win/WebView.cpp:
1147         (WebKit::WebView::initializeToolTipWindow):
1148         (WebKit::WebView::setToolTip):
1149
1150 2018-12-11  Chris Dumez  <cdumez@apple.com>
1151
1152         PSON logic gets confused by concurrent decidePolicyForNavigationAction requests
1153         https://bugs.webkit.org/show_bug.cgi?id=192482
1154         <rdar://problem/46470145>
1155
1156         Reviewed by Antti Koivisto.
1157
1158         It is possible to get 2 parallel decidePolicyForNavigationAction() requests from the
1159         WebProcess when a new load is started before responding to the existing policy
1160         decision. This would lead to several issues with regards to PSON:
1161         - We would decide to swap for the first policy decision and tell the WebProcess to
1162           suspend. However, because the WebProcess issued a new decidePolicyForNavigationAction
1163           since for the same frame, the previous one is invalidated and the WebProcess would
1164           ignore our request to suspend.
1165         - We would hit assertions later on because the navigation has been destroyed and yet
1166           we're getting a didStartProvisionalLoad for it.
1167         - swapToWebProcess() was asynchronous so that it would wait for the destination
1168           SuspendedPage to finish suspending before asking it to unsuspend. This led to various
1169           problems because anything can happen in the UIProcess while we're waiting for the
1170           suspension (e.g. another load). Also, we may create the SuspendedPageProxy for
1171           the current page too late and start getting IPC from the previous process about
1172           the suspension load to about:blank.
1173
1174         To address these issues, the following design is now implemented:
1175         - swapToWebProcess() is no longer asynchronous
1176         - instead, WebProcessPool::processForNavigation() is now asynchronous. This is better
1177           because at this point we have not yet told the WebProcess about the policy decision.
1178           We already properly deal with the policy decision being made asynchronously. This
1179           also allows us to choose another process if the SuspendedPage we'd like to use
1180           failed to suspend.
1181         - If the WebProcess receives a PolicyAction::Suspend but ignores it, have it send an
1182           IPC to the UIProcess so that the SuspendedPageProxy knows about it. We then destroy
1183           the SuspendedPageProxy and make sure it is not used.
1184         - After the asynchronous process selection, if the navigation has been destroy, abort
1185           the process-swap to avoid hitting assertions later on due to doing a load for a
1186           destroyed navigation.
1187
1188         * UIProcess/SuspendedPageProxy.cpp:
1189         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
1190         Make sure m_whenReadyToConsume completion handler gets called if necessary if the
1191         SuspendedPageProxy gets destroyed. We pass null so that the SuspendedPage is not
1192         used.
1193
1194         (WebKit::SuspendedPageProxy::whenReadyToConsume):
1195         Add whenReadyToConsume() utility method to get a completion handler called when
1196         the SuspendedPageProxy is ready to be used. This basically means we have to wait
1197         for the page to finish its about:blank suspension load. If the suspension fails
1198         then we call the completion handler with null to indicate that the suspended
1199         page is not usable.
1200
1201         (WebKit::SuspendedPageProxy::unsuspendAndConsume):
1202         Rename unsuspend() to unsuspendAndConsume() and make it synchronous. This only gets
1203         called after whenReadyToConsume()'s completion handler has been called and if we
1204         do decide to use the SuspendedPageProxy. It tells the WebProcess to unsuspend and
1205         removes the SuspendedPageProxy from the WebProcessPool.
1206
1207         (WebKit::SuspendedPageProxy::didFinishLoad):
1208         rename m_finishedSuspendingHandler to m_whenReadyToConsume.
1209
1210         (WebKit::SuspendedPageProxy::didFailToSuspend):
1211         Add new didFailToSuspend() that gets called when the WebProcess sends us an IPC telling
1212         us it ignored our request to suspend. We then call m_whenReadyToConsume completion
1213         handler with null and destroy the SuspendedPageProxy.
1214
1215         (WebKit::SuspendedPageProxy::didReceiveMessage):
1216         * UIProcess/SuspendedPageProxy.h:
1217
1218         * UIProcess/WebNavigationState.h:
1219         (WebKit::WebNavigationState::hasNavigation const):
1220         Add utility function to query if a navigation is still valid.
1221
1222         * UIProcess/WebPageProxy.cpp:
1223         (WebKit::WebPageProxy::swapToWebProcess):
1224         Update method so that it is no longer asynchronous. Some of its code was also moved to
1225         continueNavigationInNewProcess() for clarity.
1226
1227         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1228         Deal with WebProcessPool::processForNavigation() now being asynchronous.
1229
1230         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1231         Update code now that swapToWebProcess() is no longer asynchronous. Some of the swapToWebProcess()
1232         code was also moved here for clarity.
1233
1234         (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):
1235
1236         * UIProcess/WebPageProxy.h:
1237         * UIProcess/WebPageProxy.messages.in:
1238         Add new DidFailToSuspendAfterProcessSwap IPC message.
1239
1240         * UIProcess/WebProcessPool.cpp:
1241         (WebKit::WebProcessPool::processForNavigation):
1242         (WebKit::WebProcessPool::processForNavigationInternal):
1243         * UIProcess/WebProcessPool.h:
1244         Make asynchronous. If we decide to use a SuspendedPageProxy's process, then call
1245         whenReadyToConsume() on it to wait for it to suspend. If the SuspendedPageProxy
1246         fails to suspend use a new process instead.
1247
1248         * WebProcess/WebPage/WebFrame.cpp:
1249         (WebKit::WebFrame::didReceivePolicyDecision):
1250         If we ignore the policy decision and the decision was "Suspend", send the DidFailToSuspendAfterProcessSwap
1251         IPC to the UIProcess so that the SuspendedPageProxy knows about it.
1252
1253 2018-12-11  Andy Estes  <aestes@apple.com>
1254
1255         Introduce makeBlockPtr for lambdas
1256         https://bugs.webkit.org/show_bug.cgi?id=192594
1257
1258         Reviewed by Alex Christensen.
1259
1260         Adopted makeBlockPtr.
1261
1262         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm:
1263         (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
1264         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1265         (WebKit::NetworkCache::IOChannel::read):
1266         (WebKit::NetworkCache::IOChannel::write):
1267         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1268         (WebKit::NetworkProcess::clearDiskCache):
1269         (WebKit::saveCookies):
1270         * NetworkProcess/watchos/NetworkProximityAssertion.mm:
1271         (WebKit::BluetoothProximityAssertion::suspend):
1272         * UIProcess/API/Cocoa/WKWebView.mm:
1273         (-[WKWebView _setInputDelegate:]):
1274         * UIProcess/API/mac/WKView.mm:
1275         (-[WKView maybeInstallIconLoadingClient]):
1276         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1277         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
1278         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
1279         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1280         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1281         * UIProcess/Cocoa/AutomationSessionClient.mm:
1282         (WebKit::AutomationSessionClient::requestNewPageWithOptions):
1283         (WebKit::AutomationSessionClient::requestSwitchToPage):
1284         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
1285         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
1286         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
1287         * UIProcess/Cocoa/DownloadClient.mm:
1288         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
1289         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
1290         * UIProcess/Cocoa/IconLoadingDelegate.mm:
1291         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
1292         * UIProcess/Cocoa/NavigationState.mm:
1293         (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
1294         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
1295         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
1296         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1297         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
1298         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
1299         * UIProcess/Cocoa/UIDelegate.mm:
1300         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
1301         (WebKit::UIDelegate::UIClient::createNewPage):
1302         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
1303         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
1304         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
1305         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
1306         (WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest):
1307         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
1308         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
1309         (WebKit::UIDelegate::UIClient::windowFrame):
1310         (WebKit::UIDelegate::UIClient::toolbarsAreVisible):
1311         (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
1312         (WebKit::UIDelegate::UIClient::runOpenPanel):
1313         (WebKit::requestUserMediaAuthorizationForDevices):
1314         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
1315         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
1316         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
1317         (WebKit::UIDelegate::UIClient::requestPointerLock):
1318         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1319         (-[WKSafeBrowsingWarning clickedOnLink:]):
1320         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1321         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
1322         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
1323         (WebKit::HidConnection::send):
1324         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
1325         (WebKit::LocalConnection::getUserConsent const):
1326         (WebKit::LocalConnection::getAttestation const):
1327         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
1328         (WebKit::MockHidConnection::send):
1329         * UIProcess/ios/PageClientImplIOS.mm:
1330         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
1331         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1332         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
1333         * UIProcess/mac/ServicesController.mm:
1334         (WebKit::hasCompatibleServicesForItems):
1335         (WebKit::ServicesController::refreshExistingServices):
1336         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1337         (PageLoaderClient::didStartProvisionalLoadForFrame):
1338
1339 2018-12-11  Alex Christensen  <achristensen@webkit.org>
1340
1341         Fix an internal build failure after r239014
1342         https://bugs.webkit.org/show_bug.cgi?id=192205
1343
1344         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1345         (fontOfSize):
1346         There's a system that doesn't have safe browsing or UIFontTextStyleLargeTitle.
1347
1348 2018-12-11  Brian Burg  <bburg@apple.com>
1349
1350         SimulatedInputDispatcher::transitionInputSourceToState() can reuse a moved-from completion handler
1351         https://bugs.webkit.org/show_bug.cgi?id=191155
1352         <rdar://problem/45745569>
1353
1354         Reviewed by Joseph Pecoraro.
1355
1356         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
1357         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
1358         Add an ASSERT to guard against unexpected inputs where >1 VirtualKey changes per state.
1359         webkitdriver needs to be updated to not produce such states in this scenario, but this will
1360         avoid a runtime crash caused by trying to call a moved-out completion handler a second time.
1361
1362 2018-12-11  Commit Queue  <commit-queue@webkit.org>
1363
1364         Unreviewed, rolling out r239071.
1365         https://bugs.webkit.org/show_bug.cgi?id=192588
1366
1367         Broke WPE build due to undefined references to toAPI() and
1368         toImpl() inside the C API (Requested by magomez on #webkit).
1369
1370         Reverted changeset:
1371
1372         "[meta][WebKit] Remove using namespace WebCore and WebKit in
1373         the global scope for unified source builds"
1374         https://bugs.webkit.org/show_bug.cgi?id=192449
1375         https://trac.webkit.org/changeset/239071
1376
1377 2018-12-10  Chris Fleizach  <cfleizach@apple.com>
1378
1379         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1380         https://bugs.webkit.org/show_bug.cgi?id=192449
1381
1382         Reviewed by Darin Adler.
1383
1384         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
1385         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1386         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1387         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1388         * NetworkProcess/ios/NetworkProcessIOS.mm:
1389         * NetworkProcess/mac/NetworkProcessMac.mm:
1390         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1391         * Platform/spi/ios/AccessibilitySupportSPI.h:
1392         * PlatformMac.cmake:
1393         * PluginProcess/PluginControllerProxy.cpp:
1394         * PluginProcess/PluginProcess.cpp:
1395         * PluginProcess/WebProcessConnection.cpp:
1396         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
1397         * Shared/API/c/cf/WKErrorCF.cpp:
1398         (WKErrorCreateWithCFError):
1399         (WKErrorCopyCFError):
1400         * Shared/API/c/cg/WKImageCG.cpp:
1401         (WKImageCreateCGImage):
1402         (WKImageCreateFromCGImage):
1403         * Shared/ChildProcess.cpp:
1404         * Shared/ContextMenuContextData.cpp:
1405         * Shared/EditorState.cpp:
1406         * Shared/Plugins/NPIdentifierData.cpp:
1407         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
1408         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1409         * Shared/SessionState.cpp:
1410         * Shared/SessionTracker.cpp:
1411         * Shared/ShareableBitmap.cpp:
1412         * Shared/ShareableResource.cpp:
1413         * Shared/VisibleContentRectUpdateInfo.cpp:
1414         * Shared/WebBackForwardListItem.cpp:
1415         * Shared/WebContextMenuItemData.cpp:
1416         * Shared/WebCoreArgumentCoders.cpp:
1417         * Shared/WebHitTestResultData.cpp:
1418         * Shared/WebImage.cpp:
1419         * Shared/WebMediaSessionMetadata.cpp:
1420         * Shared/WebMemorySampler.cpp:
1421         * Shared/WebMouseEvent.cpp:
1422         * Shared/WebRenderObject.cpp:
1423         * Shared/WebSQLiteDatabaseTracker.cpp:
1424         * Shared/WebWheelEvent.cpp:
1425         * Shared/cf/ArgumentCodersCF.cpp:
1426         * Shared/ios/WebPlatformTouchPointIOS.cpp:
1427         * SourcesCocoa.txt:
1428         * UIProcess/API/APIContentRuleListStore.cpp:
1429         * UIProcess/API/APIHitTestResult.cpp:
1430         * UIProcess/API/APINavigation.cpp:
1431         * UIProcess/API/APIOpenPanelParameters.cpp:
1432         * UIProcess/API/APIPageConfiguration.cpp:
1433         * UIProcess/API/C/WKPage.cpp:
1434         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
1435         (WKPageLoadURLWithUserData):
1436         (WKPageLoadURLRequestWithUserData):
1437         (WKPageSetPaginationMode):
1438         (WKPageGetPaginationMode):
1439         (WKPageSetPageLoaderClient):
1440         (WKPageSetPagePolicyClient):
1441         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
1442         * UIProcess/Cocoa/WebViewImpl.h:
1443         * UIProcess/Cocoa/WebViewImpl.mm:
1444         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1445         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
1446         * UIProcess/ios/WKContentView.mm:
1447         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
1448         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
1449         (-[WKContentView dealloc]):
1450         (-[WKContentView page]):
1451         (-[WKContentView updateFixedClippingView:]):
1452         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1453         (-[WKContentView _updateForScreen:]):
1454         (-[WKContentView _accessibilityRegisterUIProcessTokens]):
1455         (-[WKContentView _createDrawingAreaProxy]):
1456         (-[WKContentView _didCommitLayerTree:]):
1457         (-[WKContentView _wk_pageCountForPrintFormatter:]):
1458         * UIProcess/ios/WKContentViewInteraction.mm:
1459         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
1460         (hasAssistedNode):
1461         (-[WKContentView setupInteraction]):
1462         (-[WKContentView positionInformation]):
1463         (-[WKContentView _webTouchEventsRecognized:]):
1464         (inflateQuad):
1465         (-[WKContentView _updateTapHighlight]):
1466         (-[WKContentView _showTapHighlight]):
1467         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
1468         (-[WKContentView _displayFormNodeInputView]):
1469         (-[WKContentView inputView]):
1470         (-[WKContentView _actionForLongPressFromPositionInformation:]):
1471         (-[WKContentView currentPositionInformation]):
1472         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
1473         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
1474         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
1475         (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
1476         (-[WKContentView gestureRecognizerShouldBegin:]):
1477         (-[WKContentView hasSelectablePositionAtPoint:]):
1478         (-[WKContentView pointIsNearMarkedText:]):
1479         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1480         (-[WKContentView webSelectionRectsForSelectionRects:]):
1481         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
1482         (-[WKContentView _stylusSingleTapRecognized:]):
1483         (-[WKContentView _singleTapCommited:]):
1484         (-[WKContentView _attemptClickAtLocation:]):
1485         (-[WKContentView _positionInformationDidChange:]):
1486         (-[WKContentView requiresAccessoryView]):
1487         (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
1488         (-[WKContentView _lookupForWebView:]):
1489         (-[WKContentView _shareForWebView:]):
1490         (-[WKContentView textStylingAtPosition:inDirection:]):
1491         (-[WKContentView canPerformActionForWebView:withSender:]):
1492         (-[WKContentView selectForWebView:]):
1493         (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
1494         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
1495         (toGestureType):
1496         (toUIWKGestureType):
1497         (toSelectionTouch):
1498         (toUIWKSelectionTouch):
1499         (toGestureRecognizerState):
1500         (toUIGestureRecognizerState):
1501         (toUIWKSelectionFlags):
1502         (toWKTextGranularity):
1503         (toWKSelectionDirection):
1504         (selectionChangedWithGesture):
1505         (selectionChangedWithTouch):
1506         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
1507         (-[WKContentView autocorrectionData]):
1508         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
1509         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
1510         (-[WKContentView _updateAccessory]):
1511         (-[WKContentView selectedTextRange]):
1512         (-[WKContentView setMarkedText:selectedRange:]):
1513         (coreWritingDirection):
1514         (-[WKContentView closestPositionToPoint:]):
1515         (-[WKContentView insertText:]):
1516         (-[WKContentView textInputTraits]):
1517         (-[WKContentView handleKeyWebEvent:]):
1518         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
1519         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
1520         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
1521         (-[WKContentView assistedNodeInformation]):
1522         (-[WKContentView assistedNodeSelectOptions]):
1523         (isAssistableInputType):
1524         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1525         (-[WKContentView _stopAssistingNode]):
1526         (-[WKContentView updateCurrentAssistedNodeInformation:]):
1527         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
1528         (-[WKContentView actionNameForFocusedFormControlView:]):
1529         (-[WKContentView selectWordForReplacement]):
1530         (-[WKContentView _updateChangedSelection:]):
1531         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
1532         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
1533         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
1534         (-[WKContentView _showRunOpenPanel:resultListener:]):
1535         (-[WKContentView _showShareSheet:completionHandler:]):
1536         (-[WKContentView positionInformationForActionSheetAssistant:]):
1537         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
1538         (-[WKContentView _startDrag:item:]):
1539         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
1540         (-[WKContentView _didHandleStartDataInteractionRequest:]):
1541         (dropOperationForWebCoreDragOperation):
1542         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
1543         (-[WKContentView _didConcludeEditDataInteraction:]):
1544         (-[WKContentView _didPerformDragOperation:]):
1545         (-[WKContentView _prepareToDragPromisedAttachment:]):
1546         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
1547         (-[WKContentView _autofillContext]):
1548         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
1549         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
1550         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
1551         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
1552         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
1553         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
1554         (-[WKContentView dropInteraction:performDrop:]):
1555         (-[WKContentView dropInteraction:sessionDidEnd:]):
1556         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
1557         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
1558         (-[WKContentView numericInputModeForListViewController:]):
1559         (-[WKContentView textContentTypeForListViewController:]):
1560         (-[WKContentView allowsDictationInputForListViewController:]):
1561         (-[WKContentView _simulateLongPressActionAtLocation:]):
1562         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1563         (-[WKContentView _presentationRectsForPreviewItemController:]):
1564         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1565         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
1566         (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
1567         (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
1568         (-[WKFullScreenViewController videoControlsManagerDidChange]):
1569         (-[WKFullScreenViewController _manager]):
1570         (-[WKFullScreenViewController _togglePiPAction:]):
1571         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1572         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
1573         (-[WKFullScreenWindowController isFullScreen]):
1574         (-[WKFullScreenWindowController enterFullScreen]):
1575         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
1576         (-[WKFullScreenWindowController exitFullScreen]):
1577         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
1578         (-[WKFullScreenWindowController _completedExitFullScreen]):
1579         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
1580         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
1581         (-[WKFullScreenWindowController _manager]):
1582         * UIProcess/mac/WebPageProxyMac.mm:
1583         * WebKit.xcodeproj/project.pbxproj:
1584         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1585         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1586         (mediaTimeToCurrentTime):
1587         (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
1588         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1589         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
1590
1591 2018-12-10  Don Olmstead  <don.olmstead@sony.com>
1592
1593         Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
1594         https://bugs.webkit.org/show_bug.cgi?id=192573
1595
1596         Reviewed by Simon Fraser.
1597
1598         * Configurations/FeatureDefines.xcconfig:
1599
1600 2018-12-10  Youenn Fablet  <youenn@apple.com>
1601
1602         Remove derived classes of RealtimeMediaSourceCenter
1603         https://bugs.webkit.org/show_bug.cgi?id=192546
1604
1605         Reviewed by Eric Carlson.
1606
1607         pdate code according WebCore changes.
1608
1609         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1610         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
1611         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1612         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
1613         (WebKit::UserMediaCaptureManager::initialize):
1614
1615 2018-12-10  Tim Horton  <timothy_horton@apple.com>
1616
1617         Animated scrolling on Google Maps scrolls the page in addition to moving the map
1618         https://bugs.webkit.org/show_bug.cgi?id=192521
1619         <rdar://problem/46382007>
1620
1621         Reviewed by Sam Weinig.
1622
1623         * Platform/spi/ios/UIKitSPI.h:
1624         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
1625         (-[WKKeyboardScrollViewAnimator rubberbandableDirections]):
1626         Only do keyboard-based rubber-banding in directions that we can actually
1627         scroll, not directions we can only finger-rubber-band in. This effectively
1628         means keyboard scrolling will ignore "alwaysBounce{Vertical, Horizontal}".
1629
1630 2018-12-10  Commit Queue  <commit-queue@webkit.org>
1631
1632         Unreviewed, rolling out r239023.
1633         https://bugs.webkit.org/show_bug.cgi?id=192571
1634
1635         Speculative rollout due to broken perf test (Requested by
1636         deanj on #webkit).
1637
1638         Reverted changeset:
1639
1640         "Enable HTTP and HTTPS proxies on iOS and make it a property
1641         of the NSURLSession"
1642         https://bugs.webkit.org/show_bug.cgi?id=192374
1643         https://trac.webkit.org/changeset/239023
1644
1645 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1646
1647         Unreviewed, fix the iOS build after r239039.
1648         https://bugs.webkit.org/show_bug.cgi?id=192568
1649
1650         * UIProcess/ios/WKContentViewInteraction.mm:
1651         (-[WKContentView dropInteraction:sessionDidUpdate:]):
1652
1653 2018-12-10  Alex Christensen  <achristensen@webkit.org>
1654
1655         Fix WatchOS build.
1656
1657         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1658         * UIProcess/ios/WKContentViewInteraction.mm:
1659         (-[WKContentView actionNameForFocusedFormControlView:]):
1660
1661 2018-12-10  Matt Lewis  <jlewis3@apple.com>
1662
1663         Unreviewed, rolling out r239029.
1664
1665         This patch caused internal build failures.
1666
1667         Reverted changeset:
1668
1669         "[meta][WebKit] Remove using namespace WebCore and WebKit in
1670         the global scope for unified source builds"
1671         https://bugs.webkit.org/show_bug.cgi?id=192449
1672         https://trac.webkit.org/changeset/239029
1673
1674 2018-12-10  Chris Dumez  <cdumez@apple.com>
1675
1676         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess
1677         https://bugs.webkit.org/show_bug.cgi?id=192509
1678         <rdar://problem/46500832>
1679
1680         Reviewed by Alex Christensen.
1681
1682         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess instead of doing
1683         it at resource-level from the injected bundle.
1684
1685         The custom user-agent string can now be set on _WKWebsitePolicies during the
1686         decidePolicyForNavigationAction for the main feame, and will impact this main resource load as well as its
1687         future subresource loads.
1688
1689         * Shared/WebsitePoliciesData.cpp:
1690         (WebKit::WebsitePoliciesData::encode const):
1691         (WebKit::WebsitePoliciesData::decode):
1692         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1693         * Shared/WebsitePoliciesData.h:
1694         * UIProcess/API/APIWebsitePolicies.cpp:
1695         (API::WebsitePolicies::data):
1696         * UIProcess/API/APIWebsitePolicies.h:
1697         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1698         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1699         (-[_WKWebsitePolicies setCustomUserAgent:]):
1700         (-[_WKWebsitePolicies customUserAgent]):
1701         * UIProcess/Cocoa/NavigationState.mm:
1702         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1703
1704 2018-12-10  Alex Christensen  <achristensen@webkit.org>
1705
1706         Safe browsing warning should layout buttons vertically in narrow WKWebViews
1707         https://bugs.webkit.org/show_bug.cgi?id=192535
1708         <rdar://problem/46308364>
1709
1710         Reviewed by Tim Horton.
1711
1712         They're usually next to each other, but in narrow WKWebViews they currently get clipped.
1713         In order to make it more likely that both buttons are completely visible, put one above
1714         the other if the WKWebView is too narrow to completely show both.  This also helps with
1715         languages where the translations of "Go Back" or "Show Details" are rendered wider than English.
1716
1717         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1718         (buttonWidth):
1719         (-[WKSafeBrowsingWarning addContent]):
1720
1721 2018-12-10  Simon Fraser  <simon.fraser@apple.com>
1722
1723         Allow control over child order when adding nodes to the scrolling tree
1724         https://bugs.webkit.org/show_bug.cgi?id=176914
1725         <rdar://problem/46542237>
1726         
1727         Re-land r239010 after over-zealous rollout.
1728
1729         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1730         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
1731
1732 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1733
1734         [iOS] Caret is obscured by finger when dragging over an editable element
1735         https://bugs.webkit.org/show_bug.cgi?id=192499
1736         <rdar://problem/46570101>
1737
1738         Reviewed by Tim Horton.
1739
1740         Add support for setting the `precise` property of `UIDropProposal` to YES when dragging over an editable area.
1741         When enabled, this property shifts the drop location up by a small amount, allowing the user to see the drop
1742         caret (currently, this is not the case, and it's difficult to drop text at a precise location on iOS). Changes
1743         are covered by adding to existing API tests.
1744
1745         * Scripts/webkit/messages.py:
1746         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1747
1748         Add a new version of `-_webView:willUpdateDataInteractionOperationToOperation:forSession:` that receives and
1749         returns a UIDropProposal, so that Mail can more easily port over existing logic in its legacy-WebKit-based
1750         compose implementation. iOS Safari is currently the only client of this private delegate, so the old version can
1751         be easily removed once Safari adopts this new version.
1752
1753         * UIProcess/WebPageProxy.cpp:
1754         (WebKit::WebPageProxy::didPerformDragControllerAction):
1755
1756         Add plumbing to send the latest drag handling method from WebPage to WebPageProxy.
1757
1758         (WebKit::WebPageProxy::resetCurrentDragInformation):
1759         * UIProcess/WebPageProxy.h:
1760         (WebKit::WebPageProxy::currentDragHandlingMethod const):
1761         * UIProcess/WebPageProxy.messages.in:
1762         * UIProcess/ios/WKContentViewInteraction.mm:
1763         (-[WKContentView dropInteraction:sessionDidUpdate:]):
1764
1765         Call the new UI delegate hook when determining the drop proposal to return to UIKit. Additionally set the
1766         `precise` bit on the drop proposal in the case where the drop handling method is either "editing rich text" or
1767         "editing plain text".
1768
1769         * WebProcess/WebPage/WebPage.cpp:
1770         (WebKit::WebPage::performDragControllerAction):
1771         * WebProcess/WebPage/WebPage.h:
1772
1773 2018-12-10  Youenn Fablet  <youenn@apple.com>
1774
1775         Make mock capture happen in the process used for real capture
1776         https://bugs.webkit.org/show_bug.cgi?id=192544
1777
1778         Reviewed by Eric Carlson.
1779
1780         Make mock capture happen in the right process by only overriding
1781         factories by mock factories for source types that UserMediaCaptureManager will not override.
1782         That way, UserMediaCaptureManager will be used to go to UIProcess, where mock will be used as if it was the real capture.
1783
1784         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1785         (WebKit::UserMediaCaptureManager::initialize):
1786
1787 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
1788
1789         Move ENABLE_SEC_ITEM_SHIM out of WebKit's config.h
1790         https://bugs.webkit.org/show_bug.cgi?id=192428
1791
1792         Reviewed by Tim Horton.
1793
1794         * config.h:
1795
1796 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
1797
1798         Move more macros out of WebKit's config.h
1799         https://bugs.webkit.org/show_bug.cgi?id=192430
1800
1801         Reviewed by Tim Horton.
1802
1803         * config.h:
1804
1805 2018-12-10  Chris Fleizach  <cfleizach@apple.com>
1806
1807         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
1808         https://bugs.webkit.org/show_bug.cgi?id=192449
1809
1810         Reviewed by Darin Adler.
1811
1812         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
1813         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1814         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1815         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1816         * NetworkProcess/ios/NetworkProcessIOS.mm:
1817         * NetworkProcess/mac/NetworkProcessMac.mm:
1818         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1819         * Platform/spi/ios/AccessibilitySupportSPI.h:
1820         * PlatformMac.cmake:
1821         * PluginProcess/PluginControllerProxy.cpp:
1822         * PluginProcess/PluginProcess.cpp:
1823         * PluginProcess/WebProcessConnection.cpp:
1824         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
1825         * Shared/API/c/cf/WKErrorCF.cpp:
1826         (WKErrorCreateWithCFError):
1827         (WKErrorCopyCFError):
1828         * Shared/API/c/cg/WKImageCG.cpp:
1829         (WKImageCreateCGImage):
1830         (WKImageCreateFromCGImage):
1831         * Shared/ChildProcess.cpp:
1832         * Shared/ContextMenuContextData.cpp:
1833         * Shared/EditorState.cpp:
1834         * Shared/Plugins/NPIdentifierData.cpp:
1835         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
1836         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1837         * Shared/SessionState.cpp:
1838         * Shared/SessionTracker.cpp:
1839         * Shared/ShareableBitmap.cpp:
1840         * Shared/ShareableResource.cpp:
1841         * Shared/VisibleContentRectUpdateInfo.cpp:
1842         * Shared/WebBackForwardListItem.cpp:
1843         * Shared/WebContextMenuItemData.cpp:
1844         * Shared/WebCoreArgumentCoders.cpp:
1845         * Shared/WebHitTestResultData.cpp:
1846         * Shared/WebImage.cpp:
1847         * Shared/WebMediaSessionMetadata.cpp:
1848         * Shared/WebMemorySampler.cpp:
1849         * Shared/WebMouseEvent.cpp:
1850         * Shared/WebRenderObject.cpp:
1851         * Shared/WebSQLiteDatabaseTracker.cpp:
1852         * Shared/WebWheelEvent.cpp:
1853         * Shared/cf/ArgumentCodersCF.cpp:
1854         * Shared/ios/WebPlatformTouchPointIOS.cpp:
1855         * SourcesCocoa.txt:
1856         * UIProcess/API/APIContentRuleListStore.cpp:
1857         * UIProcess/API/APIHitTestResult.cpp:
1858         * UIProcess/API/APINavigation.cpp:
1859         * UIProcess/API/APIOpenPanelParameters.cpp:
1860         * UIProcess/API/APIPageConfiguration.cpp:
1861         * UIProcess/API/C/WKPage.cpp:
1862         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
1863         (WKPageLoadURLWithUserData):
1864         (WKPageLoadURLRequestWithUserData):
1865         (WKPageSetPaginationMode):
1866         (WKPageGetPaginationMode):
1867         (WKPageSetPageLoaderClient):
1868         (WKPageSetPagePolicyClient):
1869         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
1870         * UIProcess/Cocoa/WebViewImpl.h:
1871         * UIProcess/Cocoa/WebViewImpl.mm:
1872         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1873         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
1874         * UIProcess/ios/WKContentView.mm:
1875         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
1876         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
1877         (-[WKContentView dealloc]):
1878         (-[WKContentView page]):
1879         (-[WKContentView updateFixedClippingView:]):
1880         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1881         (-[WKContentView _updateForScreen:]):
1882         (-[WKContentView _accessibilityRegisterUIProcessTokens]):
1883         (-[WKContentView _createDrawingAreaProxy]):
1884         (-[WKContentView _didCommitLayerTree:]):
1885         (-[WKContentView _wk_pageCountForPrintFormatter:]):
1886         * UIProcess/ios/WKContentViewInteraction.mm:
1887         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
1888         (hasAssistedNode):
1889         (-[WKContentView setupInteraction]):
1890         (-[WKContentView positionInformation]):
1891         (-[WKContentView _webTouchEventsRecognized:]):
1892         (inflateQuad):
1893         (-[WKContentView _updateTapHighlight]):
1894         (-[WKContentView _showTapHighlight]):
1895         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
1896         (-[WKContentView _displayFormNodeInputView]):
1897         (-[WKContentView inputView]):
1898         (-[WKContentView _actionForLongPressFromPositionInformation:]):
1899         (-[WKContentView currentPositionInformation]):
1900         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
1901         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
1902         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
1903         (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
1904         (-[WKContentView gestureRecognizerShouldBegin:]):
1905         (-[WKContentView hasSelectablePositionAtPoint:]):
1906         (-[WKContentView pointIsNearMarkedText:]):
1907         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1908         (-[WKContentView webSelectionRectsForSelectionRects:]):
1909         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
1910         (-[WKContentView _stylusSingleTapRecognized:]):
1911         (-[WKContentView _singleTapCommited:]):
1912         (-[WKContentView _attemptClickAtLocation:]):
1913         (-[WKContentView _positionInformationDidChange:]):
1914         (-[WKContentView requiresAccessoryView]):
1915         (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
1916         (-[WKContentView _lookupForWebView:]):
1917         (-[WKContentView _shareForWebView:]):
1918         (-[WKContentView textStylingAtPosition:inDirection:]):
1919         (-[WKContentView canPerformActionForWebView:withSender:]):
1920         (-[WKContentView selectForWebView:]):
1921         (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
1922         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
1923         (toGestureType):
1924         (toUIWKGestureType):
1925         (toSelectionTouch):
1926         (toUIWKSelectionTouch):
1927         (toGestureRecognizerState):
1928         (toUIGestureRecognizerState):
1929         (toUIWKSelectionFlags):
1930         (toWKTextGranularity):
1931         (toWKSelectionDirection):
1932         (selectionChangedWithGesture):
1933         (selectionChangedWithTouch):
1934         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
1935         (-[WKContentView autocorrectionData]):
1936         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
1937         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
1938         (-[WKContentView _updateAccessory]):
1939         (-[WKContentView selectedTextRange]):
1940         (-[WKContentView setMarkedText:selectedRange:]):
1941         (coreWritingDirection):
1942         (-[WKContentView closestPositionToPoint:]):
1943         (-[WKContentView insertText:]):
1944         (-[WKContentView textInputTraits]):
1945         (-[WKContentView handleKeyWebEvent:]):
1946         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
1947         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
1948         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
1949         (-[WKContentView assistedNodeInformation]):
1950         (-[WKContentView assistedNodeSelectOptions]):
1951         (isAssistableInputType):
1952         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1953         (-[WKContentView _stopAssistingNode]):
1954         (-[WKContentView updateCurrentAssistedNodeInformation:]):
1955         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
1956         (-[WKContentView actionNameForFocusedFormControlView:]):
1957         (-[WKContentView selectWordForReplacement]):
1958         (-[WKContentView _updateChangedSelection:]):
1959         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
1960         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
1961         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
1962         (-[WKContentView _showRunOpenPanel:resultListener:]):
1963         (-[WKContentView _showShareSheet:completionHandler:]):
1964         (-[WKContentView positionInformationForActionSheetAssistant:]):
1965         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
1966         (-[WKContentView _startDrag:item:]):
1967         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
1968         (-[WKContentView _didHandleStartDataInteractionRequest:]):
1969         (dropOperationForWebCoreDragOperation):
1970         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
1971         (-[WKContentView _didConcludeEditDataInteraction:]):
1972         (-[WKContentView _didPerformDragOperation:]):
1973         (-[WKContentView _prepareToDragPromisedAttachment:]):
1974         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
1975         (-[WKContentView _autofillContext]):
1976         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
1977         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
1978         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
1979         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
1980         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
1981         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
1982         (-[WKContentView dropInteraction:performDrop:]):
1983         (-[WKContentView dropInteraction:sessionDidEnd:]):
1984         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
1985         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
1986         (-[WKContentView numericInputModeForListViewController:]):
1987         (-[WKContentView textContentTypeForListViewController:]):
1988         (-[WKContentView allowsDictationInputForListViewController:]):
1989         (-[WKContentView _simulateLongPressActionAtLocation:]):
1990         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1991         (-[WKContentView _presentationRectsForPreviewItemController:]):
1992         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1993         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
1994         (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
1995         (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
1996         (-[WKFullScreenViewController videoControlsManagerDidChange]):
1997         (-[WKFullScreenViewController _manager]):
1998         (-[WKFullScreenViewController _togglePiPAction:]):
1999         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2000         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
2001         (-[WKFullScreenWindowController isFullScreen]):
2002         (-[WKFullScreenWindowController enterFullScreen]):
2003         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2004         (-[WKFullScreenWindowController exitFullScreen]):
2005         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2006         (-[WKFullScreenWindowController _completedExitFullScreen]):
2007         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
2008         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
2009         (-[WKFullScreenWindowController _manager]):
2010         * UIProcess/mac/WebPageProxyMac.mm:
2011         * WebKit.xcodeproj/project.pbxproj:
2012         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2013         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2014         (mediaTimeToCurrentTime):
2015         (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
2016         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2017         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
2018
2019 2018-12-10  Tim Horton  <timothy_horton@apple.com>
2020
2021         WKWebView should support custom tintColor
2022         https://bugs.webkit.org/show_bug.cgi?id=192518
2023         <rdar://problem/37243261>
2024
2025         Reviewed by Wenson Hsieh.
2026
2027         * Platform/spi/ios/UIKitSPI.h:
2028         * UIProcess/ios/WKContentViewInteraction.mm:
2029         (-[WKContentView insertionPointColor]):
2030         (-[WKContentView selectionBarColor]):
2031         (-[WKContentView selectionHighlightColor]):
2032         Grab insertion point and selection colors from UITextInputTraits.
2033
2034         (-[WKContentView _updateInteractionTintColor]):
2035         Determine our effective tint color:
2036             - transparent if interaction is disabled
2037             - a CSS-derived color if caret-color style is applied
2038             - the _inheritedInteractionTintColor, which climbs up to the tintColor API
2039         Apply it to our UITextInputTraits.
2040
2041         (-[WKContentView tintColorDidChange]):
2042         (-[WKContentView textInputTraits]):
2043         Call _updateInteractionTintColor whenever we create a new UITextInputTraits
2044         or when the tint color changes.
2045
2046 2018-12-09  Youenn Fablet  <youenn@apple.com>
2047
2048         Move capture manager from RealtimeMediaSourceCenter to capture factory
2049         https://bugs.webkit.org/show_bug.cgi?id=192542
2050
2051         Reviewed by Eric Carlson.
2052
2053         Make sure to unregister for video capture as done for other capture types.
2054         Implement manager which should be doing nothing as the manager is used for enumeration of devices
2055         which should only happen in UIProcess.
2056
2057         Given that mock capture is interfering with UserMediaCaptureManager,
2058         switching on/off mock capture will require creating a new process.
2059         This shortcoming should be fixed once mock capture will be fully happening in
2060         the same process as regular capture.
2061
2062         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2063         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
2064         * WebProcess/cocoa/UserMediaCaptureManager.h:
2065
2066 2018-12-09  Saam barati  <sbarati@apple.com>
2067
2068         Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
2069         https://bugs.webkit.org/show_bug.cgi?id=192374
2070         <rdar://problem/46506286>
2071
2072         Reviewed by Alex Christensen.
2073
2074         This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
2075         To enable on iOS, you can do something like:
2076         $ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
2077         $ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"
2078         
2079         This patch also changes the Proxy to be enabled on a per NSURLSession
2080         basis instead of a per process basis.
2081
2082         * NetworkProcess/NetworkProcess.cpp:
2083         (WebKit::NetworkProcess::initializeNetworkProcess):
2084         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2085         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
2086         (WebKit::NetworkSessionCreationParameters::encode const):
2087         (WebKit::NetworkSessionCreationParameters::decode):
2088         * NetworkProcess/NetworkSessionCreationParameters.h:
2089         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2090         (WebKit::proxyDictionary):
2091         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2092         * NetworkProcess/mac/NetworkProcessMac.mm:
2093         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2094         (WebKit::overrideSystemProxies): Deleted.
2095         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2096         (-[WKWebsiteDataStore _initWithConfiguration:]):
2097         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
2098         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
2099         (-[_WKWebsiteDataStoreConfiguration httpProxy]):
2100         (-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
2101         (-[_WKWebsiteDataStoreConfiguration httpsProxy]):
2102         (-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
2103         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2104         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2105         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2106         (WebKit::WebsiteDataStore::parameters):
2107         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
2108         (WebKit::WebsiteDataStoreConfiguration::copy):
2109         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
2110         (WebKit::WebsiteDataStoreConfiguration::httpProxy const):
2111         (WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
2112         (WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
2113         (WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):
2114
2115 2018-12-09  Adrian Perez de Castro  <aperez@igalia.com>
2116
2117         Build failure due to missing include of APIWebsiteDataStore.h
2118         https://bugs.webkit.org/show_bug.cgi?id=192541
2119
2120         Reviewed by Youenn Fablet.
2121
2122         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Add missing
2123         include of APIWebsiteDataStore.h
2124
2125 2018-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2126
2127         [iOS device] Crash when attempting to call -[_WKAttachment info] for an editable image
2128         https://bugs.webkit.org/show_bug.cgi?id=192538
2129
2130         Reviewed by Tim Horton.
2131
2132         Fix the crash by ensuring that the result of `-renderedDrawing` survives long enough to be wrapped by a
2133         `RetainPtr` in `-PNGRepresentation`. This isn't currently testable, since this codepath isn't supported on the
2134         iOS simulator; instead, I manually verified using MobileAttachments.app.
2135
2136         * UIProcess/ios/WKDrawingView.mm:
2137         (-[WKDrawingView renderedDrawing]):
2138
2139 2018-12-09  Commit Queue  <commit-queue@webkit.org>
2140
2141         Unreviewed, rolling out r239010.
2142         https://bugs.webkit.org/show_bug.cgi?id=192537
2143
2144         Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
2145         scrolling-layers-state.html again (Requested by ap on
2146         #webkit).
2147
2148         Reverted changeset:
2149
2150         "Allow control over child order when adding nodes to the
2151         scrolling tree"
2152         https://bugs.webkit.org/show_bug.cgi?id=176914
2153         https://trac.webkit.org/changeset/239010
2154
2155 2018-12-08  Alex Christensen  <achristensen@webkit.org>
2156
2157         Don't programmatically capitalize safe browsing warning buttons
2158         https://bugs.webkit.org/show_bug.cgi?id=192531
2159         <rdar://problem/46417791>
2160
2161         Reviewed by Darin Adler.
2162
2163         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2164         (makeButton):
2165
2166 2018-12-08  Alex Christensen  <achristensen@webkit.org>
2167
2168         Safe browsing warning should respect text size from settings
2169         https://bugs.webkit.org/show_bug.cgi?id=192205
2170
2171         Reviewed by Tim Horton.
2172
2173         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2174         (fontWithSize):
2175         (makeButton):
2176         (-[WKSafeBrowsingWarning addContent]):
2177         (-[WKSafeBrowsingWarning showDetailsClicked]):
2178
2179 2018-12-08  Frederic Wang  <fwang@igalia.com>
2180
2181         Allow control over child order when adding nodes to the scrolling tree
2182         https://bugs.webkit.org/show_bug.cgi?id=176914
2183         <rdar://problem/46542237>
2184
2185         Reviewed by Simon Fraser.
2186
2187         Based on an earlier patch by Simon Fraser.
2188
2189         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2190         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2191
2192 2018-12-07  Rob Buis  <rbuis@igalia.com>
2193
2194         Remove unused API in NetworkProcess
2195         https://bugs.webkit.org/show_bug.cgi?id=192415
2196
2197         Reviewed by Alex Christensen.
2198
2199         This patch removed some unused API and headers in NetworkProcess.
2200
2201         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2202         (WebKit::NetworkCORSPreflightChecker::startPreflight):
2203         * NetworkProcess/NetworkCORSPreflightChecker.h:
2204         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2205         * NetworkProcess/NetworkConnectionToWebProcess.h:
2206         * NetworkProcess/NetworkContentRuleListManager.h:
2207         * NetworkProcess/NetworkDataTask.cpp:
2208         * NetworkProcess/NetworkDataTask.h:
2209         * NetworkProcess/NetworkDataTaskBlob.cpp:
2210         * NetworkProcess/NetworkLoad.cpp:
2211         * NetworkProcess/NetworkLoad.h:
2212         * NetworkProcess/NetworkLoadChecker.cpp:
2213         * NetworkProcess/NetworkLoadChecker.h:
2214         * NetworkProcess/NetworkLoadClient.h:
2215         * NetworkProcess/NetworkLoadParameters.h:
2216         * NetworkProcess/NetworkProcess.cpp:
2217         * NetworkProcess/NetworkProcess.h:
2218         * NetworkProcess/NetworkProcessCreationParameters.h:
2219         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2220         (WebKit::NetworkResourceLoadParameters::encode const):
2221         (WebKit::NetworkResourceLoadParameters::decode):
2222         * NetworkProcess/NetworkResourceLoadParameters.h:
2223         * NetworkProcess/NetworkResourceLoader.cpp:
2224         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2225         * NetworkProcess/NetworkResourceLoader.h:
2226         * NetworkProcess/NetworkSession.cpp:
2227         * NetworkProcess/NetworkSession.h:
2228         * NetworkProcess/NetworkSocketStream.cpp:
2229         * NetworkProcess/NetworkSocketStream.h:
2230         * NetworkProcess/PingLoad.cpp:
2231         (WebKit::PingLoad::PingLoad):
2232         * NetworkProcess/PingLoad.h:
2233         * NetworkProcess/PreconnectTask.cpp:
2234         (WebKit::PreconnectTask::PreconnectTask):
2235         (WebKit::PreconnectTask::frameID const): Deleted.
2236         (WebKit::PreconnectTask::pageID const): Deleted.
2237         * NetworkProcess/PreconnectTask.h:
2238
2239 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
2240
2241         [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
2242         https://bugs.webkit.org/show_bug.cgi?id=192511
2243         <rdar://problem/46562063>
2244
2245         Reviewed by Youenn Fablet.
2246
2247         * UIProcess/UserMediaPermissionCheckProxy.cpp:
2248         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Remove userMediaID parameter.
2249         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): ID not passed to callback.
2250         * UIProcess/UserMediaPermissionCheckProxy.h:
2251         (WebKit::UserMediaPermissionCheckProxy::create):
2252         (WebKit::UserMediaPermissionCheckProxy::completionHandler): Deleted.
2253
2254         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2255         (WebKit::generateRequestID): New.
2256         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): Don't notify if
2257         the page does not have a granted request and does not have persistent access.
2258         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Use generateRequestID.
2259         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Change variable name.
2260         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Use generateRequestID.
2261         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2262
2263 2018-12-07  Saam Barati  <sbarati@apple.com>
2264
2265         WKWebProcessPlugInLoadDelegate should have API for saying which rendering events it wants to listen for
2266         https://bugs.webkit.org/show_bug.cgi?id=192473
2267
2268         Reviewed by Andy Estes.
2269
2270         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
2271         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2272         (PageLoaderClient::layoutMilestones const):
2273
2274 2018-12-07  Youenn Fablet  <youenn@apple.com>
2275
2276         Update libwebrtc up to 0d007d7c4f
2277         https://bugs.webkit.org/show_bug.cgi?id=192316
2278
2279         Reviewed by Eric Carlson.
2280
2281         Update code base according new libwebrtc backend
2282         In particular, use directly int64_t for packet time.
2283
2284         * Configurations/WebKit.xcconfig:
2285         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
2286         (WebKit::LibWebRTCSocketClient::signalReadPacket):
2287         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
2288         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2289         * NetworkProcess/webrtc/NetworkRTCSocket.h:
2290         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
2291         (WebKit::LibWebRTCSocket::signalReadPacket):
2292
2293 2018-12-07  Truitt Savell  <tsavell@apple.com>
2294
2295         Unreviewed, rolling out r238947.
2296
2297         Revision caused fast/visual-viewport/tiled-drawing/zoomed-
2298         fixed-scrolling-layers-state.html to constantly fail
2299
2300         Reverted changeset:
2301
2302         "Allow control over child order when adding nodes to the
2303         scrolling tree"
2304         https://bugs.webkit.org/show_bug.cgi?id=176914
2305         https://trac.webkit.org/changeset/238947
2306
2307 2018-12-06  David Kilzer  <ddkilzer@apple.com>
2308
2309         Injected bundle for WebKitTestRunner leaks WKTypeRef objects
2310         <https://webkit.org/b/192481>
2311         <rdar://problem/46539059>
2312
2313         Reviewed by Simon Fraser.
2314
2315         Change function parameter name from `returnData[Ref]` to
2316         `returnRetainedData[Ref]` to document that the value returned is
2317         a +1 retained WKTypeRef object.
2318
2319         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2320         (WKBundlePostSynchronousMessage):
2321         * WebProcess/InjectedBundle/API/c/WKBundle.h:
2322         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2323         (WKBundlePagePostSynchronousMessageForTesting):
2324         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2325
2326 2018-12-06  Frederic Wang  <fwang@igalia.com>
2327
2328         Allow control over child order when adding nodes to the scrolling tree
2329         https://bugs.webkit.org/show_bug.cgi?id=176914
2330
2331         Reviewed by Simon Fraser.
2332
2333         Based on an earlier patch by Simon Fraser.
2334
2335         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2336         (WebKit::RemoteScrollingCoordinatorTransaction::decode): Make explicit that we want to append
2337         the new node at the end of child list.
2338
2339 2018-12-06  Yongjun Zhang  <yongjun_zhang@apple.com>
2340
2341         We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag.
2342         https://bugs.webkit.org/show_bug.cgi?id=192377
2343         <rdar://problem/46364206>
2344
2345         Reviewed by Tim Horton.
2346
2347         Since we are using page's viewport arguments to decide the default viewport parameters and
2348         whether we can use mininum effective device width, we should always call setViewportArguments()
2349         regardless of shouldIgnoreMetaViewport settings.
2350
2351         * WebProcess/WebPage/WebPage.cpp:
2352         (WebKit::WebPage::viewportPropertiesDidChange): Always call setViewportArguments().
2353         (WebKit::WebPage::didCommitLoad): Ditto.
2354
2355 2018-12-06  Tim Horton  <timothy_horton@apple.com>
2356
2357         Web Share API: share overlay does not stick to the Safari window
2358         https://bugs.webkit.org/show_bug.cgi?id=192469
2359         <rdar://problem/46074833>
2360
2361         Reviewed by Wenson Hsieh.
2362
2363         * UIProcess/Cocoa/WKShareSheet.mm:
2364         (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
2365         (-[WKShareSheet sharingServicePicker:delegateForSharingService:]):
2366         (-[WKShareSheet sharingService:sourceWindowForShareItems:sharingContentScope:]):
2367         (-[WKShareSheet sharingService:didFailToShareItems:error:]):
2368         (-[WKShareSheet sharingService:didShareItems:]):
2369         Implement another NSSharingServicePickerDelegate method to return
2370         an *NSSharingService* delegate when needed.
2371
2372         Implement an NSSharingServiceDelegate method to return the window that
2373         the service's UI should attach to.
2374
2375         Also, instead of notifying the Web Content process when a service is picked
2376         (or not) in the NSSharingServicePicker, wait until the share has completed
2377         (or failed) to send didComplete. This both makes the return completion
2378         value more accurate (matching iOS, if you cancel the share during the
2379         recipient choice step, it will now fail), and avoids explicitly tearing
2380         down the NSSharingServicePicker too early, which breaks the UI attaching mechanism.
2381
2382 2018-12-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2383
2384         [iOS] WKWebView should match UITextView behavior when editing text with an RTL keyboard
2385         https://bugs.webkit.org/show_bug.cgi?id=187554
2386         <rdar://problem/42075638>
2387
2388         Reviewed by Tim Horton.
2389
2390         Add support for automatically switching the base writing direction to the default writing direction with respect
2391         to the current keyboard in an editable WKWebView by implementing `-setBaseWritingDirection:forRange:`. On iOS 12
2392         and earlier, UIKit invokes this protocol method whenever the keyboard is changed to one with a different writing
2393         direction, although in some other versions of iOS, this only happens when first focusing an editable area.
2394
2395         Test: editing/input/ios/rtl-keyboard-input-on-focus.html
2396
2397         * Platform/spi/ios/UIKitSPI.h:
2398
2399         Declare UIKeyboardImpl IPI methods mostly for use in WebKitTestRunner (with the exception of
2400         `-setInitialDirection`, which we may invoke when we receive the first post-layout EditorState update after
2401         focusing an editable element).
2402
2403         * UIProcess/PageClient.h:
2404         * UIProcess/WebPageProxy.cpp:
2405         (WebKit::WebPageProxy::increaseListLevel):
2406         (WebKit::WebPageProxy::decreaseListLevel):
2407         (WebKit::WebPageProxy::changeListType):
2408         (WebKit::WebPageProxy::setBaseWritingDirection):
2409
2410         Drive-by style fixes: make these bail and return early if `!isValid()`.
2411
2412         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2413
2414         Reset assisted node state in the UI process upon web process termination.
2415
2416         * UIProcess/WebPageProxy.h:
2417
2418         Add plumbing for `setBaseWritingDirection`, from `WebPageProxy` to `WebPage` to `Editor`.
2419
2420         * UIProcess/ios/PageClientImplIOS.h:
2421         * UIProcess/ios/PageClientImplIOS.mm:
2422         (WebKit::PageClientImpl::didReceiveEditorStateUpdateAfterFocus):
2423         * UIProcess/ios/WKContentViewInteraction.h:
2424         * UIProcess/ios/WKContentViewInteraction.mm:
2425         (-[WKContentView baseWritingDirectionForPosition:inDirection:]):
2426         (coreWritingDirection):
2427         (-[WKContentView setBaseWritingDirection:forRange:]):
2428
2429         Support `-setBaseWritingDirectionForPosition:forRange:`, but only in the case where the given range is the
2430         selected range. This is all that's currently needed to fulfill the requirements in <rdar://problem/42075638>,
2431         though we could potentially add full support for this in the future by mapping the given text range to a DOM
2432         range and moving the selection prior to setting the base writing direction.
2433
2434         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
2435
2436         Add a hook to notify WKContentView when the first post-layout EditorState has been received in the UI process.
2437         When this is invoked, if the web view is editable and the selection is not a range, we call into `UIKeyboardImpl`
2438         to change the initial writing direction if necessary.
2439
2440         * UIProcess/ios/WebPageProxyIOS.mm:
2441         (WebKit::WebPageProxy::startAssistingNode):
2442         (WebKit::WebPageProxy::stopAssistingNode):
2443         (WebKit::WebPageProxy::editorStateChanged):
2444         * WebProcess/WebPage/WebPage.cpp:
2445         (WebKit::WebPage::setBaseWritingDirection):
2446         * WebProcess/WebPage/WebPage.h:
2447         * WebProcess/WebPage/WebPage.messages.in:
2448
2449 2018-12-06  David Quesada  <david_quesada@apple.com>
2450
2451         -[WKProcessPool _resumeDownloadFromData:path:] should allow specifying the originating web view
2452         https://bugs.webkit.org/show_bug.cgi?id=192411
2453         rdar://problem/46492487
2454
2455         Reviewed by Alex Christensen.
2456
2457         * UIProcess/API/C/WKContext.cpp:
2458         (WKContextResumeDownload):
2459         * UIProcess/API/Cocoa/WKProcessPool.mm:
2460         (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
2461         (-[WKProcessPool _resumeDownloadFromData:path:]): Deleted.
2462         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2463         * UIProcess/WebProcessPool.cpp:
2464         (WebKit::WebProcessPool::resumeDownload):
2465          - Set the originating page of the DownloadProxy.
2466          - If the originating page is non-null, use its session ID for the download.
2467          - Remove a FIXME. It's possible to do this now by providing the web view whose session
2468            should be used for the download.
2469         * UIProcess/WebProcessPool.h:
2470
2471 2018-12-06  Jiewen Tan  <jiewen_tan@apple.com>
2472
2473         Unreviewed, a quick fix after r238919
2474
2475         Add an early return such that the error message is actually meaningful.
2476
2477         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
2478         (WebKit::MockHidService::platformStartDiscovery):
2479
2480 2018-12-06  Alex Christensen  <achristensen@webkit.org>
2481
2482         Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code
2483         https://bugs.webkit.org/show_bug.cgi?id=192452
2484
2485         Reviewed by Anders Carlsson.
2486
2487         This was introduced in r210835 but never used.
2488         It's preventing me from making the disk cache associated with a SessionID/NetworkSession.
2489
2490         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2491         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache): Deleted.
2492         * NetworkProcess/NetworkConnectionToWebProcess.h:
2493         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2494         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2495         (WebKit::NetworkResourceLoadParameters::encode const):
2496         (WebKit::NetworkResourceLoadParameters::decode):
2497         * NetworkProcess/NetworkResourceLoadParameters.h:
2498         * NetworkProcess/NetworkResourceLoader.cpp:
2499         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
2500         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2501         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse): Deleted.
2502         * NetworkProcess/NetworkResourceLoader.h:
2503         * WebProcess/Network/WebLoaderStrategy.cpp:
2504         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2505         (WebKit::WebLoaderStrategy::storeDerivedDataToCache): Deleted.
2506         * WebProcess/Network/WebLoaderStrategy.h:
2507         * WebProcess/Network/WebResourceLoader.cpp:
2508         (WebKit::WebResourceLoader::didRetrieveDerivedData): Deleted.
2509         * WebProcess/Network/WebResourceLoader.messages.in:
2510
2511 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
2512
2513         REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds
2514         https://bugs.webkit.org/show_bug.cgi?id=191997
2515
2516         Reviewed by Philippe Normand.
2517
2518         Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF.
2519
2520         * Shared/WebEventConversion.cpp:
2521         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING)
2522
2523 2018-12-05  Ryosuke Niwa  <rniwa@webkit.org>
2524
2525         REGRESSION(PSON): Process swapping code doesn't set DisplayID in WebContent process
2526         https://bugs.webkit.org/show_bug.cgi?id=192290
2527
2528         Reviewed by Simon Fraser.
2529
2530         Fixed the bug by updating the DisplayID upon attaching to a WebContent process
2531         after a process swap as well as after the previous WebContent process had crashed.
2532
2533         Unfortunately no new tests since WebKitTestRunner / DumpRenderTree should use 0 as DisplayID
2534         as they have an off-screen NSWindow. The issue that this results in no fallback for
2535         the animation timer is tracked by webkit.org/b/192448.
2536
2537         * UIProcess/Cocoa/WebViewImpl.mm:
2538         (WebKit::WebViewImpl::didRelaunchProcess):
2539
2540 2018-12-05  Youenn Fablet  <youenn@apple.com>
2541
2542         Remove a document entry from NetworkMDNSRegister::m_services when document goes away
2543         https://bugs.webkit.org/show_bug.cgi?id=192429
2544
2545         Reviewed by Eric Carlson.
2546
2547         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
2548         (WebKit::NetworkMDNSRegister::unregisterMDNSNames):
2549         We should remove the entry to limit the size of the map.
2550
2551 2018-12-05  Jiewen Tan  <jiewen_tan@apple.com>
2552
2553         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
2554         https://bugs.webkit.org/show_bug.cgi?id=192061
2555
2556         Reviewed by Dewei Zhu.
2557
2558         Part 1.
2559
2560         Add some loggings to determine possible causes for the flakiness.
2561
2562         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
2563         (WebKit::HidService::continueAddDeviceAfterGetInfo):
2564         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
2565         (WebKit::MockHidService::platformStartDiscovery):
2566
2567 2018-12-05  Chris Dumez  <cdumez@apple.com>
2568
2569         Simplify logic inside WebPageProxy::continueNavigationInNewProcess()
2570         https://bugs.webkit.org/show_bug.cgi?id=192404
2571
2572         Reviewed by Alex Christensen.
2573
2574         Simplify get the item state from the current back/forward list item, instead of
2575         relying on WebBackForwardList::filteredItemStates().
2576
2577         * UIProcess/WebPageProxy.cpp:
2578         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2579
2580 2018-12-05  Youenn Fablet  <youenn@apple.com>
2581
2582         Enable the possibility to do video capture in UIProcess
2583         https://bugs.webkit.org/show_bug.cgi?id=192394
2584
2585         Reviewed by Eric Carlson.
2586
2587         Add two web preferences to toggle audio/video capture in UIProcess or WebProcess.
2588         Add mechanism for video capture that was not implemented yet.
2589
2590         * Shared/WebPreferences.yaml:
2591         * Shared/WebPreferencesDefaultValues.h:
2592         * Shared/WebProcessCreationParameters.cpp:
2593         (WebKit::WebProcessCreationParameters::encode const):
2594         (WebKit::WebProcessCreationParameters::decode):
2595         * Shared/WebProcessCreationParameters.h:
2596         * UIProcess/API/APIProcessPoolConfiguration.h:
2597         * UIProcess/API/C/WKPreferences.cpp:
2598         (WKPreferencesSetCaptureAudioInUIProcessEnabled):
2599         (WKPreferencesGetCaptureAudioInUIProcessEnabled):
2600         (WKPreferencesSetCaptureVideoInUIProcessEnabled):
2601         (WKPreferencesGetCaptureVideoInUIProcessEnabled):
2602         * UIProcess/API/C/WKPreferencesRef.h:
2603         * UIProcess/WebPreferences.cpp:
2604         (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
2605         * UIProcess/WebProcessPool.cpp:
2606         (WebKit::WebProcessPool::initializeNewWebProcess):
2607         (WebKit::WebProcessPool::createWebPage):
2608         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2609         (WebKit::UserMediaCaptureManager::initialize):
2610
2611 2018-12-05  Alex Christensen  <achristensen@webkit.org>
2612
2613         Make WebsiteDataStoreConfiguration a proper API object
2614         https://bugs.webkit.org/show_bug.cgi?id=192380
2615
2616         Reviewed by Youenn Fablet.
2617
2618         In the immediate future I'll need to add things to _WKWebsiteDataStoreConfiguration.
2619         Instead of making ivars, setting them, copying them to a local object, make this a wrapper of an API::Object
2620         like all our other ObjC API objects are.
2621
2622         * Shared/API/APIObject.h:
2623         (API::Object::wrapper const):
2624         (API::Object::wrapper): Deleted.
2625         * Shared/Cocoa/APIObject.mm:
2626         (API::Object::ref const):
2627         (API::Object::deref const):
2628         (API::Object::newObject):
2629         (API::Object::ref): Deleted.
2630         (API::Object::deref): Deleted.
2631         * Sources.txt:
2632         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2633         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
2634         * UIProcess/API/APIProcessPoolConfiguration.h:
2635         * UIProcess/API/APIWebsiteDataStore.cpp:
2636         (API::WebsiteDataStore::createLegacy):
2637         (API::WebsiteDataStore::WebsiteDataStore):
2638         (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
2639         * UIProcess/API/APIWebsiteDataStore.h:
2640         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2641         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2642         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2643         (-[WKWebsiteDataStore _initWithConfiguration:]):
2644         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
2645         (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
2646         (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
2647         (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
2648         (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
2649         (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
2650         (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
2651         (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
2652         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
2653         (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
2654         (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
2655         (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
2656         (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
2657         (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
2658         (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
2659         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
2660         (-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
2661         (-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
2662         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):
2663         (-[_WKWebsiteDataStoreConfiguration _apiObject]):
2664         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h: Added.
2665         * UIProcess/Network/NetworkProcessProxy.cpp:
2666         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
2667         * UIProcess/WebProcessPool.cpp:
2668         (WebKit::legacyWebsiteDataStoreConfiguration):
2669         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
2670         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2671         (WebKit::WebsiteDataStore::parameters):
2672         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2673         (WebKit::WebsiteDataStore::create):
2674         (WebKit::WebsiteDataStore::WebsiteDataStore):
2675         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
2676         (WebKit::WebsiteDataStore::fetchDataAndApply):
2677         (WebKit::WebsiteDataStore::removeData):
2678         (WebKit::WebsiteDataStore::parameters):
2679         (WebKit::WebsiteDataStore::Configuration::Configuration): Deleted.
2680         * UIProcess/WebsiteData/WebsiteDataStore.h:
2681         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
2682         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
2683         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
2684         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
2685         (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
2686         (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
2687         (WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory const):
2688         (WebKit::WebsiteDataStore::resolvedMediaCacheDirectory const):
2689         (WebKit::WebsiteDataStore::resolvedMediaKeysDirectory const):
2690         (WebKit::WebsiteDataStore::resolvedDatabaseDirectory const):
2691         (WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory const):
2692         (WebKit::WebsiteDataStore::resolvedCookieStorageFile const):
2693         (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory const):
2694         (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
2695         (WebKit::WebsiteDataStore::resolvedResourceLoadStatisticsDirectory const):
2696         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Added.
2697         (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
2698         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Added.
2699         (WebKit::WebsiteDataStoreConfiguration::create):
2700         (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota):
2701         (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota):
2702         (WebKit::WebsiteDataStoreConfiguration::applicationCacheDirectory const):
2703         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheDirectory):
2704         (WebKit::WebsiteDataStoreConfiguration::mediaCacheDirectory const):
2705         (WebKit::WebsiteDataStoreConfiguration::setMediaCacheDirectory):
2706         (WebKit::WebsiteDataStoreConfiguration::mediaKeysStorageDirectory const):
2707         (WebKit::WebsiteDataStoreConfiguration::setMediaKeysStorageDirectory):
2708         (WebKit::WebsiteDataStoreConfiguration::javaScriptConfigurationDirectory const):
2709         (WebKit::WebsiteDataStoreConfiguration::setJavaScriptConfigurationDirectory):
2710         (WebKit::WebsiteDataStoreConfiguration::webStorageDirectory const):
2711         (WebKit::WebsiteDataStoreConfiguration::setWebStorageDirectory):
2712         (WebKit::WebsiteDataStoreConfiguration::indexedDBDatabaseDirectory const):
2713         (WebKit::WebsiteDataStoreConfiguration::setIndexedDBDatabaseDirectory):
2714         (WebKit::WebsiteDataStoreConfiguration::webSQLDatabaseDirectory const):
2715         (WebKit::WebsiteDataStoreConfiguration::setWebSQLDatabaseDirectory):
2716         (WebKit::WebsiteDataStoreConfiguration::localStorageDirectory const):
2717         (WebKit::WebsiteDataStoreConfiguration::setLocalStorageDirectory):
2718         (WebKit::WebsiteDataStoreConfiguration::cookieStorageFile const):
2719         (WebKit::WebsiteDataStoreConfiguration::setCookieStorageFile):
2720         (WebKit::WebsiteDataStoreConfiguration::resourceLoadStatisticsDirectory const):
2721         (WebKit::WebsiteDataStoreConfiguration::setResourceLoadStatisticsDirectory):
2722         (WebKit::WebsiteDataStoreConfiguration::networkCacheDirectory const):
2723         (WebKit::WebsiteDataStoreConfiguration::setNetworkCacheDirectory):
2724         (WebKit::WebsiteDataStoreConfiguration::cacheStorageDirectory const):
2725         (WebKit::WebsiteDataStoreConfiguration::setCacheStorageDirectory):
2726         (WebKit::WebsiteDataStoreConfiguration::applicationCacheFlatFileSubdirectoryName const):
2727         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheFlatFileSubdirectoryName):
2728         (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegistrationDirectory const):
2729         (WebKit::WebsiteDataStoreConfiguration::setServiceWorkerRegistrationDirectory):
2730         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationBundleIdentifier const):
2731         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationBundleIdentifier):
2732         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationSecondaryIdentifier const):
2733         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationSecondaryIdentifier):
2734         * WebKit.xcodeproj/project.pbxproj:
2735
2736 2018-12-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2737
2738         Turn WritingDirection into an enum class
2739         https://bugs.webkit.org/show_bug.cgi?id=192401
2740         Work towards <rdar://problem/42075638>
2741
2742         Reviewed by Dan Bernstein.
2743
2744         Change WritingDirection from an enum to an enum class. No change in behavior.
2745
2746         * WebProcess/WebPage/WebFrame.cpp:
2747         (WebKit::WebFrame::setTextDirection):
2748
2749 2018-12-05  Rob Buis  <rbuis@igalia.com>
2750
2751         [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
2752         https://bugs.webkit.org/show_bug.cgi?id=114965
2753
2754         Reviewed by Frédéric Wang.
2755
2756         HEAD requests should not be changed to GET after 303 redirects, see [1].
2757         This was fixed earlier for GTK [2].
2758
2759         Behavior matches Firefox and Chrome.
2760
2761         [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4
2762         [2] https://bugs.webkit.org/show_bug.cgi?id=110127
2763
2764         Tests: web-platform-tests/fetch/api/redirect/redirect-method.html
2765                web-platform-tests/fetch/api/redirect/redirect-method-worker.html
2766                http/tests/xmlhttprequest/head-redirection.html
2767
2768         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2769         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2770
2771 2018-12-04  Fujii Hironori  <Hironori.Fujii@sony.com>
2772
2773         Remove using namespace WebCore and WebKit under WebKit/Shared/API
2774         https://bugs.webkit.org/show_bug.cgi?id=192352
2775
2776         Reviewed by Alex Christensen.
2777
2778         Removed using namespace statements, and use namespace prefix
2779         instead.
2780
2781         * Shared/API/APIURLRequest.cpp:
2782         * Shared/API/APIURLResponse.cpp:
2783         * Shared/API/c/WKArray.cpp:
2784         * Shared/API/c/WKCertificateInfo.cpp:
2785         * Shared/API/c/WKConnectionRef.cpp:
2786         * Shared/API/c/WKContextMenuItem.cpp:
2787         * Shared/API/c/WKData.cpp:
2788         * Shared/API/c/WKDictionary.cpp:
2789         * Shared/API/c/WKErrorRef.cpp:
2790         * Shared/API/c/WKGeometry.cpp:
2791         * Shared/API/c/WKImage.cpp:
2792         * Shared/API/c/WKMutableArray.cpp:
2793         * Shared/API/c/WKMutableDictionary.cpp:
2794         * Shared/API/c/WKNumber.cpp:
2795         * Shared/API/c/WKPluginInformation.cpp:
2796         * Shared/API/c/WKRenderLayer.cpp:
2797         * Shared/API/c/WKRenderObject.cpp:
2798         * Shared/API/c/WKSecurityOriginRef.cpp:
2799         * Shared/API/c/WKSerializedScriptValue.cpp:
2800         * Shared/API/c/WKString.cpp:
2801         * Shared/API/c/WKType.cpp:
2802         * Shared/API/c/WKURL.cpp:
2803         * Shared/API/c/WKURLRequest.cpp:
2804         * Shared/API/c/WKURLResponse.cpp:
2805         * Shared/API/c/WKUserContentURLPattern.cpp:
2806         * Shared/API/c/cairo/WKImageCairo.cpp:
2807         * Shared/API/c/curl/WKCertificateInfoCurl.cpp:
2808
2809 2018-12-04  Alex Christensen  <achristensen@webkit.org>
2810
2811         Remove source application identifiers from NetworkProcessCreationParameters
2812         https://bugs.webkit.org/show_bug.cgi?id=192372
2813
2814         Reviewed by Brady Eidson.
2815
2816         The _WKWebProcessPoolConfiguration way of setting these was deprecated in http://trac.webkit.org/r235127
2817         The replacement was adopted in <rdar://problem/46359330>
2818         The transition process is done!  Time to remove the old code.
2819
2820         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2821         (WebKit::NetworkProcessCreationParameters::encode const):
2822         (WebKit::NetworkProcessCreationParameters::decode):
2823         * NetworkProcess/NetworkProcessCreationParameters.h:
2824         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2825         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2826         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2827         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2828         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2829         (WebKit::globalSourceApplicationAuditTokenData): Deleted.
2830         (WebKit::globalSourceApplicationBundleIdentifier): Deleted.
2831         (WebKit::globalSourceApplicationSecondaryIdentifier): Deleted.
2832         (WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData): Deleted.
2833         (WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier): Deleted.
2834         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier): Deleted.
2835         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2836         (API::ProcessPoolConfiguration::copy):
2837         * UIProcess/API/APIProcessPoolConfiguration.h:
2838         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2839         (-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]):
2840         (-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]):
2841         (-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]):
2842         (-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]):
2843         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2844         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
2845         (WebKit::toPKPaymentRequest):
2846         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2847         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2848         * UIProcess/WebsiteData/WebsiteDataStore.h:
2849         (WebKit::WebsiteDataStore::configuration):
2850
2851 2018-12-04  Youenn Fablet  <youenn@apple.com>
2852
2853         Calling getUserMedia in a link that was opened with target="_blank" does not work the second time
2854         https://bugs.webkit.org/show_bug.cgi?id=188088
2855         <rdar://problem/42681448>
2856
2857         Reviewed by Eric Carlson.
2858
2859         On closing a page, we need to make sure to consider that the capture is ended,
2860         as otherwise WebPageProxy will not get noticed from WebPage, since WebPageProxy is no longer an IPC receiver.
2861
2862         * UIProcess/UserMediaProcessManager.cpp:
2863         (WebKit::UserMediaProcessManager::endedCaptureSession):
2864         * UIProcess/WebPageProxy.cpp:
2865         (WebKit::WebPageProxy::close):
2866
2867 2018-12-04  Chris Dumez  <cdumez@apple.com>
2868
2869         Regression(r238817) PSON Page Cache API tests are failing
2870         https://bugs.webkit.org/show_bug.cgi?id=192348
2871
2872         Reviewed by Alex Christensen.
2873
2874         Before suspending a WebProcess on iOS, we normally fake a memory pressure signal
2875         so that the suspended process uses as little memory as possible while suspended.
2876         Among other things, this will clear the page cache. This is an issue in the case
2877         of process-swap on navigation because we keep suspended web processes around to
2878         keep Page Cache functional.
2879
2880         To address the issue, when a WebProcess is about to get suspended, we check if
2881         the process has any suspended WebPage (WebPage used for PSON PageCache support)
2882         and we bypass the PageCache clearing if it does.
2883
2884         Our API tests did not catch this before r238817 because the NavigationState's
2885         assertion was preventing the old WebProcesses from suspending for 3 seconds,
2886         which was enough for those tests to complete.
2887
2888         * UIProcess/SuspendedPageProxy.cpp:
2889         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
2890         (WebKit::SuspendedPageProxy::didFinishLoad):
2891         * UIProcess/SuspendedPageProxy.h:
2892         Take a background assertion until the suspension load is complete, to make sure
2893         the suspension load has a chance to complete before the process gets suspended.
2894
2895         * WebProcess/WebProcess.cpp:
2896         (WebKit::WebProcess::initializeWebProcess):
2897         (WebKit::WebProcess::hasPageRequiringPageCacheWhileSuspended const):
2898         (WebKit::WebProcess::actualPrepareToSuspend):
2899         * WebProcess/WebProcess.h:
2900
2901 2018-12-04  Youenn Fablet  <youenn@apple.com>
2902
2903         Device orientation may be wrong on page reload after crash
2904         https://bugs.webkit.org/show_bug.cgi?id=192349
2905         <rdar://problem/46359466>
2906
2907         Reviewed by Eric Carlson.
2908
2909         On page crash, the process is relaunched and the page is reloaded.
2910         At that point, the orientation information of the page is not reset until the next device orientation change.
2911         To fix that, add the device orientation to the page creation parameters so that we pass it everytime we create a page.
2912         Covered by manual testing.
2913
2914         * Shared/WebPageCreationParameters.cpp:
2915         (WebKit::WebPageCreationParameters::encode const):
2916         (WebKit::WebPageCreationParameters::decode):
2917         * Shared/WebPageCreationParameters.h:
2918         * UIProcess/WebPageProxy.cpp:
2919         (WebKit::WebPageProxy::creationParameters):
2920         * WebProcess/WebPage/WebPage.cpp:
2921
2922 2018-12-04  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
2923
2924         [WPE] Add gtk-doc
2925         https://bugs.webkit.org/show_bug.cgi?id=178900
2926
2927         Reviewed by Michael Catanzaro.
2928
2929         Add gtk-doc to WPE port. This patch tries to reuse as much code from
2930         WebKitGTK+ as possible.
2931
2932         * PlatformWPE.cmake: Write variables to gtkdoc-wpe.cfg and gtkdoc-webextensions that is used by python script later.
2933         * UIProcess/API/wpe/WebKitWebContext.h: Placed sandbox functions in the same location as in the WebKitGTK+ for consistency.
2934         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added.
2935         * UIProcess/API/wpe/docs/wpe-docs.sgml: Added.
2936         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: Placed webkit_web_page_get_dom_document
2937         in the same position as in the WebKitGTK+ for consistency.
2938         * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt: Added.
2939         * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-docs.sgml: Added.
2940
2941 2018-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2942
2943         [SOUP] Move URLSoup back to WebCore after r238771
2944         https://bugs.webkit.org/show_bug.cgi?id=192306
2945
2946         Reviewed by Michael Catanzaro.
2947
2948         Include GUniquePtrSoup from WebCore again and fix several build failures that showed up after removing the soup
2949         includes from URL header.
2950
2951         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2952         (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate):
2953         * PluginProcess/PluginProcess.cpp:
2954         * Shared/API/glib/WebKitURIRequest.cpp:
2955         * Shared/API/glib/WebKitURIResponse.cpp:
2956         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
2957         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
2958         (webkit_uri_scheme_request_finish_error): Use soupURIToURL().
2959         * UIProcess/API/glib/WebKitWebView.cpp:
2960         (webkit_web_view_load_uri): Use soupURIToURL().
2961         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
2962         * UIProcess/Launcher/glib/BubblewrapLauncher.h:
2963         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
2964         * UIProcess/Launcher/glib/FlatpakLauncher.h:
2965
2966 2018-12-04  Tim Horton  <timothy_horton@apple.com>
2967
2968         Fix the watchOS build; stop unnecessarily linking CorePDF
2969         https://bugs.webkit.org/show_bug.cgi?id=192356
2970         <rdar://problem/46427844>
2971
2972         Reviewed by Wenson Hsieh.
2973
2974         * Configurations/WebKit.xcconfig:
2975         * Platform/spi/ios/CorePDFSPI.h:
2976
2977 2018-12-03  Tim Horton  <timothy_horton@apple.com>
2978
2979         Make it possible to disable animated keyboard scrolling behavior
2980         https://bugs.webkit.org/show_bug.cgi?id=192331
2981         <rdar://problem/45586859>
2982
2983         Reviewed by Simon Fraser.
2984
2985         * UIProcess/API/Cocoa/WKWebView.mm:
2986         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2987         (-[WKKeyboardScrollingAnimator invalidate]):
2988         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
2989         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
2990         (-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
2991         (-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]):
2992         (-[WKKeyboardScrollingAnimator stopRepeatTimer]):
2993         (-[WKKeyboardScrollingAnimator performDiscreteScroll]):
2994         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
2995         (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
2996         * WebKit.xcodeproj/project.pbxproj:
2997
2998 2018-12-03  Fujii Hironori  <Hironori.Fujii@sony.com>
2999
3000         Remove "using namespace WebKit" under Source/WebKit/WebProcess/InjectedBundle/API
3001         https://bugs.webkit.org/show_bug.cgi?id=192301
3002
3003         Reviewed by Alex Christensen.
3004
3005         Removed "using namespace WebKit" statement, and use "WebKit::"
3006         namespace prefix instead.
3007
3008         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3009         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp:
3010         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
3011         * WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp:
3012         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3013         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
3014         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
3015         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
3016         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
3017         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3018         * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp:
3019         * WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp:
3020         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3021         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
3022         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
3023
3024 2018-12-03  Chris Dumez  <cdumez@apple.com>
3025
3026         Regression(PSON) Google OAuth is broken in private sessions
3027         https://bugs.webkit.org/show_bug.cgi?id=192337
3028         <rdar://problem/46353558>
3029
3030         Reviewed by Alex Christensen.
3031
3032         In WebPageProxy::swapToWebProcess(), we would call removeWebPage() on the old WebProcessProxy and then
3033         addExistingWebPage() on the new WebProcessProxy, as you would expect in case of process swap.
3034
3035         The issue is that WebProcessProxy::removeWebPage() calls WebProcessPool::pageEndUsingWebsiteDataStore()
3036         which would cause the session to get destroyed assuming this was the last page using it. We would
3037         therefore lose session cookies after a process-swap in private session.
3038
3039         To address the issue, a parameter to WebProcessPool::pageEndUsingWebsiteDataStore() and
3040         WebProcessPool::pageBeginUsingWebsiteDataStore() to control if we want to tell the WebProcessPool
3041         about the page beginning / ending its use of the session. In the case of a process-swap, we make
3042         sure the process pool is not notified.
3043
3044         * UIProcess/WebPageProxy.cpp:
3045         (WebKit::WebPageProxy::reattachToWebProcess):
3046         (WebKit::WebPageProxy::swapToWebProcess):
3047         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3048         (WebKit::WebPageProxy::close):
3049         * UIProcess/WebProcessProxy.cpp:
3050         (WebKit::WebProcessProxy::createWebPage):
3051         (WebKit::WebProcessProxy::addExistingWebPage):
3052         (WebKit::WebProcessProxy::removeWebPage):
3053         * UIProcess/WebProcessProxy.h:
3054
3055 2018-12-03  Chris Dumez  <cdumez@apple.com>
3056
3057         [PSON] Request by the client to process-swap is ignored if the window has an opener
3058         https://bugs.webkit.org/show_bug.cgi?id=192267
3059         <rdar://problem/46386886>
3060
3061         Reviewed by Brady Eidson.
3062
3063         If the client forces a process-swap, we should process-swap, even if the browsing
3064         context has an opener (or openees). Previously, we would only bypass the cross-site
3065         check, not the openee / openees checks.
3066
3067         The issue when doing so is that the openee still has a opener link to the window
3068         in the old process. They would see that the window is still there and navigated
3069         to 'about:blank' due to our page suspension logic. To address the issue, we no
3070         longer suspend the old WebPage if the process swap was forced by the client and
3071         we make sure that the old WebPage gets closed.
3072
3073         * UIProcess/WebPageProxy.cpp:
3074         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
3075         (WebKit::WebPageProxy::swapToWebProcess):
3076         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3077         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3078         * UIProcess/WebPageProxy.h:
3079         * UIProcess/WebProcessPool.cpp:
3080         (WebKit::WebProcessPool::processForNavigationInternal):
3081
3082 2018-12-03  Keith Rollin  <krollin@apple.com>
3083
3084         Add .xcfilelist files
3085         https://bugs.webkit.org/show_bug.cgi?id=192082
3086         <rdar://problem/46312533>
3087
3088         Reviewed by Brent Fulgham.
3089
3090         Add .xcfilelist files for Generate Derived Sources and Generate
3091         Unified Sources build phases in Xcode. These are just being staged for
3092         now; they'll be added to the Xcode projects later.
3093
3094         * DerivedSources-input.xcfilelist: Added.
3095         * DerivedSources-output.xcfilelist: Added.
3096         * UnifiedSources-input.xcfilelist: Added.
3097         * UnifiedSources-output.xcfilelist: Added.
3098
3099 2018-12-03  Zalan Bujtas  <zalan@apple.com>
3100
3101         [iOS] Unreviewed build fix.
3102
3103         * Platform/Logging.h:
3104
3105 2018-12-03  Alex Christensen  <achristensen@webkit.org>
3106
3107         Remove unused NetworkProcessCreationParameters.diskCacheSizeOverride
3108         https://bugs.webkit.org/show_bug.cgi?id=192246
3109
3110         Reviewed by Chris Dumez.
3111
3112         The last use of this functionality was removed in rdar://problem/46344871
3113
3114         * NetworkProcess/NetworkProcess.cpp:
3115         (WebKit::NetworkProcess::initializeNetworkProcess):
3116         (WebKit::NetworkProcess::setCacheModel):
3117         * NetworkProcess/NetworkProcess.h:
3118         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3119         (WebKit::NetworkProcessCreationParameters::encode const):
3120         (WebKit::NetworkProcessCreationParameters::decode):
3121         * NetworkProcess/NetworkProcessCreationParameters.h:
3122         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3123         (API::ProcessPoolConfiguration::copy):
3124         * UIProcess/API/APIProcessPoolConfiguration.h:
3125         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3126         (WKContextConfigurationDiskCacheSizeOverride):
3127         (WKContextConfigurationSetDiskCacheSizeOverride):
3128         * UIProcess/API/C/WKContextConfigurationRef.h:
3129         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3130         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3131         (-[_WKProcessPoolConfiguration diskCacheSizeOverride]):
3132         (-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]):
3133         * UIProcess/WebProcessPool.cpp:
3134         (WebKit::WebProcessPool::ensureNetworkProcess):
3135
3136 2018-12-03  Alex Christensen  <achristensen@webkit.org>
3137
3138         Add WKWebProcessPlugInLoadDelegate SPI willStartProvisionalLoadForFrame with a completion handler
3139         https://bugs.webkit.org/show_bug.cgi?id=192272
3140
3141         Reviewed by Brady Eidson.
3142
3143         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
3144         (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame):
3145         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
3146         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
3147         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3148         (ResourceLoadClient::ResourceLoadClient):
3149         (ResourceLoadClient::loadDelegate const):
3150         (ResourceLoadClient::pluginContextController const):
3151         (PageLoaderClient::PageLoaderClient):
3152         (PageLoaderClient::loadDelegate const):
3153         (PageLoaderClient::pluginContextController const):
3154         (PageLoaderClient::didStartProvisionalLoadForFrame):
3155         (PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
3156         (PageLoaderClient::didFinishLoadForFrame):
3157         (PageLoaderClient::globalObjectIsAvailableForFrame):
3158         (PageLoaderClient::didRemoveFrameFromHierarchy):
3159         (PageLoaderClient::didCommitLoadForFrame):
3160         (PageLoaderClient::didFinishDocumentLoadForFrame):
3161         (PageLoaderClient::didFailProvisionalLoadWithErrorForFrame):
3162         (PageLoaderClient::didFailLoadWithErrorForFrame):
3163         (PageLoaderClient::didSameDocumentNavigationForFrame):
3164         (PageLoaderClient::didLayoutForFrame):
3165         (PageLoaderClient::didReachLayoutMilestone):
3166         (PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
3167         (PageLoaderClient::didHandleOnloadEventsForFrame):
3168         (PageLoaderClient::userAgentForURL const):
3169         (ResourceLoadClient::willSendRequestForFrame):
3170         (ResourceLoadClient::didInitiateLoadForResource):
3171         (ResourceLoadClient::didFinishLoadForResource):
3172         (ResourceLoadClient::didFailLoadForResource):
3173         (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
3174         (didStartProvisionalLoadForFrame): Deleted.
3175         (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
3176         (didFinishLoadForFrame): Deleted.
3177         (globalObjectIsAvailableForFrame): Deleted.
3178         (didRemoveFrameFromHierarchy): Deleted.
3179         (didCommitLoadForFrame): Deleted.
3180         (didFinishDocumentLoadForFrame): Deleted.
3181         (didFailProvisionalLoadWithErrorForFrame): Deleted.
3182         (didFailLoadWithErrorForFrame): Deleted.
3183         (didSameDocumentNavigationForFrame): Deleted.
3184         (didLayoutForFrame): Deleted.
3185         (didReachLayoutMilestone): Deleted.
3186         (didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
3187         (didHandleOnloadEventsForFrame): Deleted.
3188         (userAgentForURL): Deleted.
3189         (setUpPageLoaderClient): Deleted.
3190         (willSendRequestForFrame): Deleted.
3191         (didInitiateLoadForResource): Deleted.
3192         (didFinishLoadForResource): Deleted.
3193         (didFailLoadForResource): Deleted.
3194         (setUpResourceLoadClient): Deleted.
3195         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3196         (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
3197         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
3198         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3199         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
3200         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3201
3202 2018-12-03  Tim Horton  <timothy_horton@apple.com>
3203
3204         Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
3205         https://bugs.webkit.org/show_bug.cgi?id=192319
3206         <rdar://problem/45928708>
3207
3208         Reviewed by Simon Fraser.
3209
3210         * UIProcess/Cocoa/ViewGestureController.cpp:
3211         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
3212         * UIProcess/Cocoa/ViewGestureController.h:
3213         * UIProcess/ios/ViewGestureControllerIOS.mm:
3214         (WebKit::ViewGestureController::endSwipeGesture):
3215         In r236966, I reverted slightly too much of r232416.
3216         We still need to defer requesting a presentation update callback until
3217         after the provisional load starts. Otherwise, we could get the callback
3218         while we're in the 'paused' state, and drop it on the floor. That would
3219         then mean that we time out instead of promptly removing the snapshot.
3220
3221 2018-12-03  Alex Christensen  <achristensen@webkit.org>
3222
3223         Update process assertions after swapping processes
3224         https://bugs.webkit.org/show_bug.cgi?id=192318
3225         <rdar://problem/46377552>
3226
3227         Reviewed by Chris Dumez.
3228
3229         If the previous WebProcess had a ProcessAssertion to prevent it from being suspended,
3230         after navigation and process swapping we need the new WebProcess to update its process assertions.
3231
3232         * UIProcess/API/Cocoa/PageLoadStateObserver.h:
3233         * UIProcess/Cocoa/NavigationState.h:
3234         * UIProcess/Cocoa/NavigationState.mm:
3235         (WebKit::NavigationState::didSwapWebProcesses):
3236         * UIProcess/PageLoadState.cpp:
3237         (WebKit::PageLoadState::didSwapWebProcesses):
3238         * UIProcess/PageLoadState.h:
3239         * UIProcess/WebPageProxy.cpp:
3240         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3241
3242 2018-12-03  Daniel Bates  <dabates@apple.com>
3243
3244         [iOS] Do not handle key events that are key commands
3245         https://bugs.webkit.org/show_bug.cgi?id=191608
3246         <rdar://problem/46046013>
3247
3248         Reviewed by Ryosuke Niwa.
3249
3250         A key down event may be associated with a key command. If it is then we want to execute the
3251         key command instead of inserting or deleting text. We need to ask UIKit to handle the current
3252         event as a key command to find out.
3253
3254         * UIProcess/ios/WKContentViewInteraction.mm:
3255         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Ask UIKit to handle the current event
3256         as a key command. If it handles it then we're done. Otherwise, do what we do now.
3257
3258 2018-12-03  Zalan Bujtas  <zalan@apple.com>
3259
3260         [iOS] Add logging channel for hover related content observation
3261         https://bugs.webkit.org/show_bug.cgi?id=192312
3262
3263         Reviewed by Simon Fraser.
3264
3265         * WebProcess/WebPage/ios/WebPageIOS.mm:
3266         (WebKit::WebPage::handleSyntheticClick):
3267         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
3268
3269 2018-12-03  Tim Horton  <timothy_horton@apple.com>
3270
3271         Enable swipe snapshot removal logging in release builds
3272         https://bugs.webkit.org/show_bug.cgi?id=192313
3273
3274         Reviewed by Dean Jackson.
3275
3276         * UIProcess/Cocoa/ViewGestureController.cpp:
3277         (WebKit::ViewGestureController::SnapshotRemovalTracker::log const):
3278         This is super-low-traffic and super-helpful logging.
3279         Turn it on all the time.
3280
3281 2018-12-03  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3282
3283         Use WallTime for file time
3284         https://bugs.webkit.org/show_bug.cgi?id=192287
3285
3286         Reviewed by Darin Adler.
3287
3288         * Shared/SessionState.h:
3289         * Shared/WebCoreArgumentCoders.cpp:
3290         (IPC::ArgumentCoder<DatabaseDetails>::decode):
3291         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
3292         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
3293         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
3294         (decodeHTTPBody):
3295         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
3296         (WebKit::PluginInfoCache::getPluginInfo):
3297         (WebKit::PluginInfoCache::updatePluginInfo):
3298         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
3299         (WebKit::hasFileChangedSince):
3300         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
3301         (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
3302         (WebKit::LocalStorageDatabaseTracker::originDetails):
3303         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
3304         * UIProcess/mac/LegacySessionStateCoding.cpp:
3305         (WebKit::encodeFormDataElement):
3306         (WebKit::decodeFormDataElement):
3307         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
3308         (WebKit::removeAllMediaKeyStorageForOriginPath):
3309         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin):
3310         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates):
3311         (WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries):
3312         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
3313         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3314         (WebKit::toHTTPBody):
3315         (WebKit::toFormData):
3316
3317 2018-12-03  Darin Adler  <darin@apple.com>
3318
3319         [Cocoa] Check message IDs when decoding Mach messages in IPC::Connection
3320         https://bugs.webkit.org/show_bug.cgi?id=192300
3321         rdar://problem/46215523
3322
3323         Reviewed by Chris Dumez.
3324
3325         * Platform/IPC/mac/ConnectionMac.mm:
3326         (IPC::Connection::sendOutgoingMessage): Use message IDs other than 0 and 1 for
3327         the messages, as suggested by an expert at Apple.
3328         (IPC::createMessageDecoder): Update for the new message IDs.
3329         (IPC::Connection::receiveSourceEventHandler): Ignore messages with unexpected
3330         message IDs.
3331
3332 2018-12-03  Darin Adler  <darin@apple.com>
3333
3334         [Cocoa] Check descriptor types in createMessageDecoder
3335         https://bugs.webkit.org/show_bug.cgi?id=192302
3336
3337         Reviewed by Chris Dumez.
3338
3339         Not sure how to construct a test case for Connection, so not adding any
3340         tests at this time.
3341
3342         * Platform/IPC/mac/ConnectionMac.mm:
3343         (IPC::createMessageDecoder): Check descriptor types and return nullptr if they
3344         are incorrect. Retained the assertions to help with debugging.
3345         (IPC::Connection::receiveSourceEventHandler): Ignore the message if no decoder
3346         is created, which means the message is invalid.
3347
3348 2018-12-03  Darin Adler  <darin@apple.com>
3349
3350         Alignment padding needs to be zeroed out in IPC::Encoder
3351         https://bugs.webkit.org/show_bug.cgi?id=192304
3352
3353         Reviewed by Chris Dumez.
3354
3355         Might be useful to make a regression test for this, but I couldn't find any
3356         other tests for this code.
3357
3358         * Platform/IPC/Encoder.cpp:
3359         (IPC::Encoder::grow): Use std::memset to zero-fill padding bytes.
3360
3361         * UIProcess/mac/LegacySessionStateCoding.cpp:
3362         (WebKit::HistoryEntryDataEncoder::grow): Ditto.
3363
3364 2018-12-03  Darin Adler  <darin@apple.com>
3365
3366         [Cocoa] Streamline sandbox code a tiny bit
3367         https://bugs.webkit.org/show_bug.cgi?id=192299
3368
3369         Reviewed by Anders Carlsson.
3370
3371         * Shared/mac/SandboxUtilities.mm:
3372         (WebKit::processHasContainer): Removed separate function, just use the
3373         pathForProcessContainer instead of repeating logic. This costs a tiny
3374         bit of memory allocation overhead the first time this function is called,
3375         but in return we can eliminate a second copy of the code to call
3376         sandbox_container_path_for_pid.
3377
3378 2018-12-03  Eric Carlson  <eric.carlson@apple.com>
3379
3380         [MediaStream] 'devicechange' event when more capture device information are revealed.
3381         https://bugs.webkit.org/show_bug.cgi?id=192268
3382
3383         Reviewed by Youenn Fablet.
3384
3385         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3386         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Call captureDevicesChanged
3387         if a filtered device list was returned previously.
3388         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): Clear m_hasFilteredDeviceList.
3389         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess): New.
3390         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Filter device
3391         list and strip device IDs if gUM permission hasn't been given.
3392         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear m_hasFilteredDeviceList.
3393         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3394
3395 2018-12-03  Keith Rollin  <krollin@apple.com>
3396
3397         Remove Network Capture
3398         https://bugs.webkit.org/show_bug.cgi?id=192296
3399         <rdar://problem/46408648>
3400
3401         Reviewed by Daniel Bates.
3402
3403         r209498 introduced an embedded record and replay facility for network
3404         resource loading. This facility was added in order to support a new
3405         implementation of the PLT and related performance tests. The PLT is
3406         currenty taking a different direction, and so this record/replace
3407         facility is no longer needed. Removing it as unused code.
3408
3409         * CMakeLists.txt:
3410         * NetworkProcess/NetworkLoad.cpp:
3411         (WebKit::NetworkLoad::NetworkLoad):
3412         (WebKit::NetworkLoad::setDefersLoading):
3413         (WebKit::NetworkLoad::continueWillSendRequest):
3414         (WebKit::NetworkLoad::willPerformHTTPRedirection):
3415         (WebKit::NetworkLoad::notifyDidReceiveResponse):
3416         (WebKit::NetworkLoad::didReceiveData):
3417         (WebKit::NetworkLoad::didCompleteWithError):
3418         (WebKit::NetworkLoad::initializeForRecord): Deleted.
3419         (WebKit::NetworkLoad::initializeForReplay): Deleted.
3420         * NetworkProcess/NetworkLoad.h:
3421         * NetworkProcess/NetworkProcess.cpp:
3422         (WebKit::NetworkProcess::initializeNetworkProcess):
3423         (WebKit::NetworkProcess::terminate):
3424         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3425         (WebKit::NetworkProcessCreationParameters::encode const):
3426         (WebKit::NetworkProcessCreationParameters::decode):
3427         * NetworkProcess/NetworkProcessCreationParameters.h:
3428         * NetworkProcess/capture/NetworkCaptureEvent.cpp: Removed.
3429         * NetworkProcess/capture/NetworkCaptureEvent.h: Removed.
3430         * NetworkProcess/capture/NetworkCaptureLogging.h: Removed.
3431         * NetworkProcess/capture/NetworkCaptureManager.cpp: Removed.
3432         * NetworkProcess/capture/NetworkCaptureManager.h: Removed.
3433         * NetworkProcess/capture/NetworkCaptureRecorder.cpp: Removed.
3434         * NetworkProcess/capture/NetworkCaptureRecorder.h: Removed.
3435         * NetworkProcess/capture/NetworkCaptureReplayer.cpp: Removed.
3436         * NetworkProcess/capture/NetworkCaptureReplayer.h: Removed.
3437         * NetworkProcess/capture/NetworkCaptureResource.cpp: Removed.
3438         * NetworkProcess/capture/NetworkCaptureResource.h: Removed.