Add telemetry to track storage access API adoption
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
2
3         Add telemetry to track storage access API adoption
4         https://bugs.webkit.org/show_bug.cgi?id=182197
5         <rdar://problem/35803309>
6
7         Reviewed by Chris Dumez.
8
9         Part 2: Add telemetry for the Storage Access API case
10
11         This change increments a counter when an origin is loaded in a first part context because
12         it was granted Storage Access API permissions.
13
14         * NetworkProcess/NetworkResourceLoader.cpp:
15         (WebKit::NetworkResourceLoader::logCookieInformation const): Add logging to indicate
16         loads that happened with the Storage Access API enabled.
17         * UIProcess/WebResourceLoadStatisticsStore.cpp:
18         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Increment counter for
19         loads using the new API.
20
21 2018-01-30  Megan Gardner  <megan_gardner@apple.com>
22
23         Make preserve and restore focus more likely to be symmetrical
24         https://bugs.webkit.org/show_bug.cgi?id=182264
25         <rdar://problem/36948473>
26         
27         Reviewed by Tim Horton.
28
29         Keep a stack of if we actually increment the focusState, so that
30         changes to the web content do not result in asymmetric decrements to the focus state. 
31         To work around problems associated with <rdar://problem/37000122>.
32
33         * UIProcess/ios/WKContentViewInteraction.h:
34         * UIProcess/ios/WKContentViewInteraction.mm:
35         (-[WKContentView _restoreFocusWithToken:]):
36         (-[WKContentView _preserveFocusWithToken:destructively:]):
37
38 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
39
40         Add telemetry to track storage access API adoption
41         https://bugs.webkit.org/show_bug.cgi?id=182197
42         <rdar://problem/35803309>
43
44         Reviewed by Chris Dumez.
45         
46         This patch also handled aggregating the counts in the UIProcess, which has access to
47         the right data.
48
49         The original patch assumed the WebContent process kept track of user interaction. This is
50         only tracked in the UIProcess, so we can get rid of some of the logging code adding in
51         r227755.
52
53         * Shared/WebProcessCreationParameters.cpp:
54         (WebKit::WebProcessCreationParameters::encode const): Rollout of r227755 changes not
55         needed to track the statistics.
56         (WebKit::WebProcessCreationParameters::decode): Ditto.
57         * Shared/WebProcessCreationParameters.h:
58         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
59         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
60         * UIProcess/WebResourceLoadStatisticsStore.cpp:
61         (WebKit::WebResourceLoadStatisticsStore::wasAccessedAsFirstPartyDueToUserInteraction): Moved from
62         the WebContent process, which does not keep track of user interaction.
63         (WebKit::WebResourceLoadStatisticsStore::mergeStatistics): Aggregate counts while processing
64         the statistics.
65         * UIProcess/WebResourceLoadStatisticsStore.h:
66         * WebProcess/WebProcess.cpp:
67         (WebKit::WebProcess::initializeWebProcess):
68
69 2018-01-30  Chris Dumez  <cdumez@apple.com>
70
71         Make sure we never create a WebSWClientConnection with an invalid sessionID
72         https://bugs.webkit.org/show_bug.cgi?id=182276
73         <rdar://problem/36582633>
74
75         Reviewed by Alex Christensen.
76
77         Make sure we never create a WebSWClientConnection with an invalid sessionID as this
78         could corrupt our hash tables.
79
80         * StorageProcess/StorageProcess.cpp:
81         (WebKit::StorageProcess::swServerForSession):
82         * UIProcess/WebProcessPool.cpp:
83         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
84         * WebProcess/Storage/WebSWClientConnection.cpp:
85         (WebKit::WebSWClientConnection::WebSWClientConnection):
86         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
87         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
88         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
89         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
90         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
91
92 2018-01-30  Basuke Suzuki  <Basuke.Suzuki@sony.com>
93
94         [WinCairo] Fix forwarding header conflict of WebKit on WinCairo
95         https://bugs.webkit.org/show_bug.cgi?id=177202
96
97         Reviewed by Alex Christensen.
98
99         * PlatformWin.cmake:
100
101 2018-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
102
103         WebDriver: evaluateJavaScriptFunction should return null when return value is undefined
104         https://bugs.webkit.org/show_bug.cgi?id=180350
105
106         Reviewed by Carlos Alberto Lopez Perez.
107
108         undefined can't be converted to JSON string, in which case JSON.stringify() returns undefined and we handle that
109         case to return an empty string. We currently handle this case for execute script commands, but not in all other
110         cases where we use evaluateJavaScriptFunction. It would be simpler if evaluateJavaScriptFunction returned null,
111         because in that case we wouldn't need to handle it as a special case.
112
113         15.2 Executing Script
114         https://w3c.github.io/webdriver/webdriver-spec.html#dfn-json-clone
115
116         Fixes: imported/w3c/webdriver/tests/state/get_element_property.py::test_element_non_existent
117
118         * WebProcess/Automation/WebAutomationSessionProxy.js:
119         (let.AutomationSessionProxy.prototype._jsonStringify): Return "null" instead of "" when undefined is given.
120
121 2018-01-29  Ryosuke Niwa  <rniwa@webkit.org>
122
123         Release assert in updateLayout while waiting for sync reply to WebPageProxy::HasInsecureContent
124         https://bugs.webkit.org/show_bug.cgi?id=182273
125
126         Reviewed by Chris Dumez.
127
128         The assertion was caused by unrelated sync IPCs being processed while WebContent process is waiting for
129         the reply to WebPageProxy::HasInsecureContent. Since this IPC can be used while creating CachedFrame,
130         it's not safe to execute arbitrary code.
131
132         Fixed the bug by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply added in r227566.
133
134         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
135         (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
136
137 2018-01-29  Wenson Hsieh  <wenson_hsieh@apple.com>
138
139         Add a build step to copy resources from WebKitAdditions as bundle resources in WebKit
140         https://bugs.webkit.org/show_bug.cgi?id=182268
141         <rdar://problem/37003784>
142
143         Reviewed by Tim Horton and Dan Bernstein.
144
145         Adds a "Copy Additional Resources" phase when building WebKit. This phase copies resources from
146         usr/local/include/WebKitAdditions/WebKit/AdditionalResources in the build directory into the
147         unlocalized resources directory. If the AdditionalResources directory does not exist in the build
148         directory, we fall back to searching the SDK.
149
150         * WebKit.xcodeproj/project.pbxproj:
151
152 2018-01-29  Youenn Fablet  <youenn@apple.com>
153
154         ServiceWorkerClientFetch should not consider responses without Location headers as redirection responses
155         https://bugs.webkit.org/show_bug.cgi?id=182134
156
157         Reviewed by Chris Dumez.
158
159         As per fetch spec, a response with a redirection status code but no Location header should not be considered as a redirection.
160         This is also consistent with SubresourceLoader::didReceiveResponse.
161
162         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
163         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
164
165 2018-01-29  Youenn Fablet  <youenn@apple.com>
166
167         Cache API should make sure to resolve caches.open promises in the same order as called
168         https://bugs.webkit.org/show_bug.cgi?id=182193
169         <rdar://problem/36930363>
170
171         Reviewed by Chris Dumez.
172
173         Covered by added test.
174         Whenever opening/removing a cache requires writing to disk, wait to finish the task
175         until any disk writing task is done.
176         Applying this strategy when clearing data so that we also clear data that is pending to be written.
177         For removing cache, we now return whether a cache was actually deleted by returning zero as removed cache identifier.
178         WebCore uses that information to return true/false as promise resolution value.
179
180         * NetworkProcess/cache/CacheStorageEngine.cpp:
181         (WebKit::CacheStorage::Engine::retrieveCaches):
182         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
183         (WebKit::CacheStorage::Caches::clear):
184         (WebKit::CacheStorage::Caches::open):
185         (WebKit::CacheStorage::Caches::remove):
186         (WebKit::CacheStorage::Caches::writeCachesToDisk):
187         (WebKit::CacheStorage::Caches::cacheInfos):
188         (WebKit::CacheStorage::Caches::cacheInfos const): Deleted.
189         * NetworkProcess/cache/CacheStorageEngineCaches.h:
190         (WebKit::CacheStorage::Caches::createWeakPtr):
191
192 2018-01-29  Alex Christensen  <achristensen@webkit.org>
193
194         Clean up API after bugs 178240 and 176474
195         https://bugs.webkit.org/show_bug.cgi?id=182259
196
197         Reviewed by Dan Bernstein.
198
199         NS_OPTIONS should be NSUInteger, not NSInteger.  This is how all other NS_OPTIONS in WebKit are,
200         and it's necessary if we get really big numbers as options.  Changing them won't cause binary
201         incompatibility unless someone does signed integer comparison with currently invalid values.
202
203         Added availability macros I forgot to add earlier.
204
205         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
206         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
207
208 2018-01-29  Jiewen Tan  <jiewen_tan@apple.com>
209
210         [WebAuthN] Add a compile-time feature flag
211         https://bugs.webkit.org/show_bug.cgi?id=182211
212         <rdar://problem/36936365>
213
214         Reviewed by Brent Fulgham.
215
216         * Configurations/FeatureDefines.xcconfig:
217
218 2018-01-29  John Wilander  <wilander@apple.com>
219
220         Resource Load Statistics: Introduce debug mode as experimental feature
221         https://bugs.webkit.org/show_bug.cgi?id=182199
222         <rdar://problem/36930364>
223
224         Reviewed by Alex Christensen.
225
226         The only changes to default behavior are:
227         - Increased resolution on timestamps which is needed to be able to set shorter
228           timeouts in debug mode.
229         - Only update partitioning and blocking table when needed. This is an optimization
230           which pays off in less XPC with shorter timeouts.
231
232         * Shared/WebPreferences.yaml:
233         * UIProcess/API/APIWebsiteDataStore.cpp:
234         (API::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
235         (API::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
236         * UIProcess/API/APIWebsiteDataStore.h:
237         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
238         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugMode):
239         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
240         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
241         (-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
242         (-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
243         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
244         * UIProcess/WebResourceLoadStatisticsStore.cpp:
245         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
246         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
247         * UIProcess/WebResourceLoadStatisticsStore.h:
248         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
249         (WebKit::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
250         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
251         * UIProcess/WebsiteData/WebsiteDataStore.h:
252
253 2018-01-29  Andy Estes  <aestes@apple.com>
254
255         [iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
256         https://bugs.webkit.org/show_bug.cgi?id=182252
257         <rdar://problem/21555881>
258
259         Reviewed by Tim Horton.
260
261         * WebProcess/WebPage/WebPage.cpp:
262         (WebKit::WebPage::dispatchTouchEvent):
263         (WebKit::WebPage::updatePotentialTapSecurityOrigin):
264
265         Record the target frame origin of touch events that are potential taps, are
266         TouchStart events, are targeted in frames that have touch event listeners, and are not
267         handled by those listeners.
268
269         * WebProcess/WebPage/WebPage.h:
270         * WebProcess/WebPage/ios/WebPageIOS.mm:
271         (WebKit::WebPage::potentialTapAtPosition):
272         (WebKit::WebPage::commitPotentialTap):
273         (WebKit::WebPage::cancelPotentialTapInFrame):
274
275         Passed the target frame origin to Frame::nodeRespondingToClickEvents() then cleared it.
276
277 2018-01-29  Alex Christensen  <achristensen@webkit.org>
278
279         Make policy checks more robust against null pointer dereferencing
280         https://bugs.webkit.org/show_bug.cgi?id=182263
281         <rdar://problem/34895714>
282
283         Reviewed by Tim Horton.
284
285         We're still dereferencing null.  Check everything.
286
287         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
288         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
289
290 2018-01-29  Brent Fulgham  <bfulgham@apple.com>
291
292         Add telemetry to track storage access API adoption
293         https://bugs.webkit.org/show_bug.cgi?id=182197
294         <rdar://problem/35803309>
295
296         Reviewed by Chris Dumez.
297
298         Part 1: Add telemetry for the user interaction case
299         
300         This patch adds telemetry to track how frequently third-party cookies are
301         used in a first party context due to user interaction. This will help
302         understand cases where the new Storage Access API can help, and to help
303         us understand if we have considered relevant use cases in its design.
304
305         * Shared/WebProcessCreationParameters.cpp:
306         (WebKit::WebProcessCreationParameters::encode const):
307         (WebKit::WebProcessCreationParameters::decode):
308         * Shared/WebProcessCreationParameters.h:
309         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
310         (WebKit::WebProcessPool::platformInitializeWebProcess):
311         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
312         (WebKit::sortedPrevalentResourceTelemetry): Update for new telemetry.
313         (WebKit::submitTopList): Update for new data types.
314         * WebProcess/WebProcess.cpp:
315         (WebKit::WebProcess::initializeWebProcess): Handle the partitioning time
316         passed from the UIProcess.
317
318 2018-01-29  Alex Christensen  <achristensen@webkit.org>
319
320         Fix crash when during canAuthenticateAgainstProtectionSpace
321         https://bugs.webkit.org/show_bug.cgi?id=182260
322         <rdar://problem/34911343>
323
324         Reviewed by Chris Dumez.
325
326         If we have a valid network load with no challenge completion handler and we are
327         telling it to continue with the challenge handling, something has gone wrong.
328         Maybe we've just recovered from a crashed network process.  If this happens, do nothing.
329
330         * NetworkProcess/NetworkLoad.cpp:
331         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
332
333 2018-01-29  Zach Li  <zacharyli323@gmail.com>
334
335         Warning in 32-bit WebKit build when trying to link to SafariSafeBrowsing
336         https://bugs.webkit.org/show_bug.cgi?id=182251
337         rdar://problem/36964995
338
339         Reviewed by Alex Christensen.
340
341         * Configurations/WebKit.xcconfig:
342         Only link against SafariSafeBrowsing framework in 64-bit architecture.
343
344         * Platform/spi/Cocoa/SafeBrowsingSPI.h:
345         Guard the Safe Browsing code with WK_API_ENABLED.
346
347 2018-01-29  Chris Dumez  <cdumez@apple.com>
348
349         Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC
350         https://bugs.webkit.org/show_bug.cgi?id=182256
351         <rdar://problem/36689233>
352
353         Reviewed by Simon Fraser.
354
355         Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC as
356         this can lead to crashes such as the one in <rdar://problem/36689233>.
357
358         * WebProcess/Storage/WebSWClientConnection.cpp:
359         (WebKit::WebSWClientConnection::WebSWClientConnection):
360
361 2018-01-29  Jan-Michael Brummer  <jan.brummer@tabos.org>
362
363         [GTK] Zooming gesture incorrectly uses scale instead of zoom 
364         https://bugs.webkit.org/show_bug.cgi?id=182174
365
366         Reviewed by Michael Catanzaro.
367
368         Switch zooming gesture to use zoom instead of scale function.
369
370         * UIProcess/gtk/GestureController.cpp:
371         (WebKit::GestureController::ZoomGesture::begin):
372         (WebKit::GestureController::ZoomGesture::handleZoom):
373
374 2018-01-29  Brady Eidson  <beidson@apple.com>
375
376         Make it possible for apps that use both WK1 and WK2 to use MessagePorts.
377         https://bugs.webkit.org/show_bug.cgi?id=182229
378
379         Reviewed by Chris Dumez.
380
381         * UIProcess/UIMessagePortChannelProvider.cpp:
382         (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):
383
384         * UIProcess/WebPageProxy.cpp:
385         (WebKit::m_configurationPreferenceValues): The UI process does not need to override the 
386           global singleton provider. It can remain the default ProviderImpl to allow WK1 views 
387           to work fine, too.
388
389 2018-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
390
391         WebDriver: ASSERTION FAILED: !m_loadTimer.isActive()
392         https://bugs.webkit.org/show_bug.cgi?id=182237
393
394         Reviewed by Carlos Alberto Lopez Perez.
395
396         We should stop the load timer when we dispatch the pending navigation callbacks due to an alert open.
397
398         * UIProcess/Automation/WebAutomationSession.cpp:
399         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
400
401 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
402
403         [Cairo] Add GraphicsContextImplCairo::createFactory() helpers
404         https://bugs.webkit.org/show_bug.cgi?id=182238
405
406         Reviewed by Carlos Garcia Campos.
407
408         Use GraphicsContextImplCairo::createFactory() helpers throughout the
409         Cairo-specific GraphicsContext constructors in the WebKit layer.
410
411         * Shared/cairo/ShareableBitmapCairo.cpp:
412         (WebKit::ShareableBitmap::createGraphicsContext):
413         * UIProcess/cairo/BackingStoreCairo.cpp:
414         (WebKit::BackingStore::incorporateUpdate):
415         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
416         (WebKit::WebPrintOperationGtk::renderPage):
417
418 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
419
420         [Cairo] Remove the GraphicsContext(cairo_t*) constructor
421         https://bugs.webkit.org/show_bug.cgi?id=182234
422
423         Reviewed by Carlos Garcia Campos.
424
425         Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to
426         instead provide a factory function that returns a fresh
427         GraphicsContextImplCairo object, passing that cairo_t object to its
428         constructor.
429
430         * Shared/cairo/ShareableBitmapCairo.cpp:
431         (WebKit::ShareableBitmap::createGraphicsContext):
432         * UIProcess/cairo/BackingStoreCairo.cpp:
433         (WebKit::BackingStore::incorporateUpdate):
434         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
435         (WebKit::WebPrintOperationGtk::renderPage):
436
437 2018-01-26  Megan Gardner  <megan_gardner@apple.com>
438
439         Don't retain focus for input peripheral views
440         https://bugs.webkit.org/show_bug.cgi?id=182204
441
442         Reviewed by Tim Horton.
443
444         Retaining focus on input peripheral views makes it so they cannot dismiss themselves with
445         the current architecture. This should probably be fixed in UIKit, as there is no reason for
446         focus to be retained on these views anyways, as they don't have keyboard input, but this
447         guards against over-aggressive retain requests.
448
449         * UIProcess/ios/WKContentViewInteraction.mm:
450         (-[WKContentView _restoreFocusWithToken:]):
451         (-[WKContentView _preserveFocusWithToken:destructively:]):
452
453 2018-01-26  Chris Dumez  <cdumez@apple.com>
454
455         Make sure service worker code does not launch a StorageProcess unnecessarily
456         https://bugs.webkit.org/show_bug.cgi?id=182192
457         <rdar://problem/36927427>
458
459         Reviewed by Geoffrey Garen.
460
461         When calling WebProcess::existingWebToStorageProcessConnection(), make sure we do not
462         force the creation of a WebProcess connection to the StorageProcess. If there is
463         no WebProcess, just return false right away.
464
465         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
466         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
467         * WebProcess/WebProcess.h:
468
469 2018-01-26  Alex Christensen  <achristensen@webkit.org>
470
471         Allow cellular access for default-created ephemeral sessions
472         https://bugs.webkit.org/show_bug.cgi?id=182179
473         <rdar://problem/36572023>
474
475         Reviewed by Andy Estes.
476
477         This makes it so when we recover from a NetworkProcess crash (see r227590) on iOS, we will
478         be able to continue browsing using cell data.
479
480         * Shared/WebsiteDataStoreParameters.cpp:
481         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
482         * UIProcess/WebProcessPool.cpp:
483         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
484         * WebProcess/InjectedBundle/InjectedBundle.cpp:
485         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
486
487 2018-01-26  Alex Christensen  <achristensen@webkit.org>
488
489         Clean up more networking code
490         https://bugs.webkit.org/show_bug.cgi?id=182161
491
492         Reviewed by Anders Carlsson.
493
494         Two cleanups:
495         1. The WebProcess doesn't need to initialize NetworkSessions.
496         2. WebFrameNetworkingContext doesn't need to have the NetworkingContext functions to support ResourceHandles in WebKit any more.
497
498         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
499         * NetworkProcess/NetworkLoad.h:
500         * NetworkProcess/RemoteNetworkingContext.h:
501         (): Deleted.
502         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
503         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
504         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
505         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
506         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
507         * NetworkProcess/mac/RemoteNetworkingContext.mm:
508         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
509         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
510         (WebKit::RemoteNetworkingContext::localFileContentSniffingEnabled const): Deleted.
511         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
512         (WebKit::RemoteNetworkingContext::sourceApplicationAuditData const): Deleted.
513         (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier const): Deleted.
514         (WebKit::RemoteNetworkingContext::blockedError const): Deleted.
515         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
516         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
517         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
518         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
519         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
520         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
521         * WebProcess/WebProcess.cpp:
522         (WebKit::WebProcess::initializeWebProcess):
523         (WebKit::WebProcess::clearCachedCredentials):
524
525 2018-01-26  Jan-Michael Brummer  <jan.brummer@tabos.org>
526
527         [GTK] Support using long-tap gesture to open context menu
528         https://bugs.webkit.org/show_bug.cgi?id=140747
529
530         Reviewed by Carlos Garcia Campos.
531
532         Add long press gesture which simulates a secondary mouse press to open context menu.
533
534         * UIProcess/gtk/GestureController.cpp:
535         (WebKit::GestureController::GestureController):
536         (WebKit::GestureController::handleEvent):
537         (WebKit::GestureController::isProcessingGestures const):
538         (WebKit::GestureController::Gesture::simulateMousePress):
539         (WebKit::GestureController::DragGesture::handleTap):
540         (WebKit::GestureController::LongPressGesture::longPressed):
541         (WebKit::GestureController::LongPressGesture::pressed):
542         (WebKit::GestureController::LongPressGesture::LongPressGesture):
543         * UIProcess/gtk/GestureController.h:
544         (WebKit::GestureController::reset):
545
546 2018-01-26  Carlos Garcia Campos  <cgarcia@igalia.com>
547
548         Unreviewed. REGRESSION(r227647): window.open() is broken in GTK and WPE after r227647.
549
550         In r227647, API::UIClient::createNewPage() was changed to use CompletionHandler instead of Function. All
551         implementations were updated expect the GLib one, and we didn't notice it because the method doesn't have the
552         final/override mark.
553
554         * UIProcess/API/glib/WebKitUIClient.cpp:
555         (UIClient::createNewPage):
556
557 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
558
559         [WebVR] Make WebVR available by default for developer builds
560         https://bugs.webkit.org/show_bug.cgi?id=182101
561
562         Reviewed by Michael Catanzaro.
563
564         Moved WebVR setting to the experimental features section and make it
565         available by default for developer builds for GTK and WPE.
566
567         * Shared/WebPreferences.yaml:
568
569 2018-01-25  Alex Christensen  <achristensen@webkit.org>
570
571         REGRESSION (r221899): Web Content process hangs when webpage tries to make a new window if the WKWebView doesn’t have a UI delegate
572         https://bugs.webkit.org/show_bug.cgi?id=182152
573
574         Reviewed by Joseph Pecoraro.
575
576         Call the completion handler of the default API::UIClient::createNewPage.
577
578         * UIProcess/API/APIUIClient.h:
579         (API::UIClient::createNewPage):
580         * UIProcess/API/C/WKPage.cpp:
581         (WKPageSetPageUIClient):
582         * UIProcess/Cocoa/UIDelegate.h:
583         * UIProcess/Cocoa/UIDelegate.mm:
584         (WebKit::UIDelegate::UIClient::createNewPage):
585
586 2018-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
587
588         [iOS] [WK2] Introduce new views and view controllers to support extra-zoomed text form controls
589         https://bugs.webkit.org/show_bug.cgi?id=182000
590         <rdar://problem/35143035>
591
592         Reviewed by Tim Horton.
593
594         Add new files to support text form control editing while extra-zoomed.
595
596         * UIProcess/ios/forms/WKFocusedFormControlView.h: Added.
597         * UIProcess/ios/forms/WKFocusedFormControlView.mm: Added.
598         * UIProcess/ios/forms/WKFocusedFormControlViewController.h: Added.
599         * UIProcess/ios/forms/WKFocusedFormControlViewController.mm: Added.
600         * UIProcess/ios/forms/WKTextFormControlViewController.h: Added.
601         * UIProcess/ios/forms/WKTextFormControlViewController.mm: Added.
602         * UIProcess/ios/forms/WKTextInputViewController.h: Added.
603         * UIProcess/ios/forms/WKTextInputViewController.mm: Added.
604         * UIProcess/ios/forms/WKTextSuggestionButton.h: Added.
605         * UIProcess/ios/forms/WKTextSuggestionButton.mm: Added.
606         * WebKit.xcodeproj/project.pbxproj:
607
608 2018-01-25  Chris Dumez  <cdumez@apple.com>
609
610         Clients.get(id) should only returns clients in the service worker's origin
611         https://bugs.webkit.org/show_bug.cgi?id=182149
612         <rdar://problem/36882310>
613
614         Reviewed by Youenn Fablet.
615
616         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
617         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
618
619 2018-01-25  Youenn Fablet  <youenn@apple.com>
620
621         WebPluginInfoProvider should handle null host queries
622         https://bugs.webkit.org/show_bug.cgi?id=182112
623
624         Reviewed by Chris Dumez.
625
626         Return early if host is null.
627
628         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
629         (WebKit::WebPluginInfoProvider::populatePluginCache):
630
631 2018-01-25  Simon Fraser  <simon.fraser@apple.com>
632
633         ASSERT(CGSizeEqualToSize(m_resizeScrollOffset, CGSizeZero)) in WebViewImpl::setFrameAndScrollBy()
634         https://bugs.webkit.org/show_bug.cgi?id=182082
635         rdar://problem/13971838
636
637         Reviewed by Tim Horton.
638
639         Safari could call WebViewImpl::setFrameAndScrollBy() multiple times with different scroll offsets,
640         triggering this assertion.
641
642         Rename to m_resizeScrollOffset to m_scrollOffsetAdjustment to reduce confusion with actual scroll offsets.
643         This parameter has no effect on macOS, but is used by the -[WKWebView setFrame:andScrollBy:] so at some point
644         needs to be hooked up to allow synchronous view resize and scroll adjustment (e.g. for the Find bar animation).
645         
646         Remove DrawingAreaProxy's m_layerPosition which was unused, and remove the parameters from the UpdateGeometry message.
647
648         * UIProcess/API/Cocoa/WKWebView.mm:
649         (-[WKWebView _frameOrBoundsChanged]):
650         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
651         * UIProcess/Cocoa/WebViewImpl.h:
652         * UIProcess/Cocoa/WebViewImpl.mm:
653         (WebKit::WebViewImpl::setFrameAndScrollBy):
654         (WebKit::WebViewImpl::setDrawingAreaSize):
655         * UIProcess/DrawingAreaProxy.cpp:
656         (WebKit::DrawingAreaProxy::setSize):
657         * UIProcess/DrawingAreaProxy.h:
658         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
659         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
660         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
661         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
662         * WebProcess/WebPage/DrawingArea.h:
663         (WebKit::DrawingArea::updateGeometry):
664         * WebProcess/WebPage/DrawingArea.messages.in:
665         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
666         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
667         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
668         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
669         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
670         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
671
672 2018-01-25  Keith Rollin  <krollin@apple.com>
673
674         Add logging to facilitate binding of WebContent and Network processes to UI process
675         https://bugs.webkit.org/show_bug.cgi?id=182066
676
677         Reviewed by Brent Fulgham.
678
679         When examining sysdiagnose logs and tracing events from one process to
680         another, it would be helpful to know which WebKit processes were
681         related to each other. When Safari, Mail, Messages, etc. are all
682         running at the same time, it may otherwise be difficult to know if a
683         particular Network process, for example was associated with Safari or
684         some other application. Add some logging to the creation of WebContent
685         and Network processes to identify their "presenting process" (parent
686         application).
687
688         * NetworkProcess/NetworkProcess.cpp:
689         (WebKit::NetworkProcess::initializeNetworkProcess):
690         * Platform/Logging.h:
691         * WebProcess/WebProcess.cpp:
692         (WebKit::WebProcess::initializeWebProcess):
693
694 2018-01-25  Youenn Fablet  <youenn@apple.com>
695
696         DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
697         https://bugs.webkit.org/show_bug.cgi?id=182115
698
699         Reviewed by Alex Christensen.
700
701         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
702         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
703
704 2018-01-25  Alex Christensen  <achristensen@webkit.org>
705
706         Fix crash when preconnecting while closing private browsing
707         https://bugs.webkit.org/show_bug.cgi?id=182114
708         <rdar://problem/35637284>
709
710         Reviewed by Joseph Pecoraro.
711
712         * NetworkProcess/PreconnectTask.cpp:
713         There is a race condition when destroying a session while a page is initiating a preconnect.
714         If this happens, fail gracefully instead of trying to preconnect with a null session.
715
716 2018-01-25  Dan Bernstein  <mitz@apple.com>
717
718         [Mac] Enable library validation for Networking & Storage XPC services
719         https://bugs.webkit.org/show_bug.cgi?id=173424
720         <rdar://problem/32386565>
721
722         Reviewed by Joseph Pecoraro.
723
724         * Configurations/BaseXPCService.xcconfig: Moved the definitions of
725           WK_LIBRARY_VALIDATION_ENABLED and WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS from
726           WebContentService.xcconfig to here and made them Mac-only at this level.
727         * Configurations/NetworkService.xcconfig: Also set OTHER_CODE_SIGN_FLAGS to
728           WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS.
729         * Configurations/StorageService.xcconfig: Ditto.
730         * Configurations/WebContentService.xcconfig: Moved definitions from here to
731           BaseXPCService.xcconfig.
732
733 2018-01-25  David Hyatt  <hyatt@apple.com>
734
735         Enable lines clamp support for Apple Mail by default
736         https://bugs.webkit.org/show_bug.cgi?id=182113
737
738         Reviewed by Dean Jackson.
739
740         * Shared/WebPageCreationParameters.cpp:
741         (WebKit::WebPageCreationParameters::encode const):
742         (WebKit::WebPageCreationParameters::decode):
743         * Shared/WebPageCreationParameters.h:
744         * UIProcess/WebPageProxy.cpp:
745         (WebKit::WebPageProxy::creationParameters):
746         * UIProcess/WebPageProxy.h:
747         * UIProcess/mac/WebPageProxyMac.mm:
748         (WebKit::WebPageProxy::appleMailLinesClampEnabled):
749         * WebProcess/WebPage/WebPage.cpp:
750         (WebKit::m_cpuLimit):
751
752 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
753
754         [WebVR][GTK][WPE] Remove the WebVR public API added in r227518
755         https://bugs.webkit.org/show_bug.cgi?id=182102
756
757         Reviewed by Carlos Garcia Campos.
758
759         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
760
761 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
762
763         [WebVR][GTK][WPE] Remove the WebVR public API added in r227518
764         https://bugs.webkit.org/show_bug.cgi?id=182102
765
766         Reviewed by Carlos Garcia Campos.
767
768         This new public API was not supposed to be included in the patch
769         that added OpenVR to the tree and to the build.
770
771         * UIProcess/API/glib/WebKitSettings.cpp:
772         (webKitSettingsSetProperty):
773         (webKitSettingsGetProperty):
774         (webkit_settings_class_init):
775         (webkit_settings_get_enable_webvr): Deleted.
776         (webkit_settings_set_enable_webvr): Deleted.
777         * UIProcess/API/gtk/WebKitSettings.h:
778         * UIProcess/API/wpe/WebKitSettings.h:
779
780 2018-01-25  Claudio Saavedra  <csaavedra@igalia.com>
781
782         [GTK] Fix build with touch events disabled
783
784         Unreviewed build fix.
785
786         Explicitly include gtk.h in files that were indirectly getting it
787         only when touch events were enabled.
788         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
789         * UIProcess/gtk/WaylandCompositor.h:
790
791 2018-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
792
793         WebDriver: test imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py crashes in debug
794         https://bugs.webkit.org/show_bug.cgi?id=182096
795
796         Reviewed by Carlos Alberto Lopez Perez.
797
798         It's an assert in HashTable iterators checkValidity(). The problem is that we get the keys to iterate the values
799         and the map is modified inside the loop. We need to use copyToVector to copy the keys.
800
801         * UIProcess/Automation/WebAutomationSession.cpp:
802         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
803         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
804         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
805
806 2018-01-24  Alex Christensen  <achristensen@webkit.org>
807
808         Gracefully recover from NetworkProcess crashes in private browsing
809         https://bugs.webkit.org/show_bug.cgi?id=182073
810         <rdar://problem/36572023>
811
812         Reviewed by Geoff Garen.
813
814         If we're using a non-persistent WKWebsiteDataStore and the NetworkProcess crashes and we try to do a load,
815         then the WebProcess restarts the NetworkProcess but doesn't recreate the ephemeral session in the NetworkProcess.
816         When this happens, we've already lost the browsing state in memory in the NetworkProcess, but we don't want to hang.
817         If this is the problem, then just recreate the ephemeral session and continue loading.
818
819         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
820         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
821         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
822         * NetworkProcess/NetworkResourceLoader.cpp:
823         (WebKit::NetworkResourceLoader::startNetworkLoad):
824         * Shared/WebsiteDataStoreParameters.cpp:
825         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
826         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): Deleted.
827         * Shared/WebsiteDataStoreParameters.h:
828         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):
829
830 2018-01-24  Dan Bernstein  <mitz@apple.com>
831
832         Enable library validation on the Web Content service
833         Part 1 of https://bugs.webkit.org/show_bug.cgi?id=172365
834         <rdar://problem/26470661>
835
836         Reviewed by David Kilzer.
837
838         This makes the Web Content process signed with the Library Validation flag in production
839         builds. Because doing so would prevent engineering builds of Apple apps that use an
840         injected bundle from working, this also adds a Development version of the service, which
841         does not enforce Library Validation. The UI process chooses to use the Development service
842         iff it would need to load an injected bundle that is not part of the OS.
843
844         * Configurations/DebugRelease.xcconfig: Disable Library Validation in engineering builds.
845
846         * Configurations/WebContentService.Development.xcconfig: Added. Like the normal service, but
847           only installed when WebKit is installed in the OS, and uses a Development variant.
848
849         * Configurations/WebContentService.xcconfig: For the Development variant, append
850           ".Development" to the product name, which is also the service identifier. Enable Library
851           Validation for the Normal variant of the service when WK_LIBRARY_VALIDATION_ENABLED allows
852           it.
853
854         * UIProcess/Launcher/ProcessLauncher.h: Add nonValidInjectedCodeAllowed member to
855           LaunchOptions, false by default.
856
857         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
858         (WebKit::serviceName): Use the Development variant if nonValidInjectedCodeAllowed is true.
859
860         * UIProcess/WebProcessProxy.cpp:
861         (WebKit::WebProcessProxy::getLaunchOptions): Initialize nonValidInjectedCodeAllowed using
862            the new shouldAllowNonValidInjectedCode().
863         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Generic implementation
864           that returns false.
865         * UIProcess/WebProcessProxy.h: Declared shouldAllowNonValidInjectedCode.
866         * UIProcess/mac/WebProcessProxyMac.mm:
867         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return true if this is
868           system WebKit with a non-system injected bundle.
869
870         * WebKit.xcodeproj/project.pbxproj: Added new service target.
871
872 2018-01-24  Chris Dumez  <cdumez@apple.com>
873
874         Add a IPC::SendSyncOption indicating we should not process incoming IPC while waiting for the sync reply
875         https://bugs.webkit.org/show_bug.cgi?id=182021
876         <rdar://problem/21629943>
877
878         Reviewed by Ryosuke Niwa.
879
880         Add a new DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption that the caller can
881         set when calling sendSync(). This indicates that the sendSync() should return only when we receive
882         the response to our sync IPC message, and that we should not process ANY incoming IPC in the meantime.
883
884         This patch also starts using this flag in 3 places where we know processing incoming IPC is an issue
885         and is causing crashes.
886
887         * Platform/IPC/Connection.cpp:
888         (IPC::Connection::sendSyncMessage):
889         When DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, make sure
890         we set the ShouldDispatchMessageWhenWaitingForSyncReply flag on the encoder. If we did not set this
891         flag then it could cause deadlocks when the destination process is also waiting on a synchronous
892         IPC from us. Normally, this flag already gets set for sync messages because sendSyncMessage() calls
893         sendMessage() with DispatchMessageEvenWhenWaitingForSyncReply SyncOption. However, sendMessage()
894         ignores the DispatchMessageEvenWhenWaitingForSyncReply flag if the
895         m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage flag is set on the
896         connection. Note that this flag is set on the connection from the WebProcess to the UIProcess at
897         the moment, which is why we saw deadlocks on the previous iteration of this patch.
898
899         (IPC::Connection::waitForSyncReply):
900         If DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, do not
901         process incoming IPC messages while waiting for our sync IPC reply.
902
903         * Platform/IPC/Connection.h:
904         Add new SendSyncOption.
905
906         * UIProcess/WebProcessProxy.cpp:
907         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
908         * UIProcess/WebProcessProxy.h:
909         * UIProcess/WebProcessProxy.messages.in:
910         Testing infrastructure.
911
912         * WebProcess/Network/WebLoaderStrategy.cpp:
913         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
914         Use new flag.
915
916         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
917         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
918         * WebProcess/WebCoreSupport/WebChromeClient.h:
919         Testing infrastructure.
920
921         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
922         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
923         Use new flag.
924
925         * WebProcess/WebProcess.cpp:
926         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
927         Testing infrastructure.
928
929         (WebKit::WebProcess::ensureNetworkProcessConnection):
930         Use new flag.
931
932         * WebProcess/WebProcess.h:
933         * WebProcess/WebProcess.messages.in:
934         Testing infrastructure.
935
936 2018-01-24  Joseph Pecoraro  <pecoraro@apple.com>
937
938         Web Inspector: Remove duplicate preference update for WebAuthentication value
939         https://bugs.webkit.org/show_bug.cgi?id=182058
940
941         Reviewed by Brian Burg.
942
943         * WebProcess/WebPage/WebPage.cpp:
944         (WebKit::WebPage::updatePreferences):
945         An identical update already happens in generated code.
946
947 2018-01-24  Alex Christensen  <achristensen@webkit.org>
948
949         Remove WebProcess access to QTKit
950         https://bugs.webkit.org/show_bug.cgi?id=182035
951
952         Reviewed by Alexey Proskuryakov.
953
954         * WebProcess/com.apple.WebProcess.sb.in:
955         This isn't needed any more.  We only have a little bit of code that uses QTKit which we should remove,
956         and it's only used for fullscreen controls in WebKitLegacy.  Let's tighten up the sandbox!
957
958 2018-01-24  Alex Christensen  <achristensen@webkit.org>
959
960         Remove pre-Sierra-OS-specific code in WebKit
961         https://bugs.webkit.org/show_bug.cgi?id=182024
962
963         Reviewed by Tim Horton.
964
965         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
966         * Shared/Cocoa/DataDetectionResult.mm:
967         (WebKit::DataDetectionResult::encode const):
968         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
969         (IPC::ArgumentCoder<WebCore::Payment>::encode):
970         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
971         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
972         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):
973         * Shared/WebPreferencesDefaultValues.h:
974         * Shared/cg/ShareableBitmapCG.cpp:
975         (WebKit::wantsExtendedRange):
976         * Shared/ios/InteractionInformationAtPosition.mm:
977         (WebKit::InteractionInformationAtPosition::encode const):
978         * Shared/mac/CodeSigning.mm:
979         (WebKit::codeSigningIdentifier):
980         (WebKit::codeSigningIdentifierForCurrentProcess):
981         * Shared/mac/ColorSpaceData.mm:
982         (WebKit::ColorSpaceData::encode const):
983         * Shared/mac/PasteboardTypes.mm:
984         (WebKit::PasteboardTypes::forURL):
985         * Shared/mac/WebCoreArgumentCodersMac.mm:
986         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
987         (IPC::ArgumentCoder<Credential>::encodePlatformData):
988         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
989         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):
990         * Shared/mac/WebHitTestResultData.mm:
991         (WebKit::WebHitTestResultData::platformEncode const):
992         * UIProcess/API/Cocoa/WKProcessPool.mm:
993         (-[WKProcessPool _setObject:forBundleParameter:]):
994         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
995         * UIProcess/API/Cocoa/WKWebView.mm:
996         (-[WKWebView _handleAcceptedCandidate:]):
997         * UIProcess/Cocoa/WebViewImpl.h:
998         * UIProcess/Cocoa/WebViewImpl.mm:
999         (WebKit::WebViewImpl::handleAcceptedCandidate):
1000         (WebKit::WebViewImpl::performDragOperation):
1001         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1002         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1003         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1004         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
1005         * WebProcess/com.apple.WebProcess.sb.in:
1006
1007 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1008
1009         Stop using AuthenticationClient in WebKit
1010         https://bugs.webkit.org/show_bug.cgi?id=182016
1011
1012         Reviewed by Brady Eidson.
1013
1014         It was necessary to support ResourceHandle use in WebKit, but now we're using NetworkSession everywhere in WebKit.
1015
1016         * Shared/Authentication/AuthenticationManager.cpp:
1017         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
1018         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
1019         (WebKit::AuthenticationManager::cancelSingleChallenge):
1020         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
1021         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
1022
1023 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1024
1025         Remove WebProcess authentication code
1026         https://bugs.webkit.org/show_bug.cgi?id=182020
1027
1028         Reviewed by Brady Eidson.
1029
1030         * Shared/Authentication/AuthenticationManager.cpp:
1031         * Shared/Authentication/AuthenticationManager.h:
1032         * UIProcess/WebPageProxy.cpp:
1033         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): Deleted.
1034         * UIProcess/WebPageProxy.h:
1035         * UIProcess/WebPageProxy.messages.in:
1036         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1037         (WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
1038         * WebProcess/WebProcess.cpp:
1039         (WebKit::m_webSQLiteDatabaseTracker):
1040
1041 2018-01-24  Jan-Michael Brummer  <jan.brummer@tabos.org>
1042
1043         [GTK] Page crash after swipe gesture running GNOME3 under wayland
1044         https://bugs.webkit.org/show_bug.cgi?id=181996
1045
1046         Reviewed by Michael Catanzaro.
1047
1048         Add missing GDK_TOUCH_CANCEL support which fixes page crashes due to cancelled gestures.
1049         * Shared/gtk/WebEventFactory.cpp:
1050         (WebKit::WebEventFactory::createWebTouchEvent):
1051         * UIProcess/API/gtk/PageClientImpl.cpp:
1052         (WebKit::PageClientImpl::doneWithTouchEvent):
1053         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1054         (touchPointStateForEvents):
1055         (webkitWebViewBaseGetTouchPointsForEvent):
1056         (webkitWebViewBaseTouchEvent):
1057         * UIProcess/gtk/GestureController.cpp:
1058         (WebKit::GestureController::handleEvent):
1059
1060 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1061
1062         Remove unused QTKit preference
1063         https://bugs.webkit.org/show_bug.cgi?id=181968
1064
1065         Reviewed by Alexey Proskuryakov.
1066
1067         * Shared/API/c/WKDeprecatedFunctions.cpp:
1068         (WKPreferencesSetQTKitEnabled):
1069         (WKPreferencesGetQTKitEnabled):
1070         * Shared/WebPreferences.yaml:
1071         * UIProcess/API/C/WKPreferences.cpp:
1072         (WKPreferencesSetQTKitEnabled): Deleted.
1073         (WKPreferencesGetQTKitEnabled): Deleted.
1074         * UIProcess/API/Cocoa/WKPreferences.mm:
1075         (-[WKPreferences _setQTKitEnabled:]): Deleted.
1076         (-[WKPreferences _qtKitEnabled]): Deleted.
1077         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1078
1079 2018-01-24  Youenn Fablet  <youenn@apple.com>
1080
1081         Fetch response should copy its url from the request if null
1082         https://bugs.webkit.org/show_bug.cgi?id=182048
1083
1084         Reviewed by Chris Dumez.
1085
1086         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1087         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1088
1089 2018-01-24  Sergio Villar Senin  <svillar@igalia.com>
1090
1091         Unreviewed build fix after r227518. I forgot to add the function declarations to the WPE
1092         header.
1093
1094         * UIProcess/API/wpe/WebKitSettings.h: Added webkit_settings_get/set_enable_webvr.
1095
1096 2018-01-24  Youenn Fablet  <youenn@apple.com>
1097
1098         Add Cache Storage engine assertion following on bug 181887
1099         https://bugs.webkit.org/show_bug.cgi?id=181925
1100
1101         Reviewed by Alex Christensen.
1102
1103         In a normal environment, the folderPath should be the same as the path computed from the ClientOrigin.
1104         Add assertion to verify this.
1105
1106         * NetworkProcess/cache/CacheStorageEngine.cpp:
1107         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
1108
1109 2018-01-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1110
1111         [GTK] Use GDK_EVENT_PROPAGATE and GDK_EVENT_STOP in WebKitWebViewBase.cpp
1112         https://bugs.webkit.org/show_bug.cgi?id=182031
1113
1114         Reviewed by Carlos Garcia Campos.
1115
1116         No functional changes, this just replaces TRUE with GDK_EVENT_STOP and FALSE with
1117         GDK_EVENT_PROPAGATE, to improve readability.
1118
1119         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1120         (webkitWebViewBaseKeyPressEvent):
1121         (webkitWebViewBaseKeyReleaseEvent):
1122         (webkitWebViewBaseButtonPressEvent):
1123         (webkitWebViewBaseButtonReleaseEvent):
1124         (webkitWebViewBaseScrollEvent):
1125         (webkitWebViewBaseMotionNotifyEvent):
1126         (webkitWebViewBaseCrossingNotifyEvent):
1127         (webkitWebViewBaseTouchEvent):
1128
1129 2018-01-23  Eric Carlson  <eric.carlson@apple.com>
1130
1131         Resign NowPlaying status when no media element is eligible
1132         https://bugs.webkit.org/show_bug.cgi?id=181914
1133         <rdar://problem/35294116>
1134
1135         Reviewed by Jer Noble.
1136
1137         * UIProcess/API/Cocoa/WKWebView.mm:
1138         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
1139         status.
1140         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1141
1142         * UIProcess/WebPageProxy.cpp:
1143         (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
1144         * UIProcess/WebPageProxy.h:
1145         * UIProcess/WebPageProxy.messages.in:
1146         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1147         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.
1148
1149 2018-01-23  Alex Christensen  <achristensen@webkit.org>
1150
1151         Use CompletionHandlers for ResourceHandleClient::didReceiveResponseAsync
1152         https://bugs.webkit.org/show_bug.cgi?id=181961
1153
1154         Reviewed by Michael Catanzaro.
1155
1156         * NetworkProcess/Downloads/Download.h:
1157         * NetworkProcess/NetworkLoad.cpp:
1158         * NetworkProcess/NetworkLoad.h:
1159         * NetworkProcess/NetworkResourceLoadParameters.h:
1160         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1161         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1162         * WebProcess/WebPage/mac/WebPageMac.mm:
1163         * WebProcess/WebProcess.cpp:
1164
1165 2018-01-23  Chris Dumez  <cdumez@apple.com>
1166
1167         Unreviewed, rollout r227216 as it seems to be causing deadlocks
1168         https://bugs.webkit.org/show_bug.cgi?id=182013
1169
1170         * Platform/IPC/Connection.cpp:
1171         (IPC::Connection::waitForSyncReply):
1172         * Platform/IPC/Connection.h:
1173         (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply): Deleted.
1174         * UIProcess/WebProcessProxy.cpp:
1175         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
1176         * UIProcess/WebProcessProxy.h:
1177         * UIProcess/WebProcessProxy.messages.in:
1178         * WebProcess/Network/NetworkProcessConnection.cpp:
1179         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
1180         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1181         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
1182         * WebProcess/WebConnectionToUIProcess.cpp:
1183         (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
1184         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1185         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
1186         * WebProcess/WebCoreSupport/WebChromeClient.h:
1187         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1188         (WebKit::WebEditorClient::undo):
1189         (WebKit::WebEditorClient::redo):
1190         * WebProcess/WebProcess.cpp:
1191         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting): Deleted.
1192         * WebProcess/WebProcess.h:
1193         * WebProcess/WebProcess.messages.in:
1194
1195 2018-01-23  Commit Queue  <commit-queue@webkit.org>
1196
1197         Unreviewed, rolling out r227437.
1198         https://bugs.webkit.org/show_bug.cgi?id=182011
1199
1200         broke build (Requested by alexchristensen on #webkit).
1201
1202         Reverted changeset:
1203
1204         "Remove unused QTKit preference"
1205         https://bugs.webkit.org/show_bug.cgi?id=181968
1206         https://trac.webkit.org/changeset/227437
1207
1208 2018-01-23  Alex Christensen  <achristensen@webkit.org>
1209
1210         Remove compile guard around beacon API
1211         https://bugs.webkit.org/show_bug.cgi?id=182002
1212
1213         Reviewed by Sam Weinig.
1214
1215         It's enabled everywhere now.
1216
1217         * Shared/WebPreferences.yaml:
1218         * UIProcess/API/C/WKPreferences.cpp:
1219         (WKPreferencesSetBeaconAPIEnabled):
1220         (WKPreferencesGetBeaconAPIEnabled):
1221         * config.h:
1222
1223 2018-01-23  Alex Christensen  <achristensen@webkit.org>
1224
1225         Remove unused QTKit preference
1226         https://bugs.webkit.org/show_bug.cgi?id=181968
1227
1228         Reviewed by Alexey Proskuryakov.
1229
1230         * Shared/API/c/WKDeprecatedFunctions.cpp:
1231         (WKPreferencesSetQTKitEnabled):
1232         (WKPreferencesGetQTKitEnabled):
1233         * Shared/WebPreferences.yaml:
1234         * UIProcess/API/C/WKPreferences.cpp:
1235         (WKPreferencesSetQTKitEnabled): Deleted.
1236         (WKPreferencesGetQTKitEnabled): Deleted.
1237         * UIProcess/API/Cocoa/WKPreferences.mm:
1238         (-[WKPreferences _setQTKitEnabled:]): Deleted.
1239         (-[WKPreferences _qtKitEnabled]): Deleted.
1240         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1241
1242 2018-01-23  Brent Fulgham  <bfulgham@apple.com>
1243
1244         [macOS] WebProcess needs TCC entitlements for media capture
1245         https://bugs.webkit.org/show_bug.cgi?id=181995
1246         <rdar://problem/36674649>
1247
1248         Reviewed by Eric Carlson.
1249
1250         * Configurations/WebContent-OSX.entitlements: Add delegated services needed to support media
1251         capture features.
1252
1253 2018-01-23  Dan Bernstein  <mitz@apple.com>
1254
1255         [Cocoa] Disable header postprocessing when building for macOS High Sierra
1256         https://bugs.webkit.org/show_bug.cgi?id=181972
1257
1258         Reviewed by Anders Carlsson.
1259
1260         * Configurations/WebKit.xcconfig: Adopt macOSTargetConditionals.xcconfig helpers and disable postprocessing
1261           when building for macOS 10.13.
1262
1263 2018-01-23  Joseph Pecoraro  <pecoraro@apple.com>
1264
1265         Web Inspector: Window resizing is broken after detaching to separate window
1266         https://bugs.webkit.org/show_bug.cgi?id=181992
1267         <rdar://problem/36714840>
1268
1269         Reviewed by Brian Burg.
1270
1271         * UIProcess/mac/WebInspectorProxyMac.mm:
1272         (WebKit::WebInspectorProxy::platformDetach):
1273         Restore the inspector view's autoresizingMask to the initial value
1274         that works with a detached window. This gets changed when the view
1275         gets attached to bottom/side, so we need to revert it on detaching.
1276
1277 2018-01-23  Brady Eidson  <beidson@apple.com>
1278
1279         Allow passing MessagePorts across processes (e.g. ServiceWorkers).
1280         https://bugs.webkit.org/show_bug.cgi?id=181178
1281
1282         Reviewed by Andy Estes.
1283
1284         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1285         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
1286         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
1287         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1288         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1289
1290         * StorageProcess/StorageProcess.cpp:
1291         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
1292         * StorageProcess/StorageProcess.h:
1293         * StorageProcess/StorageProcess.messages.in:
1294
1295         * UIProcess/WebProcessProxy.cpp:
1296         (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
1297         (WebKit::WebProcessProxy::postMessageToRemote):
1298
1299         * WebProcess/Storage/WebSWClientConnection.cpp:
1300         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
1301         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
1302         * WebProcess/Storage/WebSWClientConnection.h:
1303         * WebProcess/Storage/WebSWClientConnection.messages.in:
1304
1305         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1306         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorker):
1307         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
1308         * WebProcess/Storage/WebSWContextManagerConnection.h:
1309         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1310
1311 2018-01-23  Commit Queue  <commit-queue@webkit.org>
1312
1313         Unreviewed, rolling out r227279 and r227373.
1314         https://bugs.webkit.org/show_bug.cgi?id=181988
1315
1316         The LayoutTest crash fix introduced an API test failure.
1317         (Requested by ryanhaddad on #webkit).
1318
1319         Reverted changesets:
1320
1321         "Resign NowPlaying status when no media element is eligible"
1322         https://bugs.webkit.org/show_bug.cgi?id=181914
1323         https://trac.webkit.org/changeset/227279
1324
1325         "Resign NowPlaying status when no media element is eligible"
1326         https://bugs.webkit.org/show_bug.cgi?id=181914
1327         https://trac.webkit.org/changeset/227373
1328
1329 2018-01-23  Youenn Fablet  <youenn@apple.com>
1330
1331         REGRESSION (r227348): ASSERT_NOT_REACHED in WebKit::ServiceWorkerClientFetch::didFinish()
1332         https://bugs.webkit.org/show_bug.cgi?id=181956
1333         <rdar://problem/36755492>
1334
1335         Reviewed by Chris Dumez.
1336
1337         Covered by test no longer crashing in Debug builds.
1338         Reset m_redirectionStatus to None when starting an SW fetch.
1339
1340         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1341         (WebKit::ServiceWorkerClientFetch::start):
1342         (WebKit::ServiceWorkerClientFetch::didFinish):
1343
1344 2018-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1345
1346         [WPE] TestWebKitFindController asserts
1347         https://bugs.webkit.org/show_bug.cgi?id=181472
1348
1349         Reviewed by Carlos Garcia Campos.
1350
1351         Let's fix this in two independent ways.
1352
1353         First, use a GRefPtr to hold ownership of the WebKitWebViewBackend. This way, we don't need
1354         to change the order in which WebKitWebView destroys its priv struct members from what is
1355         used in WebKitGTK+, which can lead to odd bugs.
1356
1357         Additionally, just for good measure, stop resetting the find client when disposing
1358         WebKitFindController. This is unnecessary because it will never be destroyed before the
1359         WebKitWebView.
1360
1361         * UIProcess/API/glib/WebKitFindController.cpp:
1362         (webkit_find_controller_class_init):
1363         (webkitFindControllerDispose): Deleted.
1364         * UIProcess/API/glib/WebKitWebView.cpp:
1365         (_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
1366         (webkitWebViewSetProperty):
1367         (webkitWebViewGetProperty):
1368         (webkitWebViewCreatePage):
1369         (webkit_web_view_get_backend):
1370         * UIProcess/API/wpe/WebKitWebViewBackend.cpp:
1371         (webkitWebViewBackendCreateDefault):
1372         (WTF::refGPtr):
1373         (WTF::derefGPtr):
1374         * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h:
1375
1376 2018-01-22  Jon Lee  <jonlee@apple.com>
1377
1378         Update title label size
1379         https://bugs.webkit.org/show_bug.cgi?id=181962
1380         rdar://problem/36754744
1381
1382         Reviewed by Simon Fraser.
1383
1384         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
1385         (-[_WKFullScreenViewController setLocation:secure:trustedName:trustedSite:]): Move titleLabel properties into
1386         createSubviews.
1387         (-[_WKFullScreenViewController createSubviews]): Set the title label for both the cancel and location buttons.
1388         Refer to a const CGFloat for the font size.
1389
1390 2018-01-22  Megan Gardner  <megan_gardner@apple.com>
1391
1392         Temporarily restore block selection code conditionally
1393         https://bugs.webkit.org/show_bug.cgi?id=181895
1394         <rdar://problem/36567325>
1395
1396         Reviewed by Tim Horton.
1397
1398         We need to restore this code temporarily to avoid a crash.
1399
1400         * Platform/spi/ios/UIKitSPI.h:
1401         * UIProcess/ios/WKContentViewInteraction.mm:
1402         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]):
1403
1404 2018-01-22  Zach Li  <zacharyli323@gmail.com>
1405
1406         We should not try to link against the Safe Browsing framework on watchOS and tvOS.
1407         https://bugs.webkit.org/show_bug.cgi?id=181965.
1408
1409         Reviewed by Tim Horton.
1410
1411         * Configurations/WebKit.xcconfig:
1412
1413 2018-01-22  Alex Christensen  <achristensen@webkit.org>
1414
1415         Remove pre-NetworkSession loading code
1416         https://bugs.webkit.org/show_bug.cgi?id=181944
1417
1418         Reviewed by Tim Horton.
1419
1420         We were keeping it around for El Capitan.
1421
1422         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
1423         (WebKit::LegacyCustomProtocolManager::registerProtocolClass):
1424         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
1425         (WebKit::LegacyCustomProtocolManager::initialize):
1426         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
1427         * NetworkProcess/Downloads/BlobDownloadClient.cpp: Removed.
1428         * NetworkProcess/Downloads/BlobDownloadClient.h: Removed.
1429         * NetworkProcess/Downloads/Download.cpp:
1430         (WebKit::Download::~Download):
1431         (WebKit::Download::cancel):
1432         (WebKit::Download::didReceiveChallenge):
1433         (WebKit::Download::didFinish):
1434         (WebKit::Download::isAlwaysOnLoggingAllowed const):
1435         (WebKit::Download::start): Deleted.
1436         (WebKit::Download::startWithHandle): Deleted.
1437         (WebKit::Download::didStart): Deleted.
1438         (WebKit::Download::willSendRedirectedRequest): Deleted.
1439         (WebKit::Download::didReceiveAuthenticationChallenge): Deleted.
1440         (WebKit::Download::didReceiveResponse): Deleted.
1441         (WebKit::Download::shouldDecodeSourceDataOfMIMEType): Deleted.
1442         (WebKit::Download::decideDestinationWithSuggestedFilename): Deleted.
1443         (WebKit::Download::decideDestinationWithSuggestedFilenameAsync): Deleted.
1444         (WebKit::Download::didDecideDownloadDestination): Deleted.
1445         (WebKit::Download::continueDidReceiveResponse): Deleted.
1446         * NetworkProcess/Downloads/Download.h:
1447         (WebKit::Download::setBlobFileReferences): Deleted.
1448         (WebKit::Download::request const): Deleted.
1449         * NetworkProcess/Downloads/DownloadManager.cpp:
1450         (WebKit::DownloadManager::startDownload):
1451         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
1452         (WebKit::DownloadManager::convertNetworkLoadToDownload):
1453         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
1454         (WebKit::DownloadManager::resumeDownload):
1455         (WebKit::DownloadManager::cancelDownload):
1456         * NetworkProcess/Downloads/DownloadManager.h:
1457         (WebKit::DownloadManager::startDownload):
1458         * NetworkProcess/Downloads/PendingDownload.cpp:
1459         * NetworkProcess/Downloads/PendingDownload.h:
1460         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1461         * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed.
1462         * NetworkProcess/Downloads/mac/DownloadMac.mm: Removed.
1463         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1464         * NetworkProcess/NetworkCORSPreflightChecker.h:
1465         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1466         (WebKit::NetworkConnectionToWebProcess::loadPing):
1467         * NetworkProcess/NetworkDataTask.cpp:
1468         * NetworkProcess/NetworkDataTask.h:
1469         * NetworkProcess/NetworkDataTaskBlob.cpp:
1470         * NetworkProcess/NetworkDataTaskBlob.h:
1471         * NetworkProcess/NetworkLoad.cpp:
1472         (WebKit::NetworkLoad::~NetworkLoad):
1473         (WebKit::NetworkLoad::setDefersLoading):
1474         (WebKit::NetworkLoad::cancel):
1475         (WebKit::NetworkLoad::continueWillSendRequest):
1476         (WebKit::NetworkLoad::continueDidReceiveResponse):
1477         (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics const):
1478         (WebKit::NetworkLoad::didReceiveResponseAsync): Deleted.
1479         (WebKit::NetworkLoad::didReceiveBuffer): Deleted.
1480         (WebKit::NetworkLoad::didFinishLoading): Deleted.
1481         (WebKit::NetworkLoad::didFail): Deleted.
1482         (WebKit::NetworkLoad::willSendRequestAsync): Deleted.
1483         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
1484         (WebKit::NetworkLoad::shouldUseCredentialStorage): Deleted.
1485         (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Deleted.
1486         (WebKit::NetworkLoad::receivedCancellation): Deleted.
1487         * NetworkProcess/NetworkLoad.h:
1488         * NetworkProcess/NetworkLoadParameters.h:
1489         * NetworkProcess/NetworkProcess.cpp:
1490         (WebKit::NetworkProcess::initializeNetworkProcess):
1491         (WebKit::NetworkProcess::clearCachedCredentials):
1492         (WebKit::NetworkProcess::findPendingDownloadLocation):
1493         * NetworkProcess/NetworkProcess.h:
1494         * NetworkProcess/NetworkProcess.messages.in:
1495         * NetworkProcess/NetworkResourceLoader.cpp:
1496         (WebKit::NetworkResourceLoader::startNetworkLoad):
1497         * NetworkProcess/NetworkSession.cpp:
1498         * NetworkProcess/NetworkSession.h:
1499         * NetworkProcess/PingLoad.cpp:
1500         * NetworkProcess/PingLoad.h:
1501         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1502         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1503         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1504         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1505         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1506         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1507         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1508         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1509         * NetworkProcess/mac/NetworkLoadMac.mm: Removed.
1510         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1511         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1512         * Shared/Authentication/AuthenticationManager.cpp:
1513         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1514         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
1515         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
1516         (WebKit::AuthenticationManager::cancelSingleChallenge):
1517         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
1518         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
1519         * Shared/Authentication/AuthenticationManager.h:
1520         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: Removed.
1521         * Shared/SessionTracker.cpp:
1522         (WebKit::SessionTracker::setSession):
1523         (WebKit::SessionTracker::destroySession):
1524         * Shared/SessionTracker.h:
1525         * Shared/mac/CookieStorageShim.h: Removed.
1526         * Shared/mac/CookieStorageShim.mm: Removed.
1527         * UIProcess/API/APIDownloadClient.h:
1528         (API::DownloadClient::didReceiveData):
1529         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted.
1530         * UIProcess/API/C/WKContext.cpp:
1531         (WKContextSetDownloadClient):
1532         * UIProcess/Cocoa/DownloadClient.h:
1533         * UIProcess/Cocoa/DownloadClient.mm:
1534         (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted.
1535         * UIProcess/Downloads/DownloadProxy.cpp:
1536         (WebKit::DownloadProxy::willSendRequest):
1537         (WebKit::DownloadProxy::didReceiveResponse):
1538         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType): Deleted.
1539         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): Deleted.
1540         * UIProcess/Downloads/DownloadProxy.h:
1541         * UIProcess/Downloads/DownloadProxy.messages.in:
1542         * WebKit.xcodeproj/project.pbxproj:
1543         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1544         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1545         * WebProcess/WebProcess.cpp:
1546         (WebKit::WebProcess::initializeWebProcess):
1547         (WebKit::WebProcess::clearCachedCredentials):
1548         * config.h:
1549
1550 2018-01-22  Youenn Fablet  <youenn@apple.com>
1551
1552         SW: Make sure ServiceWorker loading and requests are correctly cleared by ITP
1553         https://bugs.webkit.org/show_bug.cgi?id=181942
1554         <rdar://problem/35132091>
1555
1556         Reviewed by Chris Dumez.
1557
1558         Add ServiceWorkerRegistrations and DOMCache as persistent data to be cleared according ITP decisions.
1559
1560         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1561         (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes):
1562
1563 2018-01-22  Chris Dumez  <cdumez@apple.com>
1564
1565         Add release logging to help debug issues related to service workers
1566         https://bugs.webkit.org/show_bug.cgi?id=181935
1567         <rdar://problem/36735900>
1568
1569         Reviewed by Brady Eidson.
1570
1571         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1572         (WebKit::WebSWServerConnection::startFetch):
1573         (WebKit::WebSWServerConnection::didFinishFetch):
1574         (WebKit::WebSWServerConnection::didFailFetch):
1575         (WebKit::WebSWServerConnection::didNotHandleFetch):
1576
1577 2018-01-22  Brent Fulgham  <bfulgham@apple.com>
1578
1579         [iOS] REGRESSION (r225763): Allow access to power logging features
1580         https://bugs.webkit.org/show_bug.cgi?id=181938
1581         <rdar://problem/36442803>
1582
1583         Reviewed by Eric Carlson.
1584
1585         I denied access to the powerlog facility in r225763, not realizing that it
1586         gets activated in certain logging scenarios. This patch reverts this change.
1587
1588         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1589
1590 2018-01-22  Brent Fulgham  <bfulgham@apple.com>
1591
1592         [macOS, iOS] Allow accss to AVFoundation preference
1593         https://bugs.webkit.org/show_bug.cgi?id=181937
1594         <rdar://problem/33137029>
1595
1596         Reviewed by Eric Carlson.
1597
1598         Grant access to the 'com.apple.avfoundation.frecents' preference.
1599
1600         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1601         * WebProcess/com.apple.WebProcess.sb.in:
1602
1603 2018-01-22  Brady Eidson  <beidson@apple.com>
1604
1605         In WebKit2, make the MessagePortChannelRegistry live in the UI process.
1606         https://bugs.webkit.org/show_bug.cgi?id=181922
1607
1608         Reviewed by Andy Estes.
1609
1610         With all of the work that went into making MessagePorts be fully asynchronous
1611         and to be process-aware, formally moving them out-of-process is just a matter
1612         of adding WebKit IPC layers.
1613         
1614         The basic unit of asynchronicity is "MessagePortChannelProvider", and this patch
1615         adds both a WebMessagePortChannelProvider and UIMessagePortChannelProvider for
1616         each side of the process divide.
1617         
1618         * UIProcess/UIMessagePortChannelProvider.cpp: Added.
1619         (WebKit::UIMessagePortChannelProvider::singleton):
1620         (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):
1621         (WebKit::UIMessagePortChannelProvider::~UIMessagePortChannelProvider):
1622         (WebKit::UIMessagePortChannelProvider::createNewMessagePortChannel):
1623         (WebKit::UIMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
1624         (WebKit::UIMessagePortChannelProvider::messagePortDisentangled):
1625         (WebKit::UIMessagePortChannelProvider::messagePortClosed):
1626         (WebKit::UIMessagePortChannelProvider::takeAllMessagesForPort):
1627         (WebKit::UIMessagePortChannelProvider::postMessageToRemote):
1628         (WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity):
1629         (WebKit::UIMessagePortChannelProvider::checkProcessLocalPortForActivity):
1630         * UIProcess/UIMessagePortChannelProvider.h: Added.
1631         (WebKit::UIMessagePortChannelProvider::registry):
1632
1633         * UIProcess/WebPageProxy.cpp:
1634         (WebKit::m_configurationPreferenceValues):
1635
1636         * UIProcess/WebProcessProxy.cpp:
1637         (WebKit::WebProcessProxy::processForIdentifier):
1638         (WebKit::m_userMediaCaptureManagerProxy):
1639         (WebKit::WebProcessProxy::~WebProcessProxy):
1640         (WebKit::WebProcessProxy::shutDown):
1641         (WebKit::WebProcessProxy::createNewMessagePortChannel):
1642         (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
1643         (WebKit::WebProcessProxy::messagePortDisentangled):
1644         (WebKit::WebProcessProxy::messagePortClosed):
1645         (WebKit::WebProcessProxy::takeAllMessagesForPort):
1646         (WebKit::WebProcessProxy::didDeliverMessagePortMessages):
1647         (WebKit::WebProcessProxy::postMessageToRemote):
1648         (WebKit::WebProcessProxy::checkRemotePortForActivity):
1649         (WebKit::WebProcessProxy::checkProcessLocalPortForActivity):
1650         (WebKit::WebProcessProxy::didCheckProcessLocalPortForActivity):
1651         * UIProcess/WebProcessProxy.h:
1652         * UIProcess/WebProcessProxy.messages.in:
1653
1654         * WebKit.xcodeproj/project.pbxproj:
1655
1656         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp: Added.
1657         (WebKit::WebMessagePortChannelProvider::singleton):
1658         (WebKit::WebMessagePortChannelProvider::WebMessagePortChannelProvider):
1659         (WebKit::WebMessagePortChannelProvider::~WebMessagePortChannelProvider):
1660         (WebKit::WebMessagePortChannelProvider::createNewMessagePortChannel):
1661         (WebKit::WebMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
1662         (WebKit::WebMessagePortChannelProvider::messagePortDisentangled):
1663         (WebKit::WebMessagePortChannelProvider::messagePortClosed):
1664         (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
1665         (WebKit::WebMessagePortChannelProvider::didTakeAllMessagesForPort):
1666         (WebKit::WebMessagePortChannelProvider::didCheckRemotePortForActivity):
1667         (WebKit::WebMessagePortChannelProvider::postMessageToRemote):
1668         (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
1669         (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
1670         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: Added.
1671
1672         * WebProcess/WebProcess.cpp:
1673         (WebKit::WebProcess::initializeProcess):
1674         (WebKit::WebProcess::didTakeAllMessagesForPort):
1675         (WebKit::WebProcess::checkProcessLocalPortForActivity):
1676         (WebKit::WebProcess::didCheckRemotePortForActivity):
1677         (WebKit::WebProcess::messagesAvailableForPort):
1678         * WebProcess/WebProcess.h:
1679         * WebProcess/WebProcess.messages.in:
1680
1681 2018-01-22  Youenn Fablet  <youenn@apple.com>
1682
1683         Bump default cache storage quota to 50MB
1684         https://bugs.webkit.org/show_bug.cgi?id=181924
1685
1686         Reviewed by Chris Dumez.
1687
1688         Existing web sites use more than 20 MB.
1689
1690         * UIProcess/WebsiteData/WebsiteDataStore.h:
1691
1692 2018-01-22  Zan Dobersek  <zdobersek@igalia.com>
1693
1694         Unreviewed build fix after r227292. Fixing a bad copy-paste that broke
1695         the GTK+ debug builds.
1696
1697         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
1698         (WebKit::convertCairoSurfaceToShareableBitmap):
1699
1700 2018-01-22  Zan Dobersek  <zdobersek@igalia.com>
1701
1702         [Cairo] Refactor PlatformContextCairo::drawSurfaceToContext() into a Cairo operation
1703         https://bugs.webkit.org/show_bug.cgi?id=181930
1704
1705         Reviewed by Carlos Garcia Campos.
1706
1707         Call sites of the PlatformContextCairo::drawSurfaceToContext() method
1708         are adjusted to now call Cairo::drawSurface() and properly pass the
1709         PlatformContextCairo object to the function.
1710
1711         * Shared/cairo/ShareableBitmapCairo.cpp:
1712         (WebKit::ShareableBitmap::paint):
1713         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
1714         (WebKit::convertCairoSurfaceToShareableBitmap):
1715
1716 2018-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1717
1718         Unreviewed. Fix compile warning.
1719
1720         Use #include instead of #import in cross-platform code.
1721
1722         * Shared/WebPreferencesDefaultValues.cpp:
1723
1724 2018-01-21  Ryosuke Niwa  <rniwa@webkit.org>
1725
1726         Turning off custom pasteboard data doesn't actually turn it off in WK2
1727         https://bugs.webkit.org/show_bug.cgi?id=181920
1728         <rdar://problem/36686429>
1729
1730         Reviewed by Wenson Hsieh.
1731
1732         Moved the code to decide when to enable custom pasteboard data from WebCore
1733         since we never enable this feature in WebKit1.
1734
1735         * Shared/WebPreferences.yaml:
1736         * Shared/WebPreferencesDefaultValues.cpp:
1737         (defaultCustomPasteboardDataEnabled): Added.
1738         * Shared/WebPreferencesDefaultValues.h:
1739
1740 2018-01-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1741
1742         Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
1743         https://bugs.webkit.org/show_bug.cgi?id=181918
1744
1745         Reviewed by Tim Horton.
1746
1747         Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default).
1748
1749         * Configurations/FeatureDefines.xcconfig:
1750
1751 2018-01-21  Eric Carlson  <eric.carlson@apple.com>
1752
1753         Resign NowPlaying status when no media element is eligible
1754         https://bugs.webkit.org/show_bug.cgi?id=181914
1755         <rdar://problem/35294116>
1756
1757         Reviewed by Jer Noble.
1758
1759         * UIProcess/API/Cocoa/WKWebView.mm:
1760         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
1761         status.
1762         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1763
1764         * UIProcess/WebPageProxy.cpp:
1765         (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
1766         * UIProcess/WebPageProxy.h:
1767         * UIProcess/WebPageProxy.messages.in:
1768         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1769         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.
1770
1771 2018-01-20  Andy Estes  <aestes@apple.com>
1772
1773         [Apple Pay] Stop eagerly loading PassKit.framework
1774         https://bugs.webkit.org/show_bug.cgi?id=181911
1775         <rdar://problem/36555369>
1776
1777         Reviewed by Tim Horton.
1778
1779         * Shared/WebPageCreationParameters.cpp:
1780         (WebKit::WebPageCreationParameters::encode const):
1781         (WebKit::WebPageCreationParameters::decode):
1782         * Shared/WebPageCreationParameters.h:
1783
1784         Removed availablePaymentNetworks from WebPageCreationParameters.
1785
1786         * UIProcess/API/C/WKPreferences.cpp:
1787         (WKPreferencesSetApplePayEnabled):
1788         * UIProcess/API/Cocoa/WKWebView.mm:
1789         (-[WKWebView _initializeWithConfiguration:]):
1790
1791         Stopped calling WebPaymentCoordinatorProxy::platformSupportsPayments().
1792
1793         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1794         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
1795         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
1796         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
1797
1798         Added message AvailablePaymentNetworks, which synchronously returns a Vector of payment
1799         networks.
1800
1801         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1802         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
1803
1804         Returned false if PassKitLibrary() fails.
1805
1806         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
1807         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
1808
1809         Called completionHandler with false if PassKitLibrary() fails.
1810
1811         (WebKit::WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks):
1812         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
1813
1814         Renamed availablePaymentNetworks to platformAvailablePaymentNetworks
1815
1816         (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments): Deleted.
1817
1818         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1819         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1820
1821         Called completionHandler with false if PassKitLibrary() fails.
1822
1823         * UIProcess/WebPageProxy.cpp:
1824         (WebKit::WebPageProxy::creationParameters):
1825
1826         Stopped calling WebPaymentCoordinatorProxy::availablePaymentNetworks().
1827
1828         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1829         (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
1830         (WebKit::WebPaymentCoordinator::validatedPaymentNetwork):
1831         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1832
1833         Implemented PaymentCoordinatorClient::validatedPaymentNetwork(). m_availablePaymentNetworks
1834         starts off as std::nullopt, but is initialized by sending the AvailablePaymentNetworks sync
1835         message the first time it's accessed.
1836
1837         * WebProcess/WebPage/WebPage.cpp:
1838         (WebKit::WebPage::WebPage):
1839
1840         Stopped setting PageConfiguration::availablePaymentNetworks.
1841
1842 2018-01-20  Jer Noble  <jer.noble@apple.com>
1843
1844         Release ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout
1845         https://bugs.webkit.org/show_bug.cgi?id=181840
1846         <rdar://problem/36186214>
1847
1848         Reviewed by Simon Fraser.
1849
1850         Updating layout while the document is suspended or stopped is unsafe.
1851
1852         * WebProcess/cocoa/VideoFullscreenManager.mm:
1853         (WebKit::inlineVideoFrame):
1854
1855 2018-01-20  Chris Dumez  <cdumez@apple.com>
1856
1857         DOMCache data sometimes not properly removed when clearing data for a given origin
1858         https://bugs.webkit.org/show_bug.cgi?id=181887
1859         <rdar://problem/36671239>
1860
1861         Reviewed by Youenn Fablet.
1862
1863         * NetworkProcess/cache/CacheStorageEngine.cpp:
1864         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
1865         This code was iterating through folders on disk, then reading the folder's origin
1866         from the origin file on disk. Then, if the origin would match the one we want to
1867         delete, it would regenerate the folder path using cachesRootPath(*folderOrigin).
1868         I don't know how but on my machine, I was ended up in a state where the path
1869         generated by cachesRootPath(*folderOrigin) differed from the actual folder path
1870         we read the origin from (Likely a different salt?). To make the code more robust,
1871         I updated the code to delete "folderPath", which is the path we read the origin
1872         from.
1873
1874 2018-01-19  Zach Li  <zacharyli323@gmail.com>
1875
1876         Expose Safe Browsing SPI
1877         https://bugs.webkit.org/show_bug.cgi?id=181804
1878         <rdar://problem/36626946>
1879
1880         Reviewed by Dan Bernstein.
1881
1882         If client is using Apple internal SDK, then we can just import the header; if not,
1883         then we declare necessary symbols that client will need.
1884
1885         * Configurations/WebKit.xcconfig:
1886         Only link against SafariSafeBrowsing framework on macOS High Sierra
1887         and iOS 11 and above. Weak link against SafariSafeBrowsing framework
1888         because it is not present on the Base system.
1889
1890         * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.
1891
1892         * WebKit.xcodeproj/project.pbxproj:
1893         Added SafeBrowsingSPI.h.
1894
1895         * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
1896         Added.
1897
1898 2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>
1899
1900         Unreviewed build fix, removed unused lambda capture.
1901
1902         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1903         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1904
1905 2018-01-19  John Wilander  <wilander@apple.com>
1906
1907         Resource Load Statistics: Remove unused calls to WebResourceLoadStatisticsStore:logTestingEvent() to fix API test
1908         https://bugs.webkit.org/show_bug.cgi?id=181890
1909         <rdar://problem/36674772>
1910
1911         Unreviewed API test fix.
1912
1913         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1914         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1915
1916 2018-01-19  Youenn Fablet  <youenn@apple.com>
1917
1918         Do not go to the storage process when registering a service worker client if there is no service worker registered
1919         https://bugs.webkit.org/show_bug.cgi?id=181740
1920         <rdar://problem/36650400>
1921
1922         Reviewed by Chris Dumez.
1923
1924         UIProcess notifies all web processes to register their service worker clients when spinning the service worker process.
1925         Add private API to set the number of web processes for testing purposes.
1926
1927         * UIProcess/API/Cocoa/WKProcessPool.mm:
1928         (-[WKProcessPool _setMaximumNumberOfProcesses:]):
1929         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1930         * UIProcess/WebProcessPool.cpp:
1931         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1932         * WebProcess/WebProcess.cpp:
1933         (WebKit::WebProcess::registerServiceWorkerClients):
1934         * WebProcess/WebProcess.h:
1935         * WebProcess/WebProcess.messages.in:
1936
1937 2018-01-19  Dean Jackson  <dino@apple.com>
1938
1939         REGRESSION (r221092): Swipe actions are hard to perform in FastMail app
1940         https://bugs.webkit.org/show_bug.cgi?id=181817
1941         <rdar://problem/35274055>
1942
1943         Reviewed by Simon Fraser.
1944
1945         Add a linked-on-or-after check to set passive touch listeners on document in WebCore.
1946
1947         * CMakeLists.txt:
1948         * Shared/WebPreferences.yaml:
1949         * Shared/WebPreferencesDefaultValues.cpp: Copied from Source/WebKit/UIProcess/Cocoa/VersionChecks.h.
1950         (defaultPassiveTouchListenersAsDefaultOnDocument):
1951         * Shared/WebPreferencesDefaultValues.h:
1952         * UIProcess/Cocoa/VersionChecks.h:
1953         * WebKit.xcodeproj/project.pbxproj:
1954
1955 2018-01-19  Joseph Pecoraro  <pecoraro@apple.com>
1956
1957         [Cocoa] _WKNSWindowExtras.h: Add missing availability annotation
1958         https://bugs.webkit.org/show_bug.cgi?id=181868
1959
1960         Reviewed by Dan Bernstein.
1961
1962         * Shared/API/Cocoa/_WKNSWindowExtras.h:
1963
1964 2018-01-19  John Wilander  <wilander@apple.com>
1965
1966         Resource Load Statistics: Add void to argument list to fix build with -Wstrict-prototypes
1967         https://bugs.webkit.org/show_bug.cgi?id=181870
1968         <rdar://problem/36666750>
1969
1970         Unreviewed build fix.
1971
1972         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1973
1974 2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>
1975
1976         Unreviewed, rolling out r227211.
1977
1978         Breaks iOS Simulator tests.
1979
1980         Reverted changeset:
1981
1982         "Expose Safe Browsing SPI"
1983         https://bugs.webkit.org/show_bug.cgi?id=181804
1984         https://trac.webkit.org/changeset/227211
1985
1986 2018-01-19  John Wilander  <wilander@apple.com>
1987
1988         Resource Load Statistics: Implement callback support for removal of WebsiteDataType::ResourceLoadStatistics
1989         https://bugs.webkit.org/show_bug.cgi?id=181822
1990         https://bugs.webkit.org/show_bug.cgi?id=175263
1991         https://bugs.webkit.org/show_bug.cgi?id=178536
1992         https://bugs.webkit.org/show_bug.cgi?id=181223
1993         https://bugs.webkit.org/show_bug.cgi?id=181482
1994         <rdar://problem/33491222>
1995         <rdar://problem/33805293>
1996         <rdar://problem/36332683>
1997         <rdar://problem/36549026>
1998
1999         Reviewed by Alex Christensen.
2000
2001         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2002         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
2003         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
2004         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2005         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]):
2006             Calls the new API with no-op completion handler.
2007         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]):
2008             New API with completion handler.
2009         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
2010             Calls the new API with no-op completion handler.
2011         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]):
2012             New API with completion handler.
2013         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2014         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2015         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
2016         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2017         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
2018         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2019         * UIProcess/WebResourceLoadStatisticsStore.h:
2020         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2021         (WebKit::WebsiteDataStore::removeData):
2022         (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
2023         * UIProcess/WebsiteData/WebsiteDataStore.h:
2024
2025 2018-01-19  Daniel Bates  <dabates@apple.com>
2026
2027         REGRESSION (r223149): Ref WebPageProxy objects before calling their functionality
2028         https://bugs.webkit.org/show_bug.cgi?id=181863
2029         <rdar://problem/36662452>
2030
2031         Reviewed by Chris Dumez.
2032
2033         More fix ups following r223149. When notifying all pages of a process state change we need to
2034         take care to ref all the pages before iterating over them and notifying them of the change.
2035         Notifying a page of such a state change may ultimately delegate to the embedding client. And
2036         the embedding client can do anything, including deallocating one or more pages.
2037
2038         * UIProcess/WebProcessProxy.cpp:
2039         (WebKit::WebProcessProxy::didBecomeUnresponsive):
2040         (WebKit::WebProcessProxy::didBecomeResponsive):
2041         (WebKit::WebProcessProxy::willChangeIsResponsive):
2042         (WebKit::WebProcessProxy::didChangeIsResponsive):
2043         (WebKit::WebProcessProxy::requestTermination):
2044
2045 2018-01-19  Chris Dumez  <cdumez@apple.com>
2046
2047         The WebContent process should not process incoming IPC while waiting for a sync IPC reply
2048         https://bugs.webkit.org/show_bug.cgi?id=181560
2049
2050         Reviewed by Ryosuke Niwa.
2051
2052         The WebContent process should not process incoming IPC while waiting for a sync IPC reply.
2053         This is causing hard-to-debug crashes because developers often assume the state does not
2054         change during a sendSync() call.
2055
2056         * Platform/IPC/Connection.cpp:
2057         (IPC::Connection::waitForSyncReply):
2058         * Platform/IPC/Connection.h:
2059         (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply):
2060         * UIProcess/WebProcessProxy.cpp:
2061         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
2062         * UIProcess/WebProcessProxy.h:
2063         * UIProcess/WebProcessProxy.messages.in:
2064         * WebProcess/Network/NetworkProcessConnection.cpp:
2065         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
2066         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2067         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
2068         * WebProcess/WebConnectionToUIProcess.cpp:
2069         (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
2070         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2071         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
2072         * WebProcess/WebCoreSupport/WebChromeClient.h:
2073         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2074         (WebKit::WebEditorClient::undo):
2075         (WebKit::WebEditorClient::redo):
2076         * WebProcess/WebProcess.cpp:
2077         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
2078         * WebProcess/WebProcess.h:
2079         * WebProcess/WebProcess.messages.in:
2080
2081 2018-01-19  Keith Miller  <keith_miller@apple.com>
2082
2083         HaveInternalSDK includes should be "#include?"
2084         https://bugs.webkit.org/show_bug.cgi?id=179670
2085
2086         Reviewed by Dan Bernstein.
2087
2088         * Configurations/Base.xcconfig:
2089
2090 2018-01-19  Daniel Bates  <dabates@apple.com>
2091
2092         Fix misspelling; substitute willDetachRenderer for willDetatchRenderer.
2093
2094         * WebProcess/Plugins/PDF/PDFPlugin.h:
2095         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2096         (WebKit::PDFPlugin::willDetachRenderer):
2097         (WebKit::PDFPlugin::willDetatchRenderer): Deleted.
2098         * WebProcess/Plugins/Plugin.h:
2099         (WebKit::Plugin::willDetachRenderer):
2100         (WebKit::Plugin::willDetatchRenderer): Deleted.
2101         * WebProcess/Plugins/PluginView.cpp:
2102         (WebKit::PluginView::willDetachRenderer):
2103         (WebKit::PluginView::willDetatchRenderer): Deleted.
2104         * WebProcess/Plugins/PluginView.h:
2105
2106 2018-01-19  Zach Li  <zacharyli323@gmail.com>
2107
2108         Expose Safe Browsing SPI
2109         https://bugs.webkit.org/show_bug.cgi?id=181804
2110         <rdar://problem/36626946>
2111
2112         Reviewed by Alex Christensen.
2113
2114         If client is using Apple internal SDK, then we can just import the header; if not,
2115         then we declare necessary symbols that client will need.
2116
2117         * Configurations/WebKit.xcconfig:
2118         Only link against SafariSafeBrowsing framework on macOS High Sierra
2119         and iOS 11 and above. Weak link against SafariSafeBrowsing framework
2120         because it is not present on the Base system.
2121
2122         * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.
2123
2124         * WebKit.xcodeproj/project.pbxproj:
2125         Added SafeBrowsingSPI.h.
2126
2127         * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
2128         Added.
2129
2130 2018-01-18  Chris Dumez  <cdumez@apple.com>
2131
2132         We should be able to terminate service workers that are unresponsive
2133         https://bugs.webkit.org/show_bug.cgi?id=181563
2134         <rdar://problem/35280031>
2135
2136         Reviewed by Alex Christensen.
2137
2138         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2139         (WebKit::WebSWContextManagerConnection::terminateWorker):
2140         Use a 10 second timeout for forcefully exiting the service worker process when
2141         the service worker in question fails to terminate.
2142
2143         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
2144         Use a 100ms timeout for forcefully exiting the service worker process when
2145         the service worker in question fails to terminate. This method is only called
2146         from the layout tests, which is why we use a very short timeout.
2147
2148 2018-01-18  Ryan Haddad  <ryanhaddad@apple.com>
2149
2150         Unreviewed, suppress deprecation warnings to fix the build with a newer SDK.
2151
2152         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
2153         (-[WKPDFPageNumberIndicator _makeRoundedCorners]):
2154
2155 2018-01-18  Youenn Fablet  <youenn@apple.com>
2156
2157         Do not go to the storage process when loading a main resource if there is no service worker registered
2158         https://bugs.webkit.org/show_bug.cgi?id=181395
2159
2160         Reviewed by Chris Dumez.
2161
2162         Add a new web process creation parameter to know whether there is any service worker registered at web process creation time.
2163         If there is none, the web process will then start to load HTTP resources from the network.
2164         The connection to the storage process is then executed when receiving the first bytes of the main resource.
2165         This connection is needed as other web processes may create service workers at any given time.
2166         If there is one registered service worker, the web process will wait for its connection to the storage process to be active.
2167
2168         * Shared/WebProcessCreationParameters.cpp:
2169         (WebKit::WebProcessCreationParameters::encode const):
2170         (WebKit::WebProcessCreationParameters::decode):
2171         * Shared/WebProcessCreationParameters.h:
2172         * UIProcess/ServiceWorkerProcessProxy.cpp:
2173         (WebKit::ServiceWorkerProcessProxy::hasRegisteredServiceWorkers):
2174         * UIProcess/ServiceWorkerProcessProxy.h:
2175         * UIProcess/WebProcessPool.cpp:
2176         (WebKit::WebProcessPool::initializeNewWebProcess):
2177         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2178         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
2179         * WebProcess/Storage/WebServiceWorkerProvider.h:
2180         * WebProcess/Storage/WebToStorageProcessConnection.h:
2181         (WebKit::WebToStorageProcessConnection::existingServiceWorkerConnectionForSession):
2182         * WebProcess/WebProcess.cpp:
2183         (WebKit::WebProcess::initializeWebProcess):
2184
2185 2018-01-18  Chris Dumez  <cdumez@apple.com>
2186
2187         Regression(r223149): WebProcessProxy::didClose() no longer refs WebPageProxy objects
2188         https://bugs.webkit.org/show_bug.cgi?id=181771
2189         <rdar://problem/36566237>
2190
2191         Reviewed by Brady Eidson.
2192
2193         * UIProcess/WebProcessProxy.cpp:
2194         (WebKit::WebProcessProxy::didClose):
2195         Use copyToVectorOf<RefPtr<WebPageProxy>>() to maintain pre-r223149 behavior
2196         and ref the pages.
2197
2198 2018-01-18  Dan Bernstein  <mitz@apple.com>
2199
2200         [Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions
2201         https://bugs.webkit.org/show_bug.cgi?id=181803
2202
2203         Reviewed by Tim Horton.
2204
2205         * Configurations/Base.xcconfig: Updated.
2206         * Configurations/DebugRelease.xcconfig: Ditto.
2207         * Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
2208         * Configurations/Version.xcconfig: Updated.
2209         * Configurations/macOSTargetConditionals.xcconfig: Added.  Defines helper build settings
2210           useful for defining settings that depend on the target macOS version.
2211
2212 2018-01-18  Chris Dumez  <cdumez@apple.com>
2213
2214         Service Workers restored from persistent storage have 'redundant' state
2215         https://bugs.webkit.org/show_bug.cgi?id=181749
2216         <rdar://problem/36556486>
2217
2218         Reviewed by Youenn Fablet.
2219
2220         Allow service workers to intercept custom protocol loads as this is useful for
2221         API testing.
2222
2223         * WebProcess/Network/WebLoaderStrategy.cpp:
2224         (WebKit::WebLoaderStrategy::scheduleLoad):
2225         (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
2226         * WebProcess/Network/WebLoaderStrategy.h:
2227
2228 2018-01-18  Brent Fulgham  <bfulgham@apple.com>
2229
2230         REGRESSION(r225858): Sandbox violations due to blocked access to Spotlight search preferences
2231         https://bugs.webkit.org/show_bug.cgi?id=181797
2232         <rdar://problem/36546412>
2233
2234         Reviewed by Eric Carlson.
2235
2236         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add the read permission for
2237         'com.apple.lookup.shared' to support DataDetectors.
2238
2239 2018-01-17  John Wilander  <wilander@apple.com>
2240
2241         Resource Load Statistics: Block cookies for prevalent resources without user interaction
2242         https://bugs.webkit.org/show_bug.cgi?id=177394
2243         <rdar://problem/34613960>
2244
2245         Reviewed by Alex Christensen.
2246
2247         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2248             Now has m_hasBeenSetToUseStatelessCookieStorage to handle
2249             cookie blocking.
2250         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2251         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
2252             Returns singleton empty, deny-all cookie storage for cookie blocking.
2253             The ugly pragma instructions for clang are because the NSString
2254             parameter for _initWithIdentifier was not marked nullable pre-Sierra.
2255         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
2256             Instead of just decision making, this now applies the policy.
2257         (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
2258             New method.
2259         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2260             Now blocks cookies for domains where cookies will be purged anyway.
2261         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2262             Now blocks cookies for domains where cookies will be purged anyway.
2263         (WebKit::shouldChangePartition): Deleted.
2264         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2265         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2266             Now downgrades for blocked cookies instead of partitioned cookies.
2267         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
2268             Now downgrades for blocked cookies instead of partitioned cookies.
2269
2270
2271 2018-01-17  Stephan Szabo  <stephan.szabo@sony.com>
2272
2273         [Curl] Use ResourceRequest::encodeWithPlatformData()
2274         https://bugs.webkit.org/show_bug.cgi?id=181768
2275
2276         Reviewed by Alex Christensen.
2277
2278         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
2279         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2280         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2281
2282 2018-01-17  Matt Lewis  <jlewis3@apple.com>
2283
2284         Unreviewed, rolling out r227076.
2285
2286         This breaks internal builds
2287
2288         Reverted changeset:
2289
2290         "Resource Load Statistics: Block cookies for prevalent
2291         resources without user interaction"
2292         https://bugs.webkit.org/show_bug.cgi?id=177394
2293         https://trac.webkit.org/changeset/227076
2294
2295 2018-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2296
2297         WEBKIT_FRAMEWORK should not modify file-global include directories
2298         https://bugs.webkit.org/show_bug.cgi?id=181656
2299
2300         Reviewed by Konstantin Tokarev.
2301
2302         * PlatformGTK.cmake:
2303         * PlatformWPE.cmake:
2304
2305 2018-01-17  Youenn Fablet  <youenn@apple.com>
2306
2307         Put fetch request keepAlive behind a runtime flag
2308         https://bugs.webkit.org/show_bug.cgi?id=181592
2309
2310         Reviewed by Chris Dumez.
2311
2312         * Shared/WebPreferences.yaml:
2313         * UIProcess/API/C/WKPreferences.cpp:
2314         (WKPreferencesSetFetchAPIKeepAliveEnabled):
2315         (WKPreferencesGetFetchAPIKeepAliveEnabled):
2316         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2317
2318 2018-01-17  John Wilander  <wilander@apple.com>
2319
2320         Resource Load Statistics: Block cookies for prevalent resources without user interaction
2321         https://bugs.webkit.org/show_bug.cgi?id=177394
2322         <rdar://problem/34613960>
2323
2324         Reviewed by Alex Christensen.
2325
2326         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2327             Now has m_hasBeenSetToUseStatelessCookieStorage to handle
2328             cookie blocking.
2329         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2330         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
2331             Returns singleton empty, deny-all cookie storage for cookie blocking.
2332         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
2333             Instead of just decision making, this now applies the policy.
2334         (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
2335             New method.
2336         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2337             Now blocks cookies for domains where cookies will be purged anyway.
2338         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2339             Now blocks cookies for domains where cookies will be purged anyway.
2340         (WebKit::shouldChangePartition): Deleted.
2341         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2342         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2343             Now downgrades for blocked cookies instead of partitioned cookies.
2344         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
2345             Now downgrades for blocked cookies instead of partitioned cookies.
2346
2347 2018-01-17  Daniel Bates  <dabates@apple.com>
2348
2349         REGRESSION (r222795): Cardiogram never signs in
2350         https://bugs.webkit.org/show_bug.cgi?id=181693
2351         <rdar://problem/36286293>
2352
2353         Reviewed by Ryosuke Niwa.
2354
2355         Exempt Cardiogram from the XHR header restrictions in r222795.
2356
2357         Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
2358         However Cardiogram also depends on such functionality.
2359
2360         * Shared/WebPreferences.yaml:
2361         * UIProcess/API/Cocoa/WKWebView.mm:
2362         (shouldAllowSettingAnyXHRHeaderFromFileURLs):
2363         (-[WKWebView _initializeWithConfiguration:]):
2364         * UIProcess/Cocoa/VersionChecks.h:
2365
2366 2018-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2367
2368         Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
2369         https://bugs.webkit.org/show_bug.cgi?id=181637
2370         <rdar://problem/36508471>
2371
2372         Reviewed by Tim Horton.
2373
2374         Add new injected bundle SPI, replacementURLForResource, which clients may use to provide a replacement URL to
2375         represent an archive resource, given the resource's data and MIME type.
2376
2377         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
2378         (API::InjectedBundle::EditorClient::replacementURLForResource):
2379         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
2380         * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
2381
2382         Add replacementURLForResource, and also bump the current injected bundle editor client version to 2.
2383
2384         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2385         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
2386         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
2387         (WebKit::InjectedBundlePageEditorClient::replacementURLForResource):
2388         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
2389         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2390         (WebKit::WebEditorClient::replacementURLForResource):
2391         * WebProcess/WebCoreSupport/WebEditorClient.h:
2392
2393 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
2394
2395         [Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
2396         https://bugs.webkit.org/show_bug.cgi?id=181725
2397
2398         Reviewed by Carlos Garcia Campos.
2399
2400         * Shared/cairo/ShareableBitmapCairo.cpp:
2401         (WebKit::ShareableBitmap::paint):
2402         Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
2403         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2404         (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.
2405
2406 2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2407
2408         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.6 release.
2409
2410         * gtk/NEWS: Add release notes for 2.19.6.
2411
2412 2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2413
2414         [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds
2415         https://bugs.webkit.org/show_bug.cgi?id=179914
2416
2417         Reviewed by Žan Doberšek.
2418
2419         Add symbols detected by check-for-global-bss-symbols-in-webkigtk-libs to the version script.
2420
2421         * webkitglib-symbols.map:
2422
2423 2018-01-17  Youenn Fablet  <youenn@apple.com>
2424
2425         Clear Caches volatile storage as a memory optimization.
2426         https://bugs.webkit.org/show_bug.cgi?id=181643
2427
2428         Reviewed by Chris Dumez.
2429
2430         clearMemoryRepresentation clears m_caches which exposes data potentially stored in m_volatileStorage.
2431         Clearing m_volatileStorage allows releasing some memory.
2432
2433         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2434         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
2435
2436 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
2437
2438         [Cairo] Use one-time ShadowBlur objects when performing shadowing
2439         https://bugs.webkit.org/show_bug.cgi?id=181720
2440
2441         Reviewed by Carlos Garcia Campos.
2442
2443         * Shared/cairo/ShareableBitmapCairo.cpp:
2444         (WebKit::ShareableBitmap::paint):
2445         Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
2446         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2447         (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.
2448
2449 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2450
2451         [CMake] Remove WebCoreDerivedSources library target
2452         https://bugs.webkit.org/show_bug.cgi?id=181664
2453
2454         Reviewed by Carlos Garcia Campos.
2455
2456         * CMakeLists.txt: Do not link WebCoreDerivedSources.
2457         * PlatformGTK.cmake: Appended WebCore after WebCorePlatformGTK in WebKit_LIBRARIES.
2458         * PlatformWin.cmake: Ditto.
2459
2460 2018-01-16  Alex Christensen  <achristensen@webkit.org>
2461
2462         Merge sync and async code paths for getting context menus
2463         https://bugs.webkit.org/show_bug.cgi?id=181423
2464
2465         Reviewed by Joseph Pecoraro.
2466
2467         What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
2468         This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
2469         There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
2470         case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!
2471
2472         * UIProcess/API/APIContextMenuClient.h:
2473         (API::ContextMenuClient::getContextMenuFromProposedMenu):
2474         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
2475         * UIProcess/API/C/WKPage.cpp:
2476         (WKPageSetPageContextMenuClient):
2477         * UIProcess/API/glib/WebKitContextMenuClient.cpp:
2478         * UIProcess/WebContextMenuProxy.h:
2479         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2480         (WebKit::WebContextMenuProxyGtk::show):
2481         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
2482         * UIProcess/gtk/WebContextMenuProxyGtk.h:
2483         * UIProcess/mac/WebContextMenuProxyMac.h:
2484         * UIProcess/mac/WebContextMenuProxyMac.mm:
2485         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
2486         (WebKit::WebContextMenuProxyMac::showContextMenu):
2487         * UIProcess/wpe/WebContextMenuProxyWPE.h:
2488
2489 2018-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>
2490
2491         Don't link WebKit target directly to JavaScriptCore
2492         https://bugs.webkit.org/show_bug.cgi?id=181688
2493
2494         Reviewed by Alex Christensen.
2495
2496         It's safer if we only link to the next lower-layered lib in the stack, so let's just link
2497         directly to WebCore instead.
2498
2499         And WPE doesn't need to specify it twice.
2500
2501         * CMakeLists.txt:
2502         * PlatformMac.cmake:
2503         * PlatformWPE.cmake:
2504
2505 2018-01-16  Eric Carlson  <eric.carlson@apple.com>
2506
2507         AVSampleBufferDisplayLayer should be flushed when application activates
2508         https://bugs.webkit.org/show_bug.cgi?id=181623
2509         <rdar://problem/36487738>
2510
2511         Reviewed by Darin Adler.
2512
2513         * WebProcess/WebPage/ios/WebPageIOS.mm:
2514         (WebKit::WebPage::applicationWillResignActive): Call page.
2515         (WebKit::WebPage::applicationDidEnterBackground): Ditto, let it call libWebRTCProvider.
2516         (WebKit::WebPage::applicationWillEnterForeground): Call page.
2517         (WebKit::WebPage::applicationDidBecomeActive): Ditto, let it call libWebRTCProvider.
2518
2519 2018-01-16  Zach Li  <zachli@apple.com>
2520
2521         Add pop-up policy support in website policies.
2522         https://bugs.webkit.org/show_bug.cgi?id=181544.
2523         rdar://problem/30521400.
2524
2525         Reviewed by Alex Christensen.
2526
2527         * Shared/WebsitePoliciesData.cpp: Encode and decode
2528         pop-up policy.
2529         (WebKit::WebsitePoliciesData::encode const):
2530         (WebKit::WebsitePoliciesData::decode):
2531         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2532         Apply the pop-up policy from website policies to the
2533         document loader.
2534
2535         * Shared/WebsitePoliciesData.h:
2536
2537         * Shared/WebsitePopUpPolicy.h:
2538         Added for declaring enum WebsitePopUpPolicy.
2539
2540         * UIProcess/API/APIWforebsitePolicies.cpp:
2541         Include pop-up policy in website policies.
2542         (API::WebsitePolicies::WebsitePolicies):
2543         (API::WebsitePolicies::data):
2544         * UIProcess/API/APIWebsitePolicies.h:
2545
2546         * UIProcess/API/C/WKWebsitePolicies.cpp:
2547         Added C API to get and set pop-up policy on
2548         website policies.
2549         (WKWebsitePoliciesGetPopUpPolicy):
2550         (WKWebsitePoliciesSetPopUpPolicy):
2551         * UIProcess/API/C/WKWebsitePolicies.h:
2552
2553         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2554         Added Obj-C API to get and set pop-up policy
2555         on website policies.
2556         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2557         (-[_WKWebsitePolicies setPopUpPolicy:]):
2558         (-[_WKWebsitePolicies popUpPolicy]):
2559
2560         * WebKit.xcodeproj/project.pbxproj:
2561         Added WebsitePopUpPolicy.h.
2562
2563 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2564
2565         [CMake][Mac] Fix the build errors
2566         https://bugs.webkit.org/show_bug.cgi?id=181665
2567
2568         Reviewed by Alex Christensen.
2569
2570         * CMakeLists.txt: Added TouchBarMenuData.cpp and TouchBarMenuItemData.cpp to compile.
2571         * PlatformMac.cmake: Added _WKApplicationManifest.mm, WKInspectorWKWebView.mm and WKInspectorWindow.mm to compile.
2572         * UIProcess/API/Cocoa/WKProcessPool.mm:
2573         (-[WKProcessPool _webPageContentProcessCount]): Call WebProcessPool::serviceWorkerProxy() only if ENABLE(SERVICE_WORKER).
2574
2575 2018-01-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2576
2577         [Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted
2578         https://bugs.webkit.org/show_bug.cgi?id=181638
2579         <rdar://problem/36508702>
2580
2581         Reviewed by Dan Bernstein.
2582
2583         Add a `source` parameter to the `didInsertAttachment` codepath for notifying WebKit2 clients when attachment
2584         elements are inserted into the document.
2585
2586         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2587         * UIProcess/API/Cocoa/WKWebView.mm:
2588         (-[WKWebView _didInsertAttachment:withSource:]):
2589         (-[WKWebView _didInsertAttachment:]): Deleted.
2590         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2591         * UIProcess/Cocoa/PageClientImplCocoa.h:
2592         * UIProcess/Cocoa/PageClientImplCocoa.mm:
2593         (WebKit::PageClientImplCocoa::didInsertAttachment):
2594         * UIProcess/PageClient.h:
2595         (WebKit::PageClient::didInsertAttachment):
2596         * UIProcess/WebPageProxy.cpp:
2597         (WebKit::WebPageProxy::didInsertAttachment):
2598         * UIProcess/WebPageProxy.h:
2599         * UIProcess/WebPageProxy.messages.in:
2600         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2601         (WebKit::WebEditorClient::didInsertAttachment):
2602         * WebProcess/WebCoreSupport/WebEditorClient.h:
2603
2604 2018-01-15  Youenn Fablet  <youenn@apple.com>
2605
2606         ASSERTION FAILED: m_ptr under WebKit::CacheStorage::Caches::writeRecord
2607         https://bugs.webkit.org/show_bug.cgi?id=181401
2608         <rdar://problem/36379022>
2609
2610         Reviewed by Darin Adler.
2611
2612         m_isInitialized is true but m_storage is set to nullptr when calling writeRecord.
2613         The only case seems to be if:
2614         - We are doing persistent storage
2615         - We are traversing the storage to do the initialization. At that point m_storage is set to a correct value.
2616         - clearMemoryRepresentation is called, thus setting m_storage to nullptr and m_isInitialized to false.
2617         We fix this by making clearMemoryRepresentation a no-op if we are initializing the caches.
2618         clearMemoryRepresentation is about cleaning the in-memory information of the caches and the memory representation is empty at init time.
2619         Nullifying m_storage is a memory consumption optimization.
2620
2621         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2622         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
2623
2624 2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2625
2626         Unreviewed, speculative build fix after r226899.
2627
2628         Add an empty implementation for PageClient::startDrag.
2629
2630         * UIProcess/PageClient.h:
2631         (WebKit::PageClient::startDrag):
2632
2633 2018-01-12  Brent Fulgham  <bfulgham@apple.com>
2634
2635         [iOS] Remove unneeded accessibility-related sandbox rules
2636         https://bugs.webkit.org/show_bug.cgi?id=181619
2637         <rdar://problem/36485356>
2638
2639         Reviewed by Eric Carlson.
2640
2641         Remove a number of sandbox exceptions that were in place for accessibility support. These are
2642         not needed in the WebContent process, since Safari (not WebKit) handles the accessibility
2643         interactions.
2644
2645         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2646
2647 2018-01-12  Keith Rollin  <krollin@apple.com>
2648
2649         Logged JSON should escape "'s and \'s in strings.
2650         https://bugs.webkit.org/show_bug.cgi?id=181608
2651
2652         Reviewed by Brent Fulgham.
2653
2654         * NetworkProcess/NetworkResourceLoader.cpp:
2655         (WebKit::NetworkResourceLoader::logCookieInformation const):
2656
2657 2018-01-12  Megan Gardner  <megan_gardner@apple.com>
2658
2659         Unreviewed, fixing error in UIKitSPI.h.
2660
2661         * Platform/spi/ios/UIKitSPI.h:
2662         
2663 2018-01-12  Megan Gardner  <megan_gardner@apple.com>
2664
2665         Implement MultiDocument protocol for restoring focus to a WKWebView
2666         https://bugs.webkit.org/show_bug.cgi?id=181510
2667
2668         Reviewed by Dan Bernstein.
2669
2670         Support the UIKit protocol for restoring focus to a what previously had focus.
2671         WebKit already knows what node was previously being focused by the DOM, we merely
2672         need to be asked to turn the focus on again.
2673         Resubmitting https://trac.webkit.org/changeset/226826 as it broke internal builds
2674
2675         * Platform/spi/ios/UIKitSPI.h:
2676         * UIProcess/ios/WKContentViewInteraction.h:
2677         * UIProcess/ios/WKContentViewInteraction.mm:
2678         (-[WKContentView _restoreFocusWithToken:]):
2679         (-[WKContentView _preserveFocusWithToken:destructively:]):
2680
2681 2018-01-12  Youenn Fablet  <youenn@apple.com>
2682
2683         WebProcess should pass the registration identifier and not the worker identifier for fetch events
2684         https://bugs.webkit.org/show_bug.cgi?id=181591
2685
2686         Reviewed by Chris Dumez.
2687
2688         Use service worker registration identifier to compute the active service worker identifier responsible to handle the fetch event.
2689
2690         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2691         (WebKit::WebSWServerConnection::startFetch):
2692         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2693         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2694         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2695         (WebKit::ServiceWorkerClientFetch::start):
2696         * WebProcess/Storage/WebSWClientConnection.cpp:
2697         (WebKit::WebSWClientConnection::startFetch):
2698         * WebProcess/Storage/WebSWClientConnection.h:
2699         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2700         (WebKit::shouldHandleFetch):
2701
2702 2018-01-12  Ryan Haddad  <ryanhaddad@apple.com>
2703
2704         Unreviewed, rolling out r226826.
2705
2706         Breaks internal builds.
2707
2708         Reverted changeset:
2709
2710         "Implement MultiDocument protocol for restoring focus to a
2711         WKWebView"
2712         https://bugs.webkit.org/show_bug.cgi?id=181510
2713         https://trac.webkit.org/changeset/226826
2714
2715 2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2716
2717         [WK2] Unify macOS and iOS codepaths in the UI process when starting a drag
2718         https://bugs.webkit.org/show_bug.cgi?id=181574
2719
2720         Reviewed by Tim Horton.
2721
2722         Rearrange some macOS drag start logic in the UI process so that it uses the same codepaths in WebPageProxy as
2723         iOS. Namely, startDrag should just forward the DragItem and drag image handle along to the appropriate views on
2724         each platform (WKContentView and WebViewImpl).
2725
2726         There should be no change in behavior.
2727
2728         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2729
2730         Both macOS and iOS now funnel through this method.
2731
2732         * UIProcess/Cocoa/WebViewImpl.h:
2733         * UIProcess/Cocoa/WebViewImpl.mm:
2734         (WebKit::WebViewImpl::startDrag):
2735         (WebKit::WebViewImpl::dragImageForView): Deleted.
2736
2737         Rename dragImageForView to startDrag. Move the call to didStartDrag() here, and call dragCancelled() in the
2738         case where we bailed from starting the drag (due to failing to create a drag image).
2739
2740         * UIProcess/PageClient.h:
2741         * UIProcess/ios/PageClientImplIOS.h:
2742         * UIProcess/ios/PageClientImplIOS.mm:
2743         (WebKit::PageClientImpl::setDragImage): Deleted.
2744
2745         Rename setDragImage to startDrag.
2746
2747         * UIProcess/mac/PageClientImplMac.h:
2748         * UIProcess/mac/PageClientImplMac.mm:
2749         (WebKit::PageClientImpl::startDrag):
2750         (WebKit::PageClientImpl::setDragImage): Deleted.
2751         * UIProcess/mac/WebPageProxyMac.mm:
2752         (WebKit::WebPageProxy::startDrag): Deleted.
2753
2754 2018-01-12  Antoine Quint  <graouts@apple.com>
2755
2756         Add support for the frames() timing function
2757         https://bugs.webkit.org/show_bug.cgi?id=181585
2758         <rdar://problem/36463317>
2759
2760         Reviewed by Dean.
2761
2762         Add the ability to endode and decode the frames() timing function.
2763
2764         * Shared/WebCoreArgumentCoders.cpp:
2765         (IPC::ArgumentCoder<FramesTimingFunction>::encode):
2766         (IPC::ArgumentCoder<FramesTimingFunction>::decode):
2767         * Shared/WebCoreArgumentCoders.h:
2768         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2769         (WebKit::PlatformCAAnimationRemote::Properties::encode const):
2770         (WebKit::PlatformCAAnimationRemote::Properties::decode):
2771
2772 2018-01-11  Keith Miller  <keith_miller@apple.com>
2773
2774         Rename ENABLE_ASYNC_ITERATION to ENABLE_JS_ASYNC_ITERATION
2775         https://bugs.webkit.org/show_bug.cgi?id=181573
2776
2777         Reviewed by Simon Fraser.
2778
2779         * Configurations/FeatureDefines.xcconfig:
2780
2781 2018-01-11  Brent Fulgham  <bfulgham@apple.com>
2782
2783         REGRESSION(r219530): ResourceLoadStatisticsPersistentStorage should be read-only in ephemeral sessions
2784         https://bugs.webkit.org/show_bug.cgi?id=181136
2785         <rdar://problem/36116604>
2786
2787         Reviewed by Chris Dumez.
2788
2789         Some uses of WebKit involve running a UIProcess as an ephemeral session for the life of the process. In this
2790         case, we do not initialize the data path for the set of load statistics triggering an assertion.
2791
2792         We actually intended ephemeral sessions to consume the existing resource load data (presumably captured during
2793         non-ephemeral browsing). This would be a read-only mode, where it would not add new entries to the load
2794         statistics, but would take advantage of existing observations. Currently that does not happen (for this type
2795         of WebKit embed), which forces each run as an ephemeral session to build up in-memory browsing data until it has
2796         enough observations to begin modifying loads.
2797
2798         We need to set the ResourceLoadStatisticsPersistentStorage object to a "read only" mode in this case, so
2799         that it read (but does not write) from this database.
2800
2801         Tested by ephemeral website data TestWebKitAPI tests.
2802
2803         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2804         (WebKit::ResourceLoadStatisticsPersistentStorage::create): Added to allow creation of the right style of
2805         Persistent Storage.
2806         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): Initialize the
2807         new data member.
2808         (WebKit::ResourceLoadStatisticsPersistentStorage::asyncWriteTimerFired): RELEASE_ASSERT that we never run
2809         this method when in "read only" mode.
2810         (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk): Ditto.
2811         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore): Return early if asked to
2812         schedule a write operation for a "read only" persistent store.
2813         (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously): RELEASE_ASSERT if we
2814         ever shut down in "read only" mode with an active write timer.
2815         * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
2816         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2817         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Pass a flag indicating whether the
2818         storage session is ephemeral or not.
2819         * UIProcess/WebResourceLoadStatisticsStore.h:
2820
2821 2018-01-11  Keith Rollin  <krollin@apple.com>
2822
2823         Add optional logging of ITP-related user interaction information
2824         https://bugs.webkit.org/show_bug.cgi?id=181556
2825
2826         Reviewed by Brent Fulgham.
2827
2828         In order to support the tracking of the efficacy of Intelligent
2829         Tracking Protection, add some logging indicating when the user
2830         interacts with a page in a way that affects cookie partitioning. This
2831         logging is off by default, and is enabled with `defaults write -g
2832         WebKitLogCookieInformation -bool true`.
2833
2834         * Shared/WebProcessCreationParameters.cpp:
2835         (WebKit::WebProcessCreationParameters::encode const):
2836         (WebKit::WebProcessCreationParameters::decode):
2837         * Shared/WebProcessCreationParameters.h:
2838         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2839         (WebKit::WebProcessPool::platformInitializeWebProcess):
2840         * WebProcess/WebProcess.cpp:
2841         (WebKit::WebProcess::initializeWebProcess):
2842
2843 2018-01-11  Megan Gardner  <megan_gardner@apple.com>
2844
2845         Implement MultiDocument protocol for restoring focus to a WKWebView
2846         https://bugs.webkit.org/show_bug.cgi?id=181510
2847
2848         Reviewed by Dan Bernstein.
2849
2850         Support the UIKit protocol for restoring focus to a what previously had focus.
2851         WebKit already has a method to silently remove and replace focus, without telling the
2852         web process about the unfocus and refocusing, so we're just using that.
2853
2854         * Platform/spi/ios/UIKitSPI.h:
2855         * UIProcess/ios/WKContentViewInteraction.h:
2856         * UIProcess/ios/WKContentViewInteraction.mm:
2857         (-[WKContentView _restoreFocusWithToken:]):
2858         (-[WKContentView _preserveFocusWithToken:destructively:]):
2859
2860
2861 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2862
2863         Don't load inline data when requesting info for an attachment element backed by a file path
2864         https://bugs.webkit.org/show_bug.cgi?id=181550
2865
2866         Reviewed by Tim Horton
2867
2868         See WebCore/ChangeLog for more information.
2869
2870         * UIProcess/API/Cocoa/_WKAttachment.mm:
2871         (-[_WKAttachmentInfo initWithInfo:]):
2872         (-[_WKAttachmentInfo fileLoadingError]):
2873         (-[_WKAttachment requestInfo:]):
2874
2875 2018-01-11  Commit Queue  <commit-queue@webkit.org>
2876
2877         Unreviewed, rolling out r226789 and r226794.
2878         https://bugs.webkit.org/show_bug.cgi?id=181564
2879
2880         broke API tests (Requested by alexchristensen on #webkit).
2881
2882         Reverted changesets:
2883
2884         "Merge sync and async code paths for getting context menus"
2885         https://bugs.webkit.org/show_bug.cgi?id=181423
2886         https://trac.webkit.org/changeset/226789
2887
2888         "Revert changes accidentally committed with r226789."
2889         https://bugs.webkit.org/show_bug.cgi?id=181423
2890         https://trac.webkit.org/changeset/226794
2891
2892 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2893
2894         Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareToDragPromisedBlob
2895         https://bugs.webkit.org/show_bug.cgi?id=181497
2896
2897         Reviewed by Tim Horton.
2898
2899         Refactor drag and drop support for promised blob data, so that blob info is shipped across to the client layer
2900         via DragItem in the DragClient::startDrag codepath, rather than via a separate prepareToDragPromisedBlob client
2901         codepath that stages promised blob info.
2902
2903         * UIProcess/Cocoa/WebViewImpl.h:
2904         * UIProcess/Cocoa/WebViewImpl.mm:
2905         (WebKit::WebViewImpl::prepareToDragPromisedBlob): Deleted.
2906         * UIProcess/PageClient.h:
2907         (WebKit::PageClient::prepareToDragPromisedBlob): Deleted.
2908         * UIProcess/WebPageProxy.cpp:
2909         (WebKit::WebPageProxy::prepareToDragPromisedBlob): Deleted.
2910         * UIProcess/WebPageProxy.h:
2911         * UIProcess/WebPageProxy.messages.in:
2912         * UIProcess/ios/PageClientImplIOS.h:
2913         * UIProcess/ios/PageClientImplIOS.mm:
2914         (WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
2915         * UIProcess/ios/WKContentViewInteraction.h:
2916         * UIProcess/ios/WKContentViewInteraction.mm:
2917         (-[WKContentView _startDrag:item:]):
2918         * UIProcess/mac/PageClientImplMac.h:
2919         * UIProcess/mac/PageClientImplMac.mm:
2920         (WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
2921         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2922         (WebKit::WebDragClient::prepareToDragPromisedBlob): Deleted.
2923         * WebProcess/WebCoreSupport/WebDragClient.h:
2924         * WebProcess/WebPage/WebPage.cpp:
2925         (WebKit::WebPage::prepareToDragPromisedBlob): Deleted.
2926         * WebProcess/WebPage/WebPage.h:
2927
2928 2018-01-09  Per Arne Vollan  <pvollan@apple.com>
2929
2930         VoiceOver does not work when the WebContent process is using NSRunLoop.
2931         https://bugs.webkit.org/show_bug.cgi?id=181331
2932         <rdar://problem/36408004>
2933
2934         Reviewed by Brent Fulgham.
2935
2936         When the WebContent process is using NSRunLoop instead of the NSApplication run loop,
2937         accessibility must be initialized for VoiceOver to work. This patch also switches to
2938         using NSRunLoop in the WebContent process.
2939
2940         * Configurations/WebContentService.xcconfig:
2941         * Platform/IPC/mac/ConnectionMac.mm:
2942         (IPC::AccessibilityProcessSuspendedNotification): Remove unneccessary workaround.
2943         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Switch to NSRunLoop.
2944         * WebProcess/cocoa/WebProcessCocoa.mm:
2945         (WebKit::WebProcess::platformInitializeProcess): Initialize accessibility.
2946
2947 2018-01-11  Don Olmstead  <don.olmstead@sony.com>
2948
2949         WebContextMenuListenerProxy.cpp not including config on first line
2950         https://bugs.webkit.org/show_bug.cgi?id=181552
2951
2952         Reviewed by Alex Christensen.
2953
2954         * UIProcess/WebContextMenuListenerProxy.cpp:
2955
2956 2018-01-11  Youenn Fablet  <youenn@apple.com>
2957
2958         Redirected iframe loading with Request.redirect=follow should fail
2959         https://bugs.webkit.org/show_bug.cgi?id=181491
2960
2961         Reviewed by Alex Christensen.
2962
2963         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2964         (WebKit::ServiceWorkerClientFetch::validateResponse):
2965
2966 2018-01-11  Youenn Fablet  <youenn@apple.com>
2967
2968         Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legacy flag by default
2969         https://bugs.webkit.org/show_bug.cgi?id=181480
2970
2971         Reviewed by Eric Carlson.
2972
2973         Renaming preference to WebRTCLegacyAPIEnabled for simplification and removing it from experimental feature.
2974         Set it to off by default.
2975
2976         * Shared/WebPreferences.yaml:
2977         * UIProcess/API/C/WKPreferences.cpp:
2978         (WKPreferencesSetWebRTCLegacyAPIEnabled):
2979         (WKPreferencesGetWebRTCLegacyAPIEnabled):
2980         * UIProcess/API/Cocoa/WKPreferences.mm:
2981         (-[WKPreferences _webRTCLegacyAPIEnabled]):
2982         (-[WKPreferences _setWebRTCLegacyAPIEnabled:]):
2983         * UIProcess/WebProcessPool.cpp:
2984         (WebKit::WebProcessPool::ensureNetworkProcess):
2985         * WebProcess/WebPage/WebPage.cpp:
2986         (WebKit::WebPage::updatePreferences):
2987
2988 2018-01-11  Alex Christensen  <achristensen@webkit.org>
2989
2990         Merge sync and async code paths for getting context menus
2991         https://bugs.webkit.org/show_bug.cgi?id=181423
2992
2993         Reviewed by Joseph Pecoraro.
2994
2995         What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
2996         This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
2997         There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
2998         case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!
2999
3000         * UIProcess/API/APIContextMenuClient.h:
3001         (API::ContextMenuClient::getContextMenuFromProposedMenu):
3002         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
3003         * UIProcess/API/C/WKPage.cpp:
3004         (WKPageSetPageContextMenuClient):
3005         * UIProcess/API/glib/WebKitContextMenuClient.cpp:
3006         * UIProcess/WebContextMenuProxy.h:
3007         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3008         (WebKit::WebContextMenuProxyGtk::show):
3009         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
3010         * UIProcess/gtk/WebContextMenuProxyGtk.h:
3011         * UIProcess/mac/WebContextMenuProxyMac.h:
3012         * UIProcess/mac/WebContextMenuProxyMac.mm:
3013         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
3014         (WebKit::WebContextMenuProxyMac::showContextMenu):
3015         * UIProcess/wpe/WebContextMenuProxyWPE.h:
3016
3017 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3018
3019         [Attachment Support] Support dragging attachment elements out as files on iOS
3020         https://bugs.webkit.org/show_bug.cgi?id=181199
3021         <rdar://problem/36299316>
3022
3023         Reviewed by Tim Horton, Andy Estes and Joseph Pecoraro.
3024
3025         Implement support for registering and beginning a drag with promised blob info. See below for more detail.
3026
3027         * UIProcess/ios/WKContentViewInteraction.mm:
3028         (-[WKDragSessionContext addTemporaryDirectory:]):
3029         (-[WKDragSessionContext cleanUpTemporaryDirectories]):
3030
3031         Introduce WKDragSessionContext, which represents the localContext of a UIDragSession initiated in WebKit. The
3032         blob promise dragging codepath uses this to register temporary directories when saving blob data to a location
3033         on disk; when all data transfers are finished, or if the drag interaction is being reset, we then use
3034         -cleanUpTemporaryDirectories to remove each temporary directory.
3035
3036         (existingLocalDragSessionContext):
3037         (ensureLocalDragSessionContext):
3038
3039         Helper methods to set the UIDragSession's localContext to a WKDragSessionContext and query for any existing
3040         context.
3041
3042         (-[WKContentView cleanupInteraction]):
3043
3044         Before the content view's UIDragInteraction goes away, clean up any temporary directories added to the
3045         UIDragSession.
3046
3047         (-[WKContentView _prepareToDragPromisedBlob:]):
3048
3049         When dragging with a promised blob, register a new item provider on the pasteboard representing the blob data,
3050         along with any additional metadata associated with the blob. For the promise callback, call out to the network
3051         process to write the blob data to a temporary path; when done, call the NSItemProvider's completion handler with
3052         the temporary blob data location.
3053
3054         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
3055         (-[WKContentView dragInteraction:sessionDidTransferItems:]):
3056
3057         Use this delegate hook as an opportunity to remove any temporary directories created when promised blob data is
3058         requested upon drop. Since we know the drag session that has finished transferring data, we simply ask its local
3059         context (a WKDragSessionContext) to remove any temporary filepaths it has created.
3060
3061 2018-01-10  Jeff Miller  <jeffm@apple.com>
3062
3063         -[WKWebView _web_gestureEventWasNotHandledByWebCore:] should call -_gestureEventWasNotHandledByWebCore:
3064         https://bugs.webkit.org/show_bug.cgi?id=181498
3065
3066         Reviewed by Alex Christensen.
3067
3068         WKView's API contract allows clients to override -_gestureEventWasNotHandledByWebCore:, and -[WKView
3069         _web_gestureEventWasNotHandledByWebCore:] calls -_gestureEventWasNotHandledByWebCore: instead of
3070         invoking WebViewImpl::gestureEventWasNotHandledByWebCoreFromViewOnly() directly. WKWebView should do
3071         the same thing.
3072
3073         * UIProcess/API/Cocoa/WKWebView.mm:
3074         (-[WKWebView _web_gestureEventWasNotHandledByWebCore:]):
3075         Call -_gestureEventWasNotHandledByWebCore:, which will call gestureEventWasNotHandledByWebCoreFromViewOnly().
3076
3077 2018-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
3078
3079         REGRESSION(r222507): Composition highlight doesn't render when using IME
3080         https://bugs.webkit.org/show_bug.cgi?id=181485
3081         <rdar://problem/35896516>
3082
3083         Reviewed by Ryosuke Niwa.
3084
3085         Add plumbing for a `suppressUnderline` argument when setting marked text.
3086
3087         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3088         (WKBundlePageSetComposition):
3089         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
3090         * WebProcess/WebPage/WebPage.cpp:
3091         (WebKit::WebPage::setCompositionForTesting):
3092         * WebProcess/WebPage/WebPage.h:
3093
3094 2018-01-10  Tim Horton  <timothy_horton@apple.com>
3095
3096         REGRESSION (r213590): Swipe from edge to go to previous page is significantly slower than tapping back button on Twitter
3097         https://bugs.webkit.org/show_bug.cgi?id=181269
3098         <rdar://problem/35110344>
3099
3100         Reviewed by Simon Fraser.
3101
3102         * UIProcess/API/Cocoa/WKWebView.mm:
3103         (-[WKWebView _processDidExit]):
3104         (-[WKWebView _didCommitLayerTree:]):
3105         When swiping to a page that set history.scrollRestoration = "manual",
3106         we will never restore the scroll position. We will still restore
3107         "state", but won't have a location. Currently, the code assumes that
3108         it should wait to remove the swipe snapshot until the scroll position
3109         is restored. Instead, wait until the "state" is restored, whether
3110         or not that includes a scroll position/center point restoration.
3111
3112         Do this by making _firstTransactionIDAfterPageRestore an optional,
3113         and reset it after it fires, so that we only run the restoration code
3114         in _didCommitLayerTree for the first commit after state restoration,
3115         not all subsequent commits. Then, tell ViewGestureController that
3116         the scroll position has been restored even if the page opted out.
3117
3118         The reason that this is specific to pushState is that normal,
3119         non-same-document loads bail from waiting for the scroll position
3120         restoration in VGC::didReachMainFrameLoadTerminalState() (see the long
3121         comment there for an explanation).
3122
3123         (-[WKWebView _beginBackSwipeForTesting]):
3124         (-[WKWebView _completeBackSwipeForTesting]):
3125         * Platform/spi/ios/UIKitSPI.h:
3126         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3127         * UIProcess/Cocoa/ViewGestureController.h:
3128         * UIProcess/ios/ViewGestureControllerIOS.mm:
3129         (-[WKSwipeTransitionController transitionForDirection:]):
3130         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
3131         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
3132         * UIProcess/mac/ViewGestureControllerMac.mm:
3133         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
3134         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
3135         Add a mechanism to forcefully test swipe back. Instead of simulating
3136         events like on Mac, we just talk to the UIKit internals and force
3137         the interaction to start, pause, and then complete when we want.
3138
3139 2018-01-10  Brent Fulgham  <bfulgham@apple.com>
3140
3141         Use protectedThis for the 'updatePrevalentDomainsToPartitionOrBlockCookies' lambda
3142         https://bugs.webkit.org/show_bug.cgi?id=181452
3143         <rdar://problem/36416912>
3144         
3145         Reviewed by Chris Dumez.
3146
3147         We forgot to use a 'protectedThis' back in r225006 for one of the lambdas used by
3148         the WebsiteDataStore for processing.
3149
3150         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3151         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
3152
3153 2018-01-09  John Wilander  <wilander@apple.com>
3154
3155         Storage Access API: Turn feature on by default in WebPreferences.yaml
3156         https://bugs.webkit.org/show_bug.cgi?id=181458
3157
3158         Reviewed by Brent Fulgham.
3159
3160         * Shared/WebPreferences.yaml:
3161
3162 2018-01-09  Alex Christensen  <achristensen@webkit.org>
3163
3164         WKOpenPanelParameters SPI should return autoreleased objects
3165         https://bugs.webkit.org/show_bug.cgi?id=181457
3166         <rdar://problem/35884960>
3167
3168         Reviewed by Tim Horton.
3169
3170         In r226607 I made a mistake by returning an object that has been released.
3171         I instead follow a pattern of leaking and autoreleasing that we use elsewhere in the ObjC API.
3172
3173         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
3174         (-[WKOpenPanelParameters _acceptedMIMETypes]):
3175         (-[WKOpenPanelParameters _acceptedFileExtensions]):
3176
3177 2018-01-09  Dan Bernstein  <mitz@apple.com>
3178
3179         Removed some empty directories that were left behind
3180
3181         * WebProcess/Cookies/cf: Removed.
3182         * WebProcess/ios: Removed.
3183
3184 2018-01-09  Paul Knight  <pknight@apple.com>
3185
3186         Don't record dynamic spelling corrections while in an ephemeral browsing session
3187         https://bugs.webkit.org/show_bug.cgi?id=181417
3188         <rdar://problem/33309104>
3189
3190         Dynamic spelling correction responses are kept on disk. Avoid recording
3191         these responses when in an ephemeral session.
3192
3193         Reviewed by Tim Horton and Wenson Hsieh.
3194
3195         * UIProcess/mac/CorrectionPanel.h:
3196         * UIProcess/mac/CorrectionPanel.mm:
3197         (WebKit::CorrectionPanel::recordAutocorrectionResponse):
3198             Add a WebViewImpl parameter so we can query the current session.
3199             Return early before recording the response if the session is
3200             ephemeral.
3201         (WebKit::CorrectionPanel::handleAcceptedReplacement):
3202             Update a caller to include the new parameter.
3203         * UIProcess/mac/PageClientImplMac.mm:
3204         (WebKit::PageClientImpl::recordAutocorrectionResponse):
3205             Ditto.
3206
3207 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3208
3209         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.5 release.
3210
3211         * gtk/NEWS: Add release notes for 2.19.5.
3212
3213 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3214
3215         [GTK] Missing symbols exported in 2.19.4
3216         https://bugs.webkit.org/show_bug.cgi?id=181433
3217
3218         Reviewed by Michael Catanzaro.
3219
3220         Add missing WEBKIT_API to webkit_dom_dom_window_webkit_message_handlers_post_message().
3221
3222         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
3223         * webkitglib-symbols.map: Remove webkit_media_player_debug from local.
3224
3225 2018-01-09  Youenn Fablet  <youenn@apple.com>
3226
3227         SWClientConnection should not keep references to service worker jobs
3228         https://bugs.webkit.org/show_bug.cgi?id=181381
3229
3230         Reviewed by Chris Dumez.
3231
3232         Updated IPC handling based on WebCore refactoring.
3233
3234         * Scripts/webkit/messages.py:
3235         (forward_declarations_and_headers):
3236         (headers_for_type):
3237         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3238         (WebKit::WebSWServerConnection::rejectJobInClient):
3239         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
3240         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
3241         (WebKit::WebSWServerConnection::startScriptFetchInClient):
3242         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3243         * WebProcess/Storage/WebSWClientConnection.messages.in:
3244
3245 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3246
3247         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.4 release.
3248
3249         * gtk/NEWS: Add release notes for 2.19.4.
3250
3251 2018-01-09  Ali Juma  <ajuma@chromium.org>
3252
3253         Implement VisualViewport API events
3254         https://bugs.webkit.org/show_bug.cgi?id=179386
3255
3256         Reviewed by Frédéric Wang.
3257
3258         Change the default value of the VisualViewportAPI experimental feature flag to
3259         DEFAULT_EXPERIMENTAL_FEATURES_ENABLED. This patch completes the implementation
3260         of this feature as specified by https://wicg.github.io/visual-viewport/, so this
3261         feature is now ready for wider testing.
3262
3263         * Shared/WebPreferences.yaml:
3264
3265 2018-01-08  Alex Christensen  <achristensen@webkit.org>
3266
3267         Add WKNavigationDelegate SPI exposing WebProcess crash reason
3268         https://bugs.webkit.org/show_bug.cgi?id=181410
3269         <rdar://problem/36167199>
3270
3271         Reviewed by Wenson Hsieh.
3272
3273         We exposed it in the C SPI.
3274
3275         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3276         * UIProcess/Cocoa/NavigationState.h:
3277         * UIProcess/Cocoa/NavigationState.mm:
3278         (WebKit::NavigationState::setNavigationDelegate):
3279         (WebKit::toWKProcessTerminationReason):
3280         (WebKit::NavigationState::NavigationClient::processDidTerminate):
3281
3282 2018-01-08  Alex Christensen  <achristensen@webkit.org>
3283
3284         Make ObjC SPI equivalent to WKPageNavigationClient.decidePolicyForPluginLoad
3285         https://bugs.webkit.org/show_bug.cgi?id=181413
3286         <rdar://problem/36169005>
3287
3288         Reviewed by Wenson Hsieh.
3289
3290         * UIProcess/API/APINavigationClient.h:
3291         (API::NavigationClient::decidePolicyForPluginLoad):
3292         * UIProcess/API/C/WKPage.cpp:
3293         (WKPageSetPageNavigationClient):
3294         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3295         * UIProcess/Cocoa/NavigationState.h:
3296         * UIProcess/Cocoa/NavigationState.mm:
3297         (WebKit::NavigationState::setNavigationDelegate):
3298         (WebKit::toPluginModuleLoadPolicy):
3299         (WebKit::toWKPluginModuleLoadPolicy):
3300         (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
3301         * UIProcess/WebPageProxy.cpp:
3302         (WebKit::WebPageProxy::findPlugin):
3303
3304 2018-01-08  Ryosuke Niwa  <rniwa@webkit.org>
3305
3306         iOS build fix attempt after r226602.
3307
3308         * UIProcess/API/C/WKContextMenuListener.cpp:
3309         (WKContextMenuListenerUseContextMenuItems):
3310
3311 2018-01-08  Alex Christensen  <achristensen@webkit.org>
3312
3313         Add SPI for WKOpenPanelParameters._acceptedMIMETypes and _acceptedFileExtensions
3314         https://bugs.webkit.org/show_bug.cgi?id=181408
3315         <rdar://problem/35884960>
3316
3317         Reviewed by Tim Horton.
3318
3319         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
3320         (-[WKOpenPanelParameters _acceptedMIMETypes]):
3321         (-[WKOpenPanelParameters _acceptedFileExtensions]):
3322         * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
3323         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h: Added.
3324         * WebKit.xcodeproj/project.pbxproj:
3325
3326 2018-01-08  Commit Queue  <commit-queue@webkit.org>
3327
3328         Unreviewed, rolling out r226532 and r226540.
3329         https://bugs.webkit.org/show_bug.cgi?id=181422
3330
3331         jessie says basic browsing does not seem to work (Requested by
3332         alexchristensen on #webkit).
3333
3334         Reverted changesets:
3335
3336         "Add CSP support to service workers"
3337         https://bugs.webkit.org/show_bug.cgi?id=181385
3338         https://trac.webkit.org/changeset/226532
3339
3340         "SWClientConnection should not keep references to service
3341         worker jobs"
3342         https://bugs.webkit.org/show_bug.cgi?id=181381
3343         https://trac.webkit.org/changeset/226540
3344
3345 2018-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3346
3347         [Attachment Support] Expose file name and content type of WKAttachment
3348         https://bugs.webkit.org/show_bug.cgi?id=181390
3349         <rdar://problem/36336837>
3350
3351         Reviewed by Tim Horton.
3352
3353         Add support for -[_WKAttachment requestInfo:], which fetches a snapshot of the attachment's state. This API is
3354         meant to be a replacement for -requestData: that provides additional metadata about the attachment.
3355
3356         * Scripts/webkit/messages.py:
3357         (headers_for_type):
3358         * Shared/WebCoreArgumentCoders.cpp:
3359         (IPC::ArgumentCoder<AttachmentInfo>::encode):
3360         (IPC::ArgumentCoder<AttachmentInfo>::decode):
3361         * Shared/WebCoreArgumentCoders.h:
3362
3363         Add IPC support for AttachmentInfo. Note that instead of using (encode|decode)SharedBuffer, we send and receive
3364         data references to the shared buffer.
3365
3366         * UIProcess/API/APIAttachment.cpp:
3367         (API::Attachment::requestInfo):
3368         (API::Attachment::requestData): Deleted.
3369         * UIProcess/API/APIAttachment.h:
3370
3371         Change requestData to requestInfo.
3372
3373         * UIProcess/API/Cocoa/_WKAttachment.h:
3374         * UIProcess/API/Cocoa/_WKAttachment.mm:
3375         (-[_WKAttachmentInfo initWithInfo:]):
3376         (-[_WKAttachmentInfo data]):
3377         (-[_WKAttachmentInfo name]):
3378         (-[_WKAttachmentInfo filePath]):
3379         (-[_WKAttachmentInfo contentType]):
3380         (-[_WKAttachment requestInfo:]):
3381         (-[_WKAttachment requestData:]):
3382
3383         Implement -requestInfo: by calling into APIAttachment, and reimplement -requestData: in terms of -requestInfo:.
3384
3385         * UIProcess/WebPageProxy.cpp:
3386         (WebKit::WebPageProxy::attachmentInfoCallback):
3387         (WebKit::WebPageProxy::requestAttachmentInfo):
3388         (WebKit::WebPageProxy::sharedBufferCallback): Deleted.
3389         (WebKit::WebPageProxy::requestAttachmentData): Deleted.
3390         * UIProcess/WebPageProxy.h:
3391         * UIProcess/WebPageProxy.messages.in:
3392
3393         Rename the SharedBufferCallback IPC message to AttachmentInfoCallback, and make it conditional on
3394         ATTACHMENT_ELEMENT. Rename requestAttachmentData to requestAttachmentInfo.
3395
3396         * WebProcess/WebPage/WebPage.cpp:
3397         (WebKit::WebPage::requestAttachmentInfo):
3398         (WebKit::WebPage::invokeSharedBufferCallback): Deleted.
3399         (WebKit::WebPage::requestAttachmentData): Deleted.
3400
3401         Rename requestAttachmentData to requestAttachmentInfo and adopt HTMLAttachmentElement::requestInfo.
3402
3403         * WebProcess/WebPage/WebPage.h:
3404         * WebProcess/WebPage/WebPage.messages.in:
3405
3406 2018-01-08  Alex Christensen  <achristensen@webkit.org>
3407
3408         Pass around Vector<Ref<WebContextMenuItem>> instead of WKArrayRef or Vector<WebContextMenuItemData>
3409         https://bugs.webkit.org/show_bug.cgi?id=181419
3410
3411         Reviewed by Tim Horton.
3412
3413         Passing a WKArrayRef to an API object is messy and was preventing me from moving things around and making ObjC SPI.
3414         No change in behavior.  Just using different layering abstractions for the same data.
3415
3416         * UIProcess/API/C/WKContextMenuListener.cpp:
3417         (WKContextMenuListenerUseContextMenuItems):
3418         * UIProcess/WebContextMenuListenerProxy.cpp:
3419         (WebKit::WebContextMenuListenerProxy::useContextMenuItems):
3420         * UIProcess/WebContextMenuListenerProxy.h:
3421         * UIProcess/WebContextMenuProxy.h:
3422         * UIProcess/mac/WebContextMenuProxyMac.h:
3423         * UIProcess/mac/WebContextMenuProxyMac.mm:
3424         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
3425         (WebKit::WebContextMenuProxyMac::showContextMenu):
3426
3427 2018-01-08  John Wilander  <wilander@apple.com>
3428
3429         Storage Access API: Remove access for all frames under a page when the page is closed
3430         https://bugs.webkit.org/show_bug.cgi?id=181398
3431         <rdar://problem/36357879>
3432
3433         Reviewed by Alex Christensen.
3434
3435         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3436         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
3437         * NetworkProcess/NetworkConnectionToWebProcess.h:
3438         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3439         * WebProcess/WebPage/WebPage.cpp:
3440         (WebKit::WebPage::close):
3441
3442 2018-01-08  Youenn Fablet  <youenn@apple.com>
3443
3444         SWClientConnection should not keep references to service worker jobs
3445         https://bugs.webkit.org/show_bug.cgi?id=181381
3446
3447         Reviewed by Chris Dumez.
3448
3449         Updated IPC handling based on WebCore refactoring.
3450
3451         * Scripts/webkit/messages.py:
3452         (forward_declarations_and_headers):
3453         (headers_for_type):
3454         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3455         (WebKit::WebSWServerConnection::rejectJobInClient):
3456         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
3457         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
3458         (WebKit::WebSWServerConnection::startScriptFetchInClient):
3459         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3460         * WebProcess/Storage/WebSWClientConnection.messages.in:
3461
3462 2018-01-08  Joseph Pecoraro  <pecoraro@apple.com>
3463
3464         [Cocoa] Web Inspector: Provide a way for clients to check if an NSWindow is a Web Inspector window
3465         https://bugs.webkit.org/show_bug.cgi?id=181361
3466         <rdar://problem/36332865>
3467
3468         Reviewed by Darin Adler.
3469
3470         * WebKit.xcodeproj/project.pbxproj:
3471         New files.
3472
3473         * Shared/API/Cocoa/_WKNSWindowExtras.h: Added.
3474         * Shared/API/Cocoa/_WKNSWindowExtras.mm: Added.
3475         (-[NSWindow _web_isWebInspectorWindow]):
3476         Method to determing if a window is being used for Web Inspector content.
3477
3478         * UIProcess/mac/WKInspectorWindow.h: Added.
3479         * UIProcess/mac/WKInspectorWindow.mm: Added.
3480         Named subclass so we can use isKindOfClass.
3481
3482         * UIProcess/mac/WebInspectorProxyMac.mm:
3483         (WebKit::WebInspectorProxy::createFrontendWindow):
3484         Use the named subclass.
3485
3486 2018-01-08  Tim Horton  <timothy_horton@apple.com>
3487
3488         Build fix for WKPDFView
3489         https://bugs.webkit.org/show_bug.cgi?id=181399
3490         <rdar://problem/36311915>
3491
3492         Reviewed by Simon Fraser.
3493
3494         * UIProcess/ios/WKPDFView.mm:
3495         Disable deprecation warnings in this whole file.
3496
3497 2018-01-08  Youenn Fablet  <youenn@apple.com>
3498
3499         Caches::writeCachesToDisk should assert that it is initialized