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