Roll r208589 back in. The rollout will be on the Safari-603.1.13.1 tag. rdar://proble...
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-11-28  Ryan Haddad  <ryanhaddad@apple.com>
2
3         Unreviewed, rolling out r209008.
4
5         This change appears to have caused two fast/mediastrem
6         LayoutTests to fail.
7
8         Reverted changeset:
9
10         "[MediaStream] Don't request user permission for a device if
11         it has already been granted in the current browsing context"
12         https://bugs.webkit.org/show_bug.cgi?id=164760
13         http://trac.webkit.org/changeset/209008
14
15 2016-11-28  Andrew Gold  <agold@apple.com>
16
17         Support for HTML Media Capture API
18         https://bugs.webkit.org/show_bug.cgi?id=43239
19
20         Reviewed by Tim Horton.
21
22         In order to enable media capture on iOS, we must first use the AVFoundation API to 
23         check/request capture permission from the user for Safari. Then, Safari must request
24         permission on behalf of the webpage to use the capture devices. Additionally, Safari
25         must present UI when the capture is taking place, so WebKit needs to notify the client
26         of a capture session beginning and ending. To do this, we added four methods to 
27         WKUIDelegatePrivate to request permission from the user, check for permissions, notify
28         that a capture session has begun, and notify that a capture session has ended. Additionally,
29         we added a private method to WKWebView that allows the client to stop a capture session.
30
31         * UIProcess/API/APIUIClient.h:
32         (API::UIClient::didBeginCaptureSession): Notifies the client of a capture session beginning.
33         (API::UIClient::didEndCaptureSession): Notifies the client of a capture session ending.
34
35         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added new delegate methods to request permission,
36         check for permission, notify of a capture session beginning, and notify of a capture session
37         ending.
38
39         * UIProcess/API/Cocoa/WKWebView.mm:
40         (-[WKWebView _stopMediaCapture]): Cancels a media capture session.
41         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
42
43         * UIProcess/Cocoa/UIDelegate.h:
44         * UIProcess/Cocoa/UIDelegate.mm:
45         (WebKit::UIDelegate::setDelegate): Added the new delegate methods.
46         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
47         First checks if the user has authorized the client application access capture devices,
48         then uses the WKUIDelegate to request permission for a site from the user.
49         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): Checks the client
50         for permission to access capture devices.
51         (WebKit::UIDelegate::UIClient::didBeginCaptureSession): Notifies the client of a capture
52         session beginning.
53         (WebKit::UIDelegate::UIClient::didEndCaptureSession): Notifies the client of a capture
54         session ending.
55
56         * UIProcess/WebPageProxy.cpp:
57         (WebKit::WebPageProxy::isPlayingMediaDidChange): Calls UIDelegate method to notify the
58         client of a capture session beginning/ending.
59
60 2016-11-28  Eric Carlson  <eric.carlson@apple.com>
61
62         [MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context
63         https://bugs.webkit.org/show_bug.cgi?id=164760
64         <rdar://problem/29261266>
65
66         Reviewed by Youenn Fablet.
67
68         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
69         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
70         (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice):
71         (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice):
72         (WebKit::FrameAuthorizationState::reset):
73         (WebKit::FrameAuthorizationState::securityOriginsAreEqual):
74         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest):
75         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
76         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
77         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
78         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
79         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
80         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
81         (WebKit::FrameAuthorizationState::~FrameAuthorizationState):
82         (WebKit::FrameAuthorizationState::frameID):
83         * UIProcess/UserMediaPermissionRequestProxy.cpp:
84         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
85         * UIProcess/UserMediaPermissionRequestProxy.h:
86         (WebKit::UserMediaPermissionRequestProxy::create):
87         (WebKit::UserMediaPermissionRequestProxy::frameID):
88         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
89         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin):
90         * UIProcess/WebPageProxy.cpp:
91         (WebKit::WebPageProxy::didCommitLoadForFrame):
92         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
93         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps):
94
95 2016-11-27  Dean Jackson  <dino@apple.com>
96
97         Removed a WTFLogAlways I left in with a recent commit.
98
99         * UIProcess/Cocoa/WebViewImpl.mm:
100         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
101
102 2016-11-27  Csaba Osztrogonác  <ossy@webkit.org>
103
104         Fix unused-private-field build warning in WebKit2/Platform/SharedMemory.h
105         https://bugs.webkit.org/show_bug.cgi?id=165069
106
107         Reviewed by Darin Adler.
108
109         * Platform/SharedMemory.h:
110
111 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
112
113         Fix the iOS build.
114
115         * WebProcess/WebPage/ios/WebPageIOS.mm:
116         (WebKit::WebPage::eventThrottlingDelay):
117
118 2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
119
120         [WTF] Import std::optional reference implementation as WTF::Optional
121         https://bugs.webkit.org/show_bug.cgi?id=164199
122
123         Reviewed by Saam Barati and Sam Weinig.
124
125         * NetworkProcess/NetworkDataTask.cpp:
126         (WebKit::NetworkDataTask::didReceiveResponse):
127         * NetworkProcess/NetworkLoad.h:
128         * NetworkProcess/cache/NetworkCache.cpp:
129         (WebKit::NetworkCache::responseHasExpired):
130         * NetworkProcess/cache/NetworkCacheCoders.h:
131         (WebKit::NetworkCache::Coder<std::optional<T>>::encode):
132         (WebKit::NetworkCache::Coder<std::optional<T>>::decode):
133         (WebKit::NetworkCache::Coder<Optional<T>>::encode): Deleted.
134         (WebKit::NetworkCache::Coder<Optional<T>>::decode): Deleted.
135         * NetworkProcess/cache/NetworkCacheData.cpp:
136         (WebKit::NetworkCache::readOrMakeSalt):
137         * NetworkProcess/cache/NetworkCacheData.h:
138         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
139         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
140         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
141         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
142         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
143         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
144         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
145         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
146         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
147         * NetworkProcess/cache/NetworkCacheStatistics.h:
148         * NetworkProcess/cache/NetworkCacheStorage.cpp:
149         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
150         (WebKit::NetworkCache::Storage::encodeRecord):
151         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
152         * NetworkProcess/cache/NetworkCacheStorage.h:
153         * Platform/IPC/ArgumentCoders.h:
154         (IPC::ArgumentCoder<std::optional<T>>::encode):
155         (IPC::ArgumentCoder<std::optional<T>>::decode):
156         (IPC::ArgumentCoder<WTF::Optional<T>>::encode): Deleted.
157         (IPC::ArgumentCoder<WTF::Optional<T>>::decode): Deleted.
158         * Platform/IPC/Connection.h:
159         (IPC::Connection::sendWithReply):
160         * Platform/SharedMemory.h:
161         * Platform/unix/SharedMemoryUnix.cpp:
162         (WebKit::SharedMemory::map):
163         * Scripts/webkit/messages.py:
164         (class_template_headers):
165         * Shared/API/APISecurityOrigin.h:
166         (API::SecurityOrigin::create):
167         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
168         * Shared/API/c/WKSecurityOriginRef.cpp:
169         (WKSecurityOriginGetPort):
170         * Shared/SessionState.h:
171         * Shared/WebPageCreationParameters.h:
172         * Shared/mac/ObjCObjectGraph.mm:
173         (WebKit::typeFromObject):
174         * Shared/mac/SecItemShim.cpp:
175         (WebKit::sendSecItemRequest):
176         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
177         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
178         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
179         (-[WKSecurityOrigin port]):
180         * UIProcess/API/Cocoa/WKWebView.mm:
181         (-[WKWebView _didCommitLayerTree:]):
182         (-[WKWebView _navigationGestureDidEnd]):
183         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
184         (WebKit::toWebsiteDataType):
185         * UIProcess/API/efl/EwkView.cpp:
186         (EwkView::setCursor):
187         * UIProcess/API/mac/WKView.mm:
188         (toCoreScrollbarStyle):
189         (toAPIScrollbarStyle):
190         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
191         (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
192         (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
193         (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
194         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
195         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
196         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
197         (WebKit::toPKPaymentSummaryItem):
198         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
199         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
200         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
201         * UIProcess/Automation/WebAutomationSession.cpp:
202         (WebKit::WebAutomationSession::webFrameIDForHandle):
203         (WebKit::WebAutomationSession::switchToBrowsingContext):
204         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
205         (WebKit::WebAutomationSession::resolveChildFrameHandle):
206         (WebKit::WebAutomationSession::resolveParentFrameHandle):
207         (WebKit::WebAutomationSession::computeElementLayout):
208         * UIProcess/Automation/WebAutomationSession.h:
209         * UIProcess/Cocoa/WebViewImpl.h:
210         * UIProcess/Cocoa/WebViewImpl.mm:
211         (WebKit::WebViewImpl::updateViewExposedRect):
212         (WebKit::WebViewImpl::setOverlayScrollbarStyle):
213         (WebKit::WebViewImpl::overlayScrollbarStyle):
214         * UIProcess/DrawingAreaProxy.cpp:
215         (WebKit::DrawingAreaProxy::setViewExposedRect):
216         * UIProcess/DrawingAreaProxy.h:
217         (WebKit::DrawingAreaProxy::viewExposedRect):
218         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
219         (WebKit::WebSocketServerConnection::didReceiveSocketStreamData):
220         * UIProcess/InspectorServer/WebSocketServerConnection.h:
221         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
222         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
223         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
224         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
225         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
226         * UIProcess/Scrolling/RemoteScrollingTree.h:
227         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
228         (WebKit::fileCreationTime):
229         (WebKit::fileModificationTime):
230         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
231         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
232         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
233         * UIProcess/WebBackForwardList.cpp:
234         (WebKit::WebBackForwardList::backForwardListState):
235         (WebKit::WebBackForwardList::restoreFromState):
236         * UIProcess/WebPageProxy.cpp:
237         (WebKit::WebPageProxy::didCommitLoadForFrame):
238         (WebKit::WebPageProxy::creationParameters):
239         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
240         * UIProcess/WebPageProxy.h:
241         (WebKit::WebPageProxy::overlayScrollbarStyle):
242         * UIProcess/WebPageProxy.messages.in:
243         * UIProcess/WebsiteData/WebsiteDataRecord.h:
244         * UIProcess/efl/WebView.cpp:
245         (WebKit::WebView::transformFromScene):
246         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
247         * UIProcess/gtk/WebPreferencesGtk.cpp:
248         (WebKit::WebPreferences::platformInitializeStore):
249         * UIProcess/ios/WKContentViewInteraction.mm:
250         (-[WKContentView _scrollOffsetForEvent:]):
251         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
252         * UIProcess/mac/LegacySessionStateCoding.cpp:
253         (WebKit::encodeFormDataElement):
254         (WebKit::decodeFormDataElement):
255         (WebKit::decodeV1SessionHistory):
256         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
257         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
258         (WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect):
259         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
260         (WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
261         (WebKit::WebPaymentCoordinator::completeShippingContactSelection):
262         (WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
263         * WebProcess/ApplePay/WebPaymentCoordinator.h:
264         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
265         (WKBundlePageSetEventThrottlingBehaviorOverride):
266         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
267         (WebKit::PDFPlugin::convertFromPDFViewToRootView):
268         (WebKit::PDFPlugin::convertFromPDFViewToScreen):
269         (WebKit::PDFPlugin::boundsOnScreen):
270         (WebKit::PDFPlugin::geometryDidChange):
271         * WebProcess/Plugins/PDF/PDFPlugin.mm:
272         (WebKit::PDFPlugin::geometryDidChange):
273         * WebProcess/Plugins/PluginView.cpp:
274         (WebKit::PluginView::performFrameLoadURLRequest):
275         (WebKit::PluginView::evaluate):
276         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
277         (WebKit::WebPluginInfoProvider::pluginLoadClientPolicyForHost):
278         * WebProcess/Plugins/WebPluginInfoProvider.h:
279         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
280         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
281         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
282         (WebKit::toFormData):
283         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
284         (WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
285         * WebProcess/WebCoreSupport/WebChromeClient.h:
286         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
287         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
288         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
289         * WebProcess/WebPage/DrawingArea.h:
290         * WebProcess/WebPage/DrawingArea.messages.in:
291         * WebProcess/WebPage/WebFrame.cpp:
292         (WebKit::WebFrame::certificateInfo):
293         * WebProcess/WebPage/WebPage.cpp:
294         (WebKit::m_userInterfaceLayoutDirection):
295         (WebKit::WebPage::setScrollbarOverlayStyle):
296         * WebProcess/WebPage/WebPage.h:
297         (WebKit::WebPage::scrollbarOverlayStyle):
298         * WebProcess/WebPage/WebPage.messages.in:
299         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
300         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
301         (WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect):
302         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
303         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
304         (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
305
306 2016-11-26  Sam Weinig  <sam@webkit.org>
307
308         Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
309         https://bugs.webkit.org/show_bug.cgi?id=164965
310
311         Reviewed by Simon Fraser.
312
313         * Shared/WebPreferencesDefinitions.h:
314         * UIProcess/API/C/WKPreferences.cpp:
315         (WKPreferencesSetIntersectionObserverEnabled):
316         (WKPreferencesGetIntersectionObserverEnabled):
317         * UIProcess/API/C/WKPreferencesRefPrivate.h:
318         * WebProcess/WebPage/WebPage.cpp:
319         (WebKit::WebPage::updatePreferences):
320         Add a preference, defaulting to off, for enabling IntersectionObserver.
321
322 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
323
324         Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
325         https://bugs.webkit.org/show_bug.cgi?id=164992
326
327         Reviewed by Darin Adler.
328         
329         No more ugly conversion from seconds to milliseconds.
330
331         * WebProcess/WebPage/WebPage.cpp:
332         (WebKit::WebPage::updatePreferences):
333         * WebProcess/WebPage/ios/WebPageIOS.mm:
334         (WebKit::WebPage::eventThrottlingDelay):
335
336 2016-11-25  Michael Catanzaro  <mcatanzaro@igalia.com>
337
338         [GTK] Follow-up fixes to r208974
339         https://bugs.webkit.org/show_bug.cgi?id=164771
340
341         Unreviewed, implement Carlos's review feedback.
342
343         * UIProcess/API/gtk/WebKitNotification.cpp:
344         (webkit_notification_get_tag):
345         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
346         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
347         (WebKitNotificationProvider::show):
348         * UIProcess/API/gtk/WebKitNotificationProvider.h:
349
350 2016-11-24  Michael Catanzaro  <mcatanzaro@igalia.com>
351
352         [GTK] Notifications API does not expose or respect the "tag" attribute
353         https://bugs.webkit.org/show_bug.cgi?id=164771
354
355         Reviewed by Gustavo Noronha Silva.
356
357         Expose a tag property on WebKitNotification. Ensure that any previous notification with the
358         same tag is closed when showing a new notification with that tag.
359
360         * UIProcess/API/gtk/WebKitNotification.cpp:
361         (webkit_notification_class_init):
362         (webkitNotificationCreate):
363         (webkit_notification_get_tag):
364         * UIProcess/API/gtk/WebKitNotification.h:
365         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
366         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
367         (WebKitNotificationProvider::show):
368         * UIProcess/API/gtk/WebKitNotificationProvider.h:
369         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
370
371 2016-11-22  Sergio Villar Senin  <svillar@igalia.com>
372
373         [GTK] Fix introspection warning
374         https://bugs.webkit.org/show_bug.cgi?id=165026
375
376         Reviewed by Michael Catanzaro.
377
378         This fixes an introspection annotation for a new API added in r208532.
379
380         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
381         (webkit_web_page_class_init):
382
383 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
384
385         [SOUP] Simplify custom protocols handler implementation
386         https://bugs.webkit.org/show_bug.cgi?id=164922
387
388         Reviewed by Michael Catanzaro.
389
390         We are using too many classes for this and also the C API that is not needed, because both GTK+ and EFL have
391         their own APIs and this is not used by WTR at all.
392
393         * PlatformEfl.cmake: Remove files from compilation.
394         * PlatformGTK.cmake: Ditto.
395         * Shared/API/c/WKBase.h:
396         * Shared/API/c/soup/WKBaseSoup.h: Removed.
397         * UIProcess/API/APICustomProtocolManagerClient.h: Added.
398         (API::CustomProtocolManagerClient::~CustomProtocolManagerClient):
399         (API::CustomProtocolManagerClient::startLoading):
400         (API::CustomProtocolManagerClient::stopLoading):
401         (API::CustomProtocolManagerClient::invalidate):
402         * UIProcess/API/C/WKAPICast.h:
403         * UIProcess/API/C/soup/WKAPICastSoup.h: Removed.
404         * UIProcess/API/C/soup/WKContextSoup.h: Removed.
405         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: Removed.
406         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: Removed.
407         * UIProcess/API/C/soup/WKSoupRequestManager.h: Removed.
408         * UIProcess/API/efl/ewk_context.cpp: Remove unneeded include.
409         * UIProcess/API/efl/ewk_url_scheme_request.cpp: Use CustomProtocolManagerProxy instead of WKSoupCustomProtocolRequestManagerRef.
410         (EwkUrlSchemeRequest::EwkUrlSchemeRequest):
411         (EwkUrlSchemeRequest::finish):
412         (EwkUrlSchemeRequest::invalidate):
413         * UIProcess/API/efl/ewk_url_scheme_request_private.h:
414         (EwkUrlSchemeRequest::create):
415         (EwkUrlSchemeRequest::manager):
416         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp: Added.
417         (attachCustomProtocolManagerClientToContext):
418         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h.
419         * UIProcess/API/gtk/WebKitPrivate.h:
420         * UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Removed.
421         * UIProcess/API/gtk/WebKitRequestManagerClient.h: Removed.
422         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Use CustomProtocolManagerProxy instead of WebSoupCustomProtocolRequestManager.
423         (webkitURISchemeRequestCreate):
424         (webkitURISchemeRequestCancel):
425         (webkitURISchemeRequestGetManager):
426         (webkitURISchemeRequestInvalidate):
427         (webkitURISchemeRequestReadCallback):
428         (webkit_uri_scheme_request_finish_error):
429         * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
430         * UIProcess/API/gtk/WebKitWebContext.cpp:
431         (webkitWebContextConstructed):
432         (webkitWebContextDispose):
433         (webkit_web_context_register_uri_scheme):
434         (webkitWebContextStartLoadingCustomProtocol):
435         (webkitWebContextInvalidateCustomProtocolRequests):
436         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
437         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
438         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
439         (WebKit::CustomProtocolManagerProxy::processDidClose):
440         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
441         (WebKit::CustomProtocolManagerProxy::processDidClose): Invalidate the client.
442         (WebKit::CustomProtocolManagerProxy::startLoading): Notify the client.
443         (WebKit::CustomProtocolManagerProxy::stopLoading): Ditto.
444         (WebKit::CustomProtocolManagerProxy::didReceiveResponse): Notify the network process.
445         (WebKit::CustomProtocolManagerProxy::didLoadData): Ditto.
446         (WebKit::CustomProtocolManagerProxy::didFailWithError): Ditto.
447         (WebKit::CustomProtocolManagerProxy::didFinishLoading): Ditto.
448         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: Removed.
449         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: Removed.
450         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: Removed.
451         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: Removed.
452         * UIProcess/Network/NetworkProcessProxy.cpp:
453         (WebKit::NetworkProcessProxy::didClose): Notify the CustomProtocolManagerProxy.
454         * UIProcess/WebProcessPool.cpp:
455         (WebKit::WebProcessPool::WebProcessPool): Initialize the CustomProtocolManagerClient and remove the all supplement.
456         (WebKit::WebProcessPool::setCustomProtocolManagerClient):
457         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): In case of soup cache the given protocol.
458         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): In case of soup delete the given protocol from the cache.
459         * UIProcess/WebProcessPool.h:
460         * UIProcess/efl/RequestManagerClientEfl.cpp: Do not use the C API, but API::CustomProtocolManagerClient.
461         (WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
462         (WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
463         * UIProcess/efl/RequestManagerClientEfl.h:
464         * UIProcess/efl/WebProcessPoolEfl.cpp:
465         * UIProcess/gtk/WebProcessPoolGtk.cpp:
466         * UIProcess/soup/WebProcessPoolSoup.cpp:
467         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Use m_urlSchemesRegisteredForCustomProtocols to
468         build the list of custom protocols to send to the network process.
469
470 2016-11-21  Alex Christensen  <achristensen@webkit.org>
471
472         Fix Sierra CMake build after r208452
473         https://bugs.webkit.org/show_bug.cgi?id=164437
474
475         * UIProcess/Cocoa/WebViewImpl.mm:
476         (WebKit::WebViewImpl::updateMediaTouchBar):
477         I haven't enabled VIDEO_PRESENTATION_MODE in the CMake build yet.
478         It's needed for WebPlaybackSessionInterfaceMac to exist.
479
480 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
481
482         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.2 release.
483
484         * gtk/NEWS: Add release notes for 2.15.2.
485
486 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
487
488         Remove m_customProtocolManagerProxy from WebProcessProxy
489         https://bugs.webkit.org/show_bug.cgi?id=164908
490
491         Reviewed by Andreas Kling.
492
493         Since the network process is mandatory, the custom protocol manager proxy of WebProcessProxy is unused and can
494         be removed.
495
496         * UIProcess/WebProcessProxy.cpp:
497         (WebKit::WebProcessProxy::WebProcessProxy):
498         * UIProcess/WebProcessProxy.h:
499
500 2016-11-20  Zan Dobersek  <zdobersek@igalia.com>
501
502         [EncryptedMedia] Make EME API runtime-enabled
503         https://bugs.webkit.org/show_bug.cgi?id=164927
504
505         Reviewed by Jer Noble.
506
507         Add the new EncryptedMediaAPI preference. Set the same feature
508         flag on the shared RuntimeEnabledFeatures object to the
509         corresponding value that's stored in the WebPreferencesStore.
510
511         InjectedBundle::overrideBoolPreferenceForTestRunner() does the
512         same when the 'WebKitEncryptedMediaAPIEnabled' preference is
513         overridden in WKTR for testing purposes.
514
515         * Shared/WebPreferencesDefinitions.h:
516         * WebProcess/InjectedBundle/InjectedBundle.cpp:
517         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
518         * WebProcess/WebPage/WebPage.cpp:
519         (WebKit::WebPage::updatePreferences):
520
521 2016-11-19  Antti Koivisto  <antti@apple.com>
522
523         Salt network cache hashes
524         https://bugs.webkit.org/show_bug.cgi?id=164924
525
526         Reviewed by Alex Christensen.
527
528         To enhance privacy make cache content unidentifiable from file names alone.
529         This is done by generating a unique persistent salt for each cache instance.
530         It is used when computing hashes used in file names.
531
532         The patch also replaces plain text partition directory names with salted hashes.
533
534         * NetworkProcess/cache/NetworkCache.cpp:
535         (WebKit::NetworkCache::Cache::makeCacheKey):
536         (WebKit::NetworkCache::makeCacheKey): Deleted.
537         * NetworkProcess/cache/NetworkCache.h:
538
539             Increment cache version.
540
541         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
542         (WebKit::NetworkCache::BlobStorage::BlobStorage):
543         (WebKit::NetworkCache::BlobStorage::add):
544         (WebKit::NetworkCache::BlobStorage::get):
545
546             Use salt for blob content hash.
547
548         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
549         * NetworkProcess/cache/NetworkCacheData.cpp:
550         (WebKit::NetworkCache::computeSHA1):
551
552             For simplicity all SHA1s are now salted.
553
554         (WebKit::NetworkCache::makeSalt):
555         (WebKit::NetworkCache::readOrMakeSalt):
556
557             Read salt if it exists, generate and persist it otherwise.
558
559         * NetworkProcess/cache/NetworkCacheData.h:
560         * NetworkProcess/cache/NetworkCacheKey.cpp:
561         (WebKit::NetworkCache::Key::Key):
562
563             Remove the "No partition" string and just empty.
564             That was only needed to have a directory name of some sort.
565
566         (WebKit::NetworkCache::Key::computeHash):
567
568             Use salt for key hash.
569
570         (WebKit::NetworkCache::Key::computePartitionHash):
571
572             Separate hash for partition.
573
574         * NetworkProcess/cache/NetworkCacheKey.h:
575         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
576         (WebKit::NetworkCache::makeSubresourcesKey):
577         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
578         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
579         * NetworkProcess/cache/NetworkCacheStorage.cpp:
580         (WebKit::NetworkCache::makeSaltFilePath):
581         (WebKit::NetworkCache::Storage::open):
582
583             Cache can't be opened if we can't read or persist a salt.
584
585         (WebKit::NetworkCache::traverseRecordsFiles):
586         (WebKit::NetworkCache::Storage::Storage):
587         (WebKit::NetworkCache::Storage::synchronize):
588         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
589
590             Use the partition hash in the directory name instead of a plain text name.
591
592         (WebKit::NetworkCache::decodeRecordHeader):
593         (WebKit::NetworkCache::Storage::readRecord):
594         (WebKit::NetworkCache::Storage::encodeRecord):
595         (WebKit::NetworkCache::Storage::traverse):
596         (WebKit::NetworkCache::Storage::clear):
597         * NetworkProcess/cache/NetworkCacheStorage.h:
598         (WebKit::NetworkCache::Storage::salt):
599
600 2016-11-19  Simon Fraser  <simon.fraser@apple.com>
601
602         [iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing
603         https://bugs.webkit.org/show_bug.cgi?id=164855
604
605         Reviewed by Sam Weinig.
606
607         During UI-process panning and zooming, we send visible rect updates to the web process
608         with inStableState=false, and don't update GraphicsLayers until we get into a stable state.
609
610         This causes a problem where the web process has a stale notion of where the GraphicsLayers
611         for position:fixed elements are, but is then told to update tiling coverage with an up-to-date
612         visible rect. The existing "sync layer positions" path isn't useful to fix this, because it
613         breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints
614         in the scrolling tree.
615
616         To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used
617         only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions
618         are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to
619         reconcileViewportConstrainedLayerPositions).
620
621         Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html
622
623         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
624         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
625         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
626         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
627         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
628         * UIProcess/Scrolling/RemoteScrollingTree.h:
629         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
630         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
631         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
632         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
633         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
634         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
635         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
636         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
637         * WebProcess/WebPage/ios/WebPageIOS.mm:
638         (WebKit::WebPage::updateVisibleContentRects): Always push the custom fixed position rect down, but send
639         ScrollingLayerPositionAction::SetApproximate if the state is not stable.
640         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
641         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
642         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
643         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
644
645 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
646
647         Make it possible to test non-stable-state scrolling on iOS
648         https://bugs.webkit.org/show_bug.cgi?id=164905
649
650         Reviewed by Dan Bernstein.
651
652         Make it possible for an iOS layout test to force every visible rect update
653         from the UI process to the web process to be in a non-stable state. This emulates
654         what happens during panning and zooming interactions, and allows us to test the
655         scrolling and layer trees in these transient states.
656
657         This is done by adding a testing property on WKWebView, _stableStateOverride, whose
658         getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView
659         consults the NSNumber's boolValue and uses it to override the stable state.
660
661         To facilitate this kind of testing, also add immediateScrollToOffset() and
662         immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate()
663         which provides a callback that fires after one trip to the web process and back.
664
665         * UIProcess/API/Cocoa/WKWebView.mm:
666         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
667         (-[WKWebView _stableStateOverride]):
668         (-[WKWebView _setStableStateOverride:]):
669         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
670
671 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
672
673         [iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
674         https://bugs.webkit.org/show_bug.cgi?id=164980
675
676         Reviewed by Chris Dumez.
677
678         WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
679         to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
680         flag that impacts tile coverage.
681
682         During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
683         WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().
684
685         Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.
686
687         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
688         (WKBundlePageSetEventThrottlingBehaviorOverride):
689         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
690         * WebProcess/WebPage/ios/WebPageIOS.mm:
691         (WebKit::WebPage::eventThrottlingDelay):
692
693 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
694
695         Remove use of std::chrono in WebPage and entrained code
696         https://bugs.webkit.org/show_bug.cgi?id=164967
697
698         Reviewed by Tim Horton.
699
700         Replace std::chrono with Seconds and Monotonic Time.
701
702         Use more C++11 initialization for WebPage data members.
703
704         * Shared/VisibleContentRectUpdateInfo.cpp:
705         (WebKit::operator<<):
706         * Shared/VisibleContentRectUpdateInfo.h:
707         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
708         (WebKit::VisibleContentRectUpdateInfo::timestamp):
709         * Shared/WebCoreArgumentCoders.cpp:
710         (IPC::ArgumentCoder<MonotonicTime>::encode):
711         (IPC::ArgumentCoder<MonotonicTime>::decode):
712         (IPC::ArgumentCoder<Seconds>::encode):
713         (IPC::ArgumentCoder<Seconds>::decode):
714         * Shared/WebCoreArgumentCoders.h:
715         * UIProcess/ios/WKContentView.mm:
716         (WebKit::HistoricalVelocityData::HistoricalVelocityData):
717         (WebKit::HistoricalVelocityData::velocityForNewData):
718         (WebKit::HistoricalVelocityData::append):
719         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
720         * WebProcess/WebCoreSupport/WebChromeClient.h:
721         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
722         (WebKit::WebChromeClient::eventThrottlingDelay):
723         * WebProcess/WebPage/ViewUpdateDispatcher.h:
724         * WebProcess/WebPage/WebPage.cpp:
725         (WebKit::WebPage::WebPage):
726         (WebKit::m_userActivityHysteresis):
727         (WebKit::WebPage::didFlushLayerTreeAtTime):
728         (WebKit::WebPage::didCommitLoad):
729         * WebProcess/WebPage/WebPage.h:
730         * WebProcess/WebPage/ios/WebPageIOS.mm:
731         (WebKit::WebPage::eventThrottlingDelay):
732         (WebKit::WebPage::updateVisibleContentRects):
733         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
734         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
735
736 2016-11-18  Dean Jackson  <dino@apple.com>
737
738         AX: "(inverted-colors)" media query only matches on page reload; should match on change
739         https://bugs.webkit.org/show_bug.cgi?id=163564
740         <rdar://problem/28807350>
741
742         Reviewed by Simon Fraser.
743
744         Listen for the appropriate notifications that accessibility settings
745         have changed. This is a single notification on macOS, which uses WebViewImpl,
746         and more fine-grained notifications on iOS, using WKWebView.
747
748         When we see the notification, send a message to the WebProcess which will
749         then tell the WebCore::Page.
750
751         * UIProcess/API/Cocoa/WKWebView.mm:
752         (-[WKWebView _initializeWithConfiguration:]):
753         (-[WKWebView _accessibilitySettingsDidChange:]):
754         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
755         * UIProcess/Cocoa/WebViewImpl.h:
756         * UIProcess/Cocoa/WebViewImpl.mm:
757         (-[WKAccessibilitySettingsObserver initWithImpl:]):
758         (-[WKAccessibilitySettingsObserver dealloc]):
759         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
760         (WebKit::WebViewImpl::WebViewImpl):
761         (WebKit::WebViewImpl::accessibilitySettingsDidChange):
762         * UIProcess/WebPageProxy.cpp:
763         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
764         * UIProcess/WebPageProxy.h:
765         * WebProcess/WebPage/WebPage.cpp:
766         (WebKit::WebPage::accessibilitySettingsDidChange):
767         * WebProcess/WebPage/WebPage.h:
768         * WebProcess/WebPage/WebPage.messages.in:
769
770 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
771
772         USE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12))
773         https://bugs.webkit.org/show_bug.cgi?id=164962
774
775         Reviewed by Dean Jackson.
776
777         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
778
779 2016-11-18  Enrica Casucci  <enrica@apple.com>
780
781         Refactor drag and drop for WebKit2 to encode DragData message exchange.
782         https://bugs.webkit.org/show_bug.cgi?id=164945
783
784         Reviewed by Tim Horton.
785
786         * Shared/WebCoreArgumentCoders.cpp:
787         (IPC::ArgumentCoder<DragData>::encode):
788         (IPC::ArgumentCoder<DragData>::decode):
789         * Shared/WebCoreArgumentCoders.h:
790         * UIProcess/WebPageProxy.cpp:
791         (WebKit::WebPageProxy::performDragControllerAction):
792         * WebProcess/WebCoreSupport/WebDragClient.cpp:
793         (WebKit::WebDragClient::willPerformDragDestinationAction):
794         (WebKit::WebDragClient::actionMaskForDrag):
795         * WebProcess/WebCoreSupport/WebDragClient.h:
796         * WebProcess/WebPage/WebPage.cpp:
797         (WebKit::WebPage::performDragControllerAction):
798         * WebProcess/WebPage/WebPage.h:
799         * WebProcess/WebPage/WebPage.messages.in:
800
801 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
802
803         Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
804         https://bugs.webkit.org/show_bug.cgi?id=163801
805
806         Reviewed by Simon Fraser.
807
808         Add SPI to notify client of pointer lock and for client to allow or deny.
809         Unlock pointer when view is not longer active.
810
811         * Configurations/FeatureDefines.xcconfig:
812         * Shared/WebPreferencesDefinitions.h:
813         * UIProcess/API/APIUIClient.h:
814         (API::UIClient::requestPointerLock):
815         (API::UIClient::didLosePointerLock):
816         * UIProcess/API/C/WKPage.cpp:
817         (WKPageSetPageUIClient):
818         (WKPageDidAllowPointerLock):
819         (WKPageDidDenyPointerLock):
820         * UIProcess/API/C/WKPagePrivate.h:
821         * UIProcess/API/C/WKPageUIClient.h:
822         * UIProcess/API/C/WKPreferences.cpp:
823         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
824         * UIProcess/Cocoa/UIDelegate.h:
825         * UIProcess/Cocoa/UIDelegate.mm:
826         (WebKit::UIDelegate::setDelegate):
827         (WebKit::UIDelegate::UIClient::requestPointerLock):
828         (WebKit::UIDelegate::UIClient::didLosePointerLock):
829         * UIProcess/WebPageProxy.cpp:
830         (WebKit::WebPageProxy::dispatchActivityStateChange):
831         (WebKit::WebPageProxy::resetStateAfterProcessExited):
832         (WebKit::WebPageProxy::requestPointerLock):
833         (WebKit::WebPageProxy::didAllowPointerLock):
834         (WebKit::WebPageProxy::didDenyPointerLock):
835         (WebKit::WebPageProxy::requestPointerUnlock):
836         * UIProcess/WebPageProxy.h:
837         * WebProcess/WebPage/WebPage.cpp:
838         (WebKit::WebPage::updatePreferences):
839
840 2016-11-17  Carlos Garcia Campos  <cgarcia@igalia.com>
841
842         Downloads started by context menu actions should also have a web view associated
843         https://bugs.webkit.org/show_bug.cgi?id=164364
844
845         Reviewed by Michael Catanzaro.
846
847         When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to
848         associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls
849         WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case.
850
851         * UIProcess/API/gtk/WebKitDownload.cpp:
852         (webkitDownloadCreateForRequest): Deleted.
853         * UIProcess/API/gtk/WebKitDownloadPrivate.h:
854         * UIProcess/API/gtk/WebKitWebContext.cpp:
855         (webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download()
856         because the WebKitDownload could have already been created by the web view download handler at this point.
857         * UIProcess/API/gtk/WebKitWebView.cpp:
858         (webkit_web_view_download_uri): We no longer need to associate the web view to the download here.
859         * UIProcess/WebProcessPool.cpp:
860         (WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify
861         the page client.
862
863 2016-11-17  Alex Christensen  <achristensen@webkit.org>
864
865         REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
866         https://bugs.webkit.org/show_bug.cgi?id=164631
867
868         Reviewed by Carlos Garcia Campos.
869
870         * NetworkProcess/NetworkResourceLoader.cpp:
871         (WebKit::NetworkResourceLoader::convertToDownload):
872         I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION
873         by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload.  m_networkLoad
874         was not being set to nullptr before it was being checked in NetworkResourceLoader::abort
875
876 2016-11-17  Alex Christensen  <achristensen@webkit.org>
877
878         Fix CMake build after r208865
879         https://bugs.webkit.org/show_bug.cgi?id=164894
880
881         * PlatformMac.cmake:
882         Add new files.
883
884 2016-11-17  Ryosuke Niwa  <rniwa@webkit.org>
885
886         WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled
887         https://bugs.webkit.org/show_bug.cgi?id=164857
888         <rdar://problem/27721742>
889
890         Reviewed by Wenson Hsieh.
891
892         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
893         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):
894
895 2016-11-17  John Wilander  <wilander@apple.com>
896
897         Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed
898         https://bugs.webkit.org/show_bug.cgi?id=164659
899
900         Reviewed by Andy Estes.
901
902         * UIProcess/WebResourceLoadStatisticsStore.cpp:
903         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
904             Consistent naming with 'remove' rather than 'delete'.
905             Now removes localStorage, IndexDB, disk cache, and memory cache too.
906             Updates statistics with number of times it has removed data records.
907         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
908             No longer checks whether it has enough data since the classification rules
909             are absolute, not relative.
910         (WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Deleted.
911         * UIProcess/WebResourceLoadStatisticsStore.h:
912             Consistent naming with 'remove' rather than 'delete'.
913
914 2016-11-17  Brady Eidson  <beidson@apple.com>
915
916         Add _WKIconLoadingDelegate SPI.
917         https://bugs.webkit.org/show_bug.cgi?id=164894
918
919         Reviewed by Alex Christensen.
920
921         With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
922
923         WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
924
925         For icons the app decides to load, WebKit will pass the data to the app without storing locally.
926
927         * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
928         (API::IconLoadingClient::~IconLoadingClient):
929         (API::IconLoadingClient::getLoadDecisionForIcon):
930
931         * UIProcess/API/Cocoa/WKWebView.mm:
932         (-[WKWebView _initializeWithConfiguration:]):
933         (-[WKWebView _iconLoadingDelegate]):
934         (-[WKWebView _setIconLoadingDelegate:]):
935         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
936
937         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
938
939         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
940         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
941         (-[_WKLinkIconParameters _initWithLinkIcon:]):
942         (-[_WKLinkIconParameters url]):
943         (-[_WKLinkIconParameters mimeType]):
944         (-[_WKLinkIconParameters size]):
945         (-[_WKLinkIconParameters iconType]):
946         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
947
948         * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
949         * UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
950         (WebKit::IconLoadingDelegate::IconLoadingDelegate):
951         (WebKit::IconLoadingDelegate::~IconLoadingDelegate):
952         (WebKit::IconLoadingDelegate::createIconLoadingClient):
953         (WebKit::IconLoadingDelegate::delegate):
954         (WebKit::IconLoadingDelegate::setDelegate):
955         (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
956         (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
957         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
958
959         * UIProcess/WebPageProxy.cpp:
960         (WebKit::WebPageProxy::setIconLoadingClient):
961         (WebKit::WebPageProxy::getLoadDecisionForIcon):
962         (WebKit::WebPageProxy::finishedLoadingIcon):
963         * UIProcess/WebPageProxy.h:
964         (WebKit::WebPageProxy::iconLoadingClient):
965         * UIProcess/WebPageProxy.messages.in:
966
967         * WebKit2.xcodeproj/project.pbxproj:
968
969         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
970         (WebKit::WebFrameLoaderClient::useIconLoadingClient):
971         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
972         (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
973         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
974         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
975
976         * WebProcess/WebPage/WebPage.cpp:
977         (WebKit::WebPage::didGetLoadDecisionForIcon):
978         (WebKit::WebPage::setUseIconLoadingClient):
979         * WebProcess/WebPage/WebPage.h:
980         * WebProcess/WebPage/WebPage.messages.in:
981
982 2016-11-17  Saam Barati  <sbarati@apple.com>
983
984         Remove async/await compile time flag and enable tests
985         https://bugs.webkit.org/show_bug.cgi?id=164828
986         <rdar://problem/28639334>
987
988         Reviewed by Yusuke Suzuki.
989
990         * Configurations/FeatureDefines.xcconfig:
991
992 2016-11-17  Yusuke Suzuki  <utatane.tea@gmail.com>
993
994         [JSC] WTF::TemporaryChange with WTF::SetForScope
995         https://bugs.webkit.org/show_bug.cgi?id=164761
996
997         Reviewed by Saam Barati.
998
999         * PluginProcess/PluginControllerProxy.cpp:
1000         (WebKit::PluginControllerProxy::initialize):
1001         * PluginProcess/WebProcessConnection.cpp:
1002         (WebKit::WebProcessConnection::didReceiveMessage):
1003         (WebKit::WebProcessConnection::didReceiveSyncMessage):
1004         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1005         (createEncodedObject):
1006         (decodeObject):
1007         * UIProcess/API/Cocoa/WKWebView.mm:
1008         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
1009         * UIProcess/Cocoa/WebViewImpl.mm:
1010         (WebKit::WebViewImpl::updateTextTouchBar):
1011         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1012         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
1013         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
1014         (WebKit::WebPasteboardProxy::writeToClipboard):
1015         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1016         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1017         (WebKit::CompositingCoordinator::purgeBackingStores):
1018         * WebProcess/WebPage/WebPage.cpp:
1019         (WebKit::WebPage::mouseEvent):
1020         (WebKit::WebPage::keyEvent):
1021         (WebKit::WebPage::dispatchTouchEvent):
1022         (WebKit::WebPage::setInitialFocus):
1023         (WebKit::WebPage::insertTextAsync):
1024         * WebProcess/WebPage/ios/WebPageIOS.mm:
1025         (WebKit::WebPage::dynamicViewportSizeUpdate):
1026         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1027         * WebProcess/WebPage/mac/WebPageMac.mm:
1028
1029 2016-11-16  Brent Fulgham  <bfulgham@apple.com>
1030
1031         Unreviewed build fix after r208589
1032
1033         The generated com.apple.WebKit.plugin-common.sb file was not getting copied into
1034         the Resources folder, so was not deployed with WebKit. We need to treat it like
1035         com.apple.WebProcess.sb and the other generated files.
1036
1037         * WebKit2.xcodeproj/project.pbxproj: Tell Xcode to include the generated file in
1038         the framework Resources.
1039
1040 2016-11-16  Yusuke Suzuki  <utatane.tea@gmail.com>
1041
1042         [ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
1043         https://bugs.webkit.org/show_bug.cgi?id=164827
1044
1045         Reviewed by Ryosuke Niwa.
1046
1047         * Configurations/FeatureDefines.xcconfig:
1048         * Shared/WebPreferencesDefinitions.h:
1049         Annotated ES6 Modules option with DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
1050         * UIProcess/API/C/WKPreferences.cpp:
1051         (WKPreferencesSetES6ModulesEnabled):
1052         (WKPreferencesGetES6ModulesEnabled):
1053         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1054         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1055         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1056         * WebProcess/WebPage/WebPage.cpp:
1057         (WebKit::WebPage::updatePreferences):
1058
1059 2016-11-16  Simon Fraser  <simon.fraser@apple.com>
1060
1061         Add logging support to VisibleContentRectUpdateInfo
1062         https://bugs.webkit.org/show_bug.cgi?id=164825
1063
1064         Reviewed by Zalan Bujtas.
1065
1066         Add TextStream output to VisibleContentRectUpdateInfo. Just piping it into a logging
1067         stream does single-line output, so also make a convenience dump() function that will
1068         product multiline output. Result look like:
1069
1070             (VisibleContentRectUpdateInfo
1071               (lastLayerTreeTransactionID 54)
1072               (exposedContentRect (523.44,1258.63) width=676.20 height=901.60)
1073               (unobscuredContentRect (523.44,1293.41) width=676.20 height=866.82)
1074               (unobscuredRectInScrollViewCoordinates (0,39.50) width=768 height=984.50)
1075               (customFixedPositionRect (219.64,935) width=980 height=1225)
1076               (obscuredInset width=0 height=39.50)
1077               (scale 1.14)
1078               (inStableState 0)
1079               (timestamp 736446.61)
1080               (verticalVelocity -11.36))
1081
1082         * Shared/VisibleContentRectUpdateInfo.cpp:
1083         (WebKit::VisibleContentRectUpdateInfo::dump):
1084         (WebKit::operator<<):
1085         * Shared/VisibleContentRectUpdateInfo.h:
1086         * UIProcess/ios/WKContentView.mm:
1087         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1088
1089 2016-11-15  Simon Fraser  <simon.fraser@apple.com>
1090
1091         [iOS WK2] Scroll view scrolling and zooming animations can keep running across page loads
1092         https://bugs.webkit.org/show_bug.cgi?id=164810
1093
1094         Reviewed by Tim Horton.
1095         
1096         Scrolling and zooming animations can leak across page loads, which makes tests flakey,
1097         and is unexpected by users.
1098
1099         Tested by scrollingcoordinator/ios/sync-layer-positions-after-scroll.html followed by
1100         scrollingcoordinator/ios/ui-scrolling-tree.html
1101
1102         * UIProcess/API/Cocoa/WKWebView.mm:
1103         (-[WKWebView _didCommitLoadForMainFrame]):
1104
1105 2016-11-15  Jon Lee  <jonlee@apple.com>
1106
1107         Report active video and audio capture devices separately
1108         https://bugs.webkit.org/show_bug.cgi?id=164769
1109
1110         Reviewed by Eric Carlson.
1111
1112         Replace kWKMediaHasActiveCaptureDevice with kWKMediaHasActiveAudioCaptureDevice and
1113         kWKMediaHasActiveVideoCaptureDevice
1114
1115         * UIProcess/API/C/WKPage.cpp:
1116         (WKPageGetMediaState):
1117         * UIProcess/API/C/WKPagePrivate.h:
1118         * UIProcess/WebPageProxy.cpp:
1119         (WebKit::WebPageProxy::isPlayingMediaDidChange): Update the mask to include the two
1120         bits.
1121
1122 2016-11-14  Simon Fraser  <simon.fraser@apple.com>
1123
1124         [iOS WK2] Implement support for visual viewports
1125         https://bugs.webkit.org/show_bug.cgi?id=164765
1126
1127         Reviewed by Tim Horton.
1128
1129         Adopt the visual viewport scrolling model in iOS WK2.
1130
1131         Pass the parameters used for computing the layout viewport up to WK2 via RemoteLayerTreeTransaction.
1132         These are stored on WebPageProxy. When they change, _didCommitLayerTree triggers a -_updateVisibleContentRects.
1133         
1134         WebPageProxy::computeCustomFixedPositionRect() is the function that computes the "override" layout viewport.
1135         It starts with the baseLayoutViewportSize from the web process (which is based on the initial containing block
1136         size), then ensures that it's no smaller than the unobscured content rect, since it makes no sense for the
1137         layout viewport to be smaller than the visual viewport. The static FrameView::computeLayoutViewportOrigin()
1138         is then use to "push" the layout viewport around as the visual viewport changes.
1139
1140         * Shared/VisibleContentRectUpdateInfo.h:
1141         * Shared/WebCoreArgumentCoders.cpp: Encode LayoutSize and LayoutPoint.
1142         (IPC::ArgumentCoder<LayoutSize>::encode):
1143         (IPC::ArgumentCoder<LayoutSize>::decode):
1144         (IPC::ArgumentCoder<LayoutPoint>::encode):
1145         (IPC::ArgumentCoder<LayoutPoint>::decode):
1146         * Shared/WebCoreArgumentCoders.h:
1147         * Shared/mac/RemoteLayerTreeTransaction.h:
1148         (WebKit::RemoteLayerTreeTransaction::baseLayoutViewportSize):
1149         (WebKit::RemoteLayerTreeTransaction::setBaseLayoutViewportSize):
1150         (WebKit::RemoteLayerTreeTransaction::minStableLayoutViewportOrigin):
1151         (WebKit::RemoteLayerTreeTransaction::setMinStableLayoutViewportOrigin):
1152         (WebKit::RemoteLayerTreeTransaction::maxStableLayoutViewportOrigin):
1153         (WebKit::RemoteLayerTreeTransaction::setMaxStableLayoutViewportOrigin):
1154         * Shared/mac/RemoteLayerTreeTransaction.mm:
1155         (WebKit::RemoteLayerTreeTransaction::encode):
1156         (WebKit::RemoteLayerTreeTransaction::decode):
1157         (WebKit::RemoteLayerTreeTransaction::description):
1158         * UIProcess/API/Cocoa/WKWebView.mm:
1159         (-[WKWebView _didCommitLayerTree:]):
1160         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1161         (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled): Accessor.
1162         * UIProcess/WebPageProxy.h:
1163         (WebKit::WebPageProxy::customFixedPositionRect):
1164         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1165         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
1166         * UIProcess/ios/WKContentView.mm:
1167         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1168         (-[WKContentView _didCommitLayerTree:]):
1169         * UIProcess/ios/WebPageProxyIOS.mm:
1170         (WebKit::WebPageProxy::computeCustomFixedPositionRect): When visual viewports are enabled, compute
1171         the layout viewport rect, taking the baseLayoutViewportSize and the current unobscured rect into account.
1172         (WebKit::WebPageProxy::updateLayoutViewportParameters):
1173         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1174         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1175         * WebProcess/WebPage/WebPage.cpp: Encode in the transaction the layout viewport parameters (with minor refactor).
1176         (WebKit::WebPage::willCommitLayerTree):
1177         * WebProcess/WebPage/ios/WebPageIOS.mm:
1178         (WebKit::WebPage::updateVisibleContentRects): This is where the web process receives the new override layout viewport
1179         from the web process (with some logging).
1180
1181 2016-11-15  Jon Lee  <jonlee@apple.com>
1182
1183         Remove HasMediaCaptureDevice
1184         https://bugs.webkit.org/show_bug.cgi?id=164767
1185         <rdar://problem/29263696>
1186
1187         Reviewed by Eric Carlson.
1188
1189         * UIProcess/API/C/WKPage.cpp: Remove kWKMediaHasCaptureDevice.
1190         (WKPageGetMediaState):
1191         * UIProcess/API/C/WKPagePrivate.h:
1192
1193 2016-11-15  Daniel Bates  <dabates@apple.com>
1194
1195         Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
1196         https://bugs.webkit.org/show_bug.cgi?id=164662
1197         <rdar://problem/29268514>
1198
1199         Reviewed by Alex Christensen and Brady Eidson.
1200
1201         Make changes to NetworkDataTask similar to the changes made to ResourceHandle so as to
1202         disallow non-default port HTTP 0.9 loads when using the ENABLE(NETWORK_SESSION) networking
1203         code path in WebKit2.
1204
1205         * NetworkProcess/NetworkDataTask.cpp:
1206         (WebKit::NetworkDataTask::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
1207         Otherwise notify the client that we received a response.
1208         * NetworkProcess/NetworkDataTask.h:
1209         * NetworkProcess/NetworkDataTaskBlob.cpp:
1210         (WebKit::NetworkDataTaskBlob::resume): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
1211         as the latter has been renamed to the former.
1212         (WebKit::NetworkDataTaskBlob::getSizeForNext): Ditto.
1213         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): Renamed from didReceiveResponse().
1214         * NetworkProcess/NetworkDataTaskBlob.h:
1215         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1216         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1217         (WebKit::NetworkDataTaskCocoa::didReceiveResponse): Deleted.
1218         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1219         (WebKit::NetworkDataTaskSoup::didSendRequest): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
1220         as the latter has been renamed to the former.
1221         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Renamed from didReceiveResponse(). Also
1222         remove the local variable response and inline its value into the call to ResourceHandle::didReceiveResponse()
1223         as this variable is used exactly once in this function and its name does not describe its purpose any more
1224         than its value.
1225         (WebKit::NetworkDataTaskSoup::didRequestNextPart): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
1226         as the latter has been renamed to the former.
1227         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1228
1229 2016-11-14  Alex Christensen  <achristensen@webkit.org>
1230
1231         Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
1232         https://bugs.webkit.org/show_bug.cgi?id=164720
1233
1234         Reviewed by Brady Eidson.
1235
1236         * DatabaseProcess/DatabaseProcess.cpp:
1237         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
1238         * DatabaseProcess/DatabaseProcess.h:
1239         * NetworkProcess/NetworkProcess.cpp:
1240         (WebKit::fetchDiskCacheEntries):
1241         * Shared/API/c/WKSecurityOriginRef.cpp:
1242         (WKSecurityOriginCreateFromDatabaseIdentifier):
1243         * Shared/WebsiteData/WebsiteData.cpp:
1244         (WebKit::WebsiteData::Entry::encode):
1245         (WebKit::WebsiteData::Entry::decode):
1246         * Shared/WebsiteData/WebsiteData.h:
1247         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1248         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
1249         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1250         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
1251         (WebKit::LocalStorageDatabaseTracker::origins):
1252         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1253         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1254         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
1255         * UIProcess/WebPageProxy.cpp:
1256         (WebKit::WebPageProxy::exceededDatabaseQuota):
1257         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
1258         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
1259         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1260         (WebKit::WebsiteDataStore::fetchData):
1261         (WebKit::WebsiteDataStore::removeData):
1262         (WebKit::WebsiteDataStore::mediaKeyOrigins):
1263         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1264         (WKBundleSetDatabaseQuota):
1265         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1266         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
1267         * WebProcess/Storage/StorageAreaImpl.cpp:
1268         (WebKit::StorageAreaImpl::create):
1269         (WebKit::StorageAreaImpl::StorageAreaImpl):
1270         (WebKit::StorageAreaImpl::securityOrigin):
1271         * WebProcess/Storage/StorageAreaImpl.h:
1272         * WebProcess/Storage/StorageAreaMap.cpp:
1273         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1274         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1275         * WebProcess/Storage/StorageAreaMap.h:
1276         (WebKit::StorageAreaMap::securityOrigin):
1277         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1278         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
1279         (WebKit::StorageNamespaceImpl::storageArea):
1280         * WebProcess/Storage/StorageNamespaceImpl.h:
1281         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1282         (WebKit::WebChromeClient::exceededDatabaseQuota):
1283         * WebProcess/WebProcess.cpp:
1284         (WebKit::WebProcess::fetchWebsiteData):
1285
1286 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
1287
1288         [Mac][iOS][WK2] Tighten permissions to change CapsLock delay
1289         https://bugs.webkit.org/show_bug.cgi?id=164725
1290         <rdar://problem/28970910>
1291
1292         Reviewed by Alexey Proskuryakov.
1293
1294         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Limit access
1295         to the IOKit connection that actually needs it.
1296
1297 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
1298
1299         Unreviewed sandbox fix after r208702
1300
1301         Correct version check to avoid breaking users in Safari Technology Preview
1302         or WebKit nightlies.
1303
1304         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1305         * WebProcess/com.apple.WebProcess.sb.in:
1306
1307 2016-11-14  Pranjal Jumde  <pjumde@apple.com>
1308
1309         Keychain access in WebKit should be limited to a single process. Earlier this was blocked on the networking framework requiring direct access to keychain, this will be resolved in the upcoming version of macOS.
1310         https://bugs.webkit.org/show_bug.cgi?id=163710
1311         <rdar://problem/24357468>
1312
1313         Reviewed by Darin Adler.
1314
1315         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1316         * WebProcess/com.apple.WebProcess.sb.in:
1317
1318 2016-11-13  Darin Adler  <darin@apple.com>
1319
1320         Remove many includes of ExceptionCode.h
1321         https://bugs.webkit.org/show_bug.cgi?id=164706
1322
1323         Reviewed by Alex Christensen.
1324
1325         * WebProcess/Storage/StorageAreaImpl.cpp: Removed include of ExceptionCode.h.
1326
1327 2016-11-13  Darin Adler  <darin@apple.com>
1328
1329         Fix exception handling in SQL database code, streamline and update code
1330         https://bugs.webkit.org/show_bug.cgi?id=164685
1331
1332         Reviewed by Sam Weinig.
1333
1334         * UIProcess/API/efl/ewk_database_manager.cpp:
1335         (EwkDatabaseManager::getDatabaseOrigins): Update for change to the
1336         DatabaseTracker::origins function.
1337         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1338         (WebKit::WebsiteDataStore::fetchData): Use DatabaseTracker.
1339         (WebKit::WebsiteDataStore::removeData): Ditto.
1340         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1341         (WKBundleSetDatabaseQuota): Ditto.
1342         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1343         (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
1344         * WebProcess/WebProcess.cpp:
1345         (WebKit::WebProcess::processWillSuspendImminently): Ditto.
1346
1347 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
1348
1349         Add a way to get the UI-side scrolling tree as text via UIScriptController
1350         https://bugs.webkit.org/show_bug.cgi?id=164697
1351
1352         Reviewed by Zalan Bujtas.
1353
1354         Add a property to WKWebView to retrieve the scrolling tree as text, for testing.
1355         Expose it via the RemoteScrollingCoordinatorProxy.
1356
1357         * UIProcess/API/Cocoa/WKWebView.mm:
1358         (-[WKWebView _scrollingTreeAsText]):
1359         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1360         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1361         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeAsText):
1362         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1363
1364 2016-11-12  Daniel Bates  <dabates@apple.com>
1365
1366         Incorrect release log message emitted when waiting/not waiting for the WebProcess continue a load
1367         https://bugs.webkit.org/show_bug.cgi?id=164605
1368
1369         Reviewed by Darin Adler.
1370
1371         Currently we emit a release log message of the form "didReceiveResponse: Should wait for
1372         message from WebContent process ..." when we are not waiting for the WebProcess and emit
1373         a message of the form "didReceiveResponse: Should not wait for message from WebContent
1374         process" when we are waiting on the WebProcess. Invert these messages to reflect whether
1375         we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponsewhether.
1376
1377         For the main resource NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::No
1378         because we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponse
1379         to continue the load. For a subresource we do not need to wait for the WebProcess to allow the load to continue
1380         and hence NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::Yes.
1381
1382         * NetworkProcess/NetworkResourceLoader.cpp:
1383
1384 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
1385
1386         [iOS WK2] Share some code with Mac for post-async-scroll state reconciliation
1387         https://bugs.webkit.org/show_bug.cgi?id=164694
1388
1389         Reviewed by Zalan Bujtas.
1390
1391         Rather than calling FrameView directly, call reconcileScrollingState() on the scrolling
1392         coordinator.
1393
1394         * WebProcess/WebPage/ios/WebPageIOS.mm:
1395         (WebKit::WebPage::updateVisibleContentRects):
1396
1397 2016-11-12  Brian Burg  <bburg@apple.com>
1398
1399         Web Automation: terminate the automation session if the web process crashes
1400         https://bugs.webkit.org/show_bug.cgi?id=164671
1401         <rdar://problem/29028964>
1402
1403         Reviewed by Joseph Pecoraro.
1404
1405         * UIProcess/Automation/WebAutomationSession.h:
1406         * UIProcess/Automation/WebAutomationSession.cpp:
1407         (WebKit::WebAutomationSession::disconnect):
1408         (WebKit::WebAutomationSession::terminate):
1409         Factor out code that disconnects the remote, unpairs, and notifies the client.
1410         Then, expose terminate() which can be called without a FrontendChannel.
1411         Calling this causes the _WKAutomationDelegate to clear the local-side session in the
1412         browser, and disconnecting from the remote will hang up the remote-side session.
1413
1414         * UIProcess/WebPageProxy.cpp:
1415         (WebKit::WebPageProxy::processDidCrash):
1416         Terminate the session.
1417
1418 2016-11-11  Alex Christensen  <achristensen@webkit.org>
1419
1420         Use SecurityOriginData as keys in StorageManager
1421         https://bugs.webkit.org/show_bug.cgi?id=159834
1422         <rdar://problem/27346948>
1423
1424         Reviewed by Brady Eidson.
1425
1426         * Platform/IPC/HandleMessage.h:
1427         (IPC::callMemberFunctionImpl):
1428         Add a missing std::forward so we can use this callMemberFunctionImpl with rvalues.
1429         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1430         (WKApplicationCacheManagerGetApplicationCacheOrigins):
1431         (WKApplicationCacheManagerDeleteEntriesForOrigin):
1432         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1433         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
1434         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
1435         * UIProcess/API/C/WKResourceCacheManager.cpp:
1436         (WKResourceCacheManagerGetCacheOrigins):
1437         (WKResourceCacheManagerClearCacheForOrigin):
1438         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1439         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
1440         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1441         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
1442         * UIProcess/Databases/DatabaseProcessProxy.h:
1443         * UIProcess/Network/NetworkProcessProxy.cpp:
1444         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
1445         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
1446         * UIProcess/Network/NetworkProcessProxy.h:
1447         * UIProcess/Storage/LocalStorageDatabase.cpp:
1448         (WebKit::LocalStorageDatabase::create):
1449         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1450         (WebKit::LocalStorageDatabase::openDatabase):
1451         (WebKit::LocalStorageDatabase::close):
1452         * UIProcess/Storage/LocalStorageDatabase.h:
1453         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1454         (WebKit::LocalStorageDatabaseTracker::databasePath):
1455         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
1456         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
1457         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
1458         (WebKit::LocalStorageDatabaseTracker::origins):
1459         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1460         * UIProcess/Storage/StorageManager.cpp:
1461         (WebKit::StorageManager::StorageArea::securityOrigin):
1462         (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
1463         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
1464         (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
1465         (WebKit::StorageManager::StorageArea::StorageArea):
1466         (WebKit::StorageManager::StorageArea::clone):
1467         (WebKit::StorageManager::StorageArea::items):
1468         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
1469         (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
1470         (WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
1471         (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
1472         (WebKit::StorageManager::SessionStorageNamespace::origins):
1473         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
1474         (WebKit::StorageManager::SessionStorageNamespace::cloneTo):
1475         (WebKit::StorageManager::getSessionStorageOrigins):
1476         (WebKit::StorageManager::deleteSessionStorageOrigins):
1477         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
1478         (WebKit::StorageManager::getLocalStorageOrigins):
1479         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
1480         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1481         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
1482         (WebKit::StorageManager::createLocalStorageMap):
1483         (WebKit::StorageManager::createTransientLocalStorageMap):
1484         (WebKit::StorageManager::createSessionStorageMap):
1485         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
1486         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
1487         (WebKit::StorageManager::StorageArea::create): Deleted.
1488         (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea): Deleted.
1489         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea): Deleted.
1490         * UIProcess/Storage/StorageManager.h:
1491         * UIProcess/WebProcessProxy.cpp:
1492         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
1493         * UIProcess/WebProcessProxy.h:
1494         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1495         (WebKit::WebsiteDataRecord::displayNameForOrigin):
1496         (WebKit::WebsiteDataRecord::add):
1497         * UIProcess/WebsiteData/WebsiteDataRecord.h:
1498         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1499         (WebKit::WebsiteDataStore::fetchData):
1500         (WebKit::WebsiteDataStore::removeData):
1501         (WebKit::WebsiteDataStore::mediaKeyOrigins):
1502         (WebKit::WebsiteDataStore::removeMediaKeys):
1503         * UIProcess/WebsiteData/WebsiteDataStore.h:
1504         Fewer SecurityOrigin uses in the UIProcess!  Hooray!
1505
1506 2016-11-11  Ryosuke Niwa  <rniwa@webkit.org>
1507
1508         Hovering over a slotted Text node clears hover state
1509         https://bugs.webkit.org/show_bug.cgi?id=164002
1510         <rdar://problem/29040471>
1511
1512         Reviewed by Simon Fraser.
1513
1514         * WebProcess/WebPage/WebPage.cpp:
1515         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
1516         * WebProcess/WebPage/mac/WebPageMac.mm:
1517         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
1518
1519 2016-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1520
1521         [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
1522         https://bugs.webkit.org/show_bug.cgi?id=164538
1523         <rdar://problem/8418711>
1524
1525         Reviewed by Ryosuke Niwa.
1526
1527         Consult HTMLElement::autocorrect() and HTMLElement::autocapitalizeType() when assembling the assisted node
1528         information for the currently assisted node.
1529
1530         * Shared/AssistedNodeInformation.h:
1531         * UIProcess/ios/WKContentViewInteraction.mm:
1532         (toUITextAutocapitalize):
1533         * WebProcess/WebPage/ios/WebPageIOS.mm:
1534         (WebKit::WebPage::getAssistedNodeInformation):
1535
1536 2016-11-11  Beth Dakin  <bdakin@apple.com>
1537
1538         Move to modern TouchBar methods
1539         https://bugs.webkit.org/show_bug.cgi?id=164655
1540         -and corresponding-
1541         rdar://problem/29226911
1542
1543         Reviewed by Wenson Hsieh.
1544
1545         customizationDefaultItemIdentifiers -> defaultItemIdentifiers
1546         itemIdentifiers -> defaultItemIdentifiers
1547         defaultItems -> templateItems
1548
1549         * UIProcess/Cocoa/WebViewImpl.mm:
1550         (WebKit::plainTextTouchBarDefaultItemIdentifiers):
1551         (WebKit::richTextTouchBarDefaultItemIdentifiers):
1552         (WebKit::WebViewImpl::setUpTextTouchBar):
1553         (WebKit::WebViewImpl::updateTextTouchBar):
1554         (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
1555         (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
1556
1557 2016-11-11  Brent Fulgham  <bfulgham@apple.com>
1558
1559         Get rid of old sandbox rules for OS's we no longer support
1560         https://bugs.webkit.org/show_bug.cgi?id=164638
1561
1562         Reviewed by Simon Fraser.
1563
1564         Clean up the various sandbox profiles to get rid of rules that applied to operating system
1565         versions we no longer support, or were added in support of bugs that have long since been
1566         fixed.
1567
1568         This should introduce no change in behavior.
1569
1570         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
1571         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1572         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1573         * Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb:
1574         * WebProcess/com.apple.WebProcess.sb.in:
1575
1576 2016-11-11  Brady Eidson  <beidson@apple.com>
1577
1578         IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
1579         https://bugs.webkit.org/show_bug.cgi?id=164641
1580
1581         Reviewed by Alex Christensen.
1582
1583         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1584         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
1585         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1586         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1587
1588         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1589         (WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose):
1590         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1591
1592 2016-11-11  Eric Carlson  <eric.carlson@apple.com>
1593
1594         [MediaStream] defer resolution of getUserMedia promise made in a background tab
1595         https://bugs.webkit.org/show_bug.cgi?id=164643
1596         <rdar://problem/29048317>
1597
1598         Reviewed by Brady Eidson.
1599
1600         Do not ask for user for access to capture devices when the document does not
1601         allow media to play, wait until playback is allowed.
1602
1603         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1604         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
1605         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
1606         (WebKit::UserMediaPermissionRequestManager::mediaCanStart):
1607         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension):
1608         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1609         * WebProcess/Plugins/PluginView.cpp:
1610         (WebKit::PluginView::mediaCanStart):
1611         * WebProcess/Plugins/PluginView.h:
1612
1613 2016-11-11  Darin Adler  <darin@apple.com>
1614
1615         Move Node from ExceptionCode to ExceptionOr
1616         https://bugs.webkit.org/show_bug.cgi?id=164515
1617
1618         Reviewed by Sam Weinig.
1619
1620         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
1621         (webkit_dom_html_select_element_remove): Updated exception handling.
1622         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
1623         (webkit_dom_node_insert_before): Ditto.
1624         (webkit_dom_node_replace_child): Ditto.
1625         (webkit_dom_node_remove_child): Ditto.
1626         (webkit_dom_node_append_child): Ditto.
1627         (webkit_dom_node_clone_node_with_error): Ditto.
1628         (webkit_dom_node_set_node_value): Ditto.
1629         (webkit_dom_node_set_text_content): Ditto.
1630         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
1631         (-[WKDOMNode insertNode:before:]): Ditto.
1632         (-[WKDOMNode appendChild:]): Ditto.
1633         (-[WKDOMNode removeChild:]): Ditto.
1634
1635         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1636         (WebKit::PDFPlugin::PDFPlugin): Removed unneeded ASSERT_NO_EXCEPTION.
1637         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
1638         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): Ditto.
1639
1640 2016-11-11  Megan Gardner  <megan_gardner@apple.com>
1641
1642         [Cocoa] Support wide gamut for Drag Image UI
1643         https://bugs.webkit.org/show_bug.cgi?id=164490
1644
1645         Reviewed by Tim Horton.
1646
1647         Fixed an error in the gating for the new wide gamut support in ShareableBitmap.
1648         We should always respect the flags straight out, and not make decisions later, it can lead to mismatched data and data storage.
1649         Added support for wide gamut in createCGImage.
1650
1651         * Shared/cg/ShareableBitmapCG.cpp:
1652         (WebKit::bitmapInfo):
1653         (WebKit::colorSpace):
1654         (WebKit::ShareableBitmap::createGraphicsContext):
1655         (WebKit::ShareableBitmap::createCGImage):
1656         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1657         (WebKit::convertImageToBitmap):
1658         (WebKit::WebDragClient::startDrag):
1659
1660 2016-11-11  Beth Dakin  <bdakin@apple.com>
1661
1662         Get touch bar code building for open source builds
1663         https://bugs.webkit.org/show_bug.cgi?id=164610
1664
1665         Reviewed by Wenson Hsieh.
1666
1667         * config.h:
1668
1669 2016-11-10  Brent Fulgham  <bfulgham@apple.com>
1670
1671         Remove unused FontService from sandbox profile
1672         https://bugs.webkit.org/show_bug.cgi?id=164625
1673         <rdar://problem/26899976>
1674
1675         Reviewed by Alex Christensen.
1676
1677         Part of some general sandbox profile gardening.
1678
1679         Convert the Plugin process sandbox into 
1680
1681         * Configurations/WebKit.xcconfig: Add exclude for com.apple.WebKit.plugin-common.sb.in.
1682         * DerivedSources.make: Update to generate com.apple.WebKit.plugin-common.sb from .in file
1683         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Copied from Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb.
1684         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Removed.
1685         * WebKit2.xcodeproj/project.pbxproj: Update for new .in file.
1686         * WebProcess/com.apple.WebProcess.sb.in: Remove com.apple.FontServer
1687         from macOS Sierra and newer.
1688
1689 2016-11-10  Eric Carlson  <eric.carlson@apple.com>
1690
1691         [MediaStream] apply constraints passed to getUserMedia()
1692         https://bugs.webkit.org/show_bug.cgi?id=164561
1693
1694         Reviewed by Youenn Fablet.
1695         <rdar://problem/29191384>
1696
1697         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1698         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1699
1700 2016-11-10  Alex Christensen  <achristensen@webkit.org>
1701
1702         Move SecurityOrigin::databaseIdentifier() to SecurityOriginData
1703         https://bugs.webkit.org/show_bug.cgi?id=164573
1704
1705         Reviewed by Brady Eidson.
1706
1707         * Shared/API/c/WKSecurityOriginRef.cpp:
1708         (WKSecurityOriginCopyDatabaseIdentifier):
1709         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1710         (WebKit::LocalStorageDatabaseTracker::databasePath):
1711         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
1712         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
1713         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1714         (WebKit::WebsiteDataStore::removeMediaKeys):
1715         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1716         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1717         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1718         (WKBundlePageCopyOriginsWithApplicationCache):
1719         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1720         (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectoryForOrigin):
1721         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1722         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
1723         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
1724         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1725         (WebKit::WebChromeClient::exceededDatabaseQuota):
1726         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
1727
1728 2016-11-10  Alex Christensen  <achristensen@webkit.org>
1729
1730         Remove unused CFURLCACHE code
1731         https://bugs.webkit.org/show_bug.cgi?id=164551
1732
1733         Reviewed by Antti Koivisto.
1734
1735         WebKit2 doesn't use CFURLCache, but we still have some unused code that seems to use it.
1736
1737         * NetworkProcess/NetworkProcess.cpp:
1738         (WebKit::fetchDiskCacheEntries):
1739         (WebKit::clearDiskCacheEntries):
1740         * NetworkProcess/NetworkProcess.h:
1741         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1742         (WebKit::partitionName): Deleted.
1743         (WebKit::NetworkProcess::cfURLCacheOrigins): Deleted.
1744         (WebKit::NetworkProcess::clearCFURLCacheForOrigins): Deleted.
1745
1746 2016-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1747
1748         [Linux] Memory process values shown by the WebMemorySampler in linux are wrong
1749         https://bugs.webkit.org/show_bug.cgi?id=164591
1750
1751         Reviewed by Michael Catanzaro.
1752
1753         It's parsing /proc/self/statm, and returning the values as if they were bytes, but they are number of pages, so
1754         to get the bytes we need to take the page size into account. In r208534 I added a method to get /proc/self/statm
1755         values in bytes to Platform layer, so we can simply use that instead.
1756
1757         * Shared/linux/WebMemorySamplerLinux.cpp:
1758         (WebKit::WebMemorySampler::sampleWebKit): Use currentProcessMemoryStatus() and update the descriptions to
1759         clarify that values are in bytes.
1760
1761 2016-10-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1762
1763         MemoryPressureHandler shouldn't know how to release WebCore memory
1764         https://bugs.webkit.org/show_bug.cgi?id=160497
1765
1766         Reviewed by Michael Catanzaro.
1767
1768         Set the low memory handler before installing the memory pressure handler.
1769
1770         * WebProcess/WebProcess.cpp:
1771         (WebKit::WebProcess::initializeWebProcess):
1772         * WebProcess/cocoa/WebProcessCocoa.mm:
1773         (WebKit::WebProcess::platformInitializeWebProcess):
1774
1775 2016-10-27  Sergio Villar Senin  <svillar@igalia.com>
1776
1777         [GTK] New API to notify about dynamically added forms
1778         https://bugs.webkit.org/show_bug.cgi?id=164050
1779
1780         Reviewed by Carlos Garcia Campos.
1781
1782         This new API exports the WebCore event didAssociateFormControls through the web extension
1783         mechanism. This will help clients (mainly web browsers) to implement robust auto filling
1784         mechanisms. It deals nicely with dynamically created forms (and form controls) as many JS
1785         frameworks do nowadays.
1786
1787         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: Added a FormClient implementation of
1788         API::InjectedBundle::FormClient.
1789         (webkitWebPageFormControlsAssociated): Emit the new signal.
1790         (webkit_web_page_class_init): Added the new signal "forms-controls-associated".
1791         (webkitWebPageCreate): Set the WebPage as a FormClient.
1792
1793 2016-11-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1794
1795         [GTK] Allow to use WebMemorySampler feature.
1796         https://bugs.webkit.org/show_bug.cgi?id=164517
1797
1798         Reviewed by Carlos Garcia Campos.
1799
1800         Enable the WebMemorySampler with the environment variable WEBKIT_SAMPLE_MEMORY.
1801
1802         When enabled, it will dump the stats to /tmp each second.
1803
1804         * UIProcess/API/gtk/WebKitWebContext.cpp:
1805         (webkitWebContextConstructed):
1806
1807 2016-11-10  Philippe Normand  <pnormand@igalia.com>
1808
1809         [WK2][GTK][GStreamer] Build fails when -plugins-base and -core headers are not installed in the same directory
1810         https://bugs.webkit.org/show_bug.cgi?id=148894
1811
1812         Reviewed by Carlos Garcia Campos.
1813
1814         The pbutils (gst-plugins-base-utils) headers are needed in
1815         WebKit2/GTK for the permission request API related with the
1816         GStreamer codec installer. It builds fine in most cases without
1817         explicitely requiring the pbutils include directory path because
1818         usually all the GStreamer headers are installed in the same path,
1819         excepted for some distributions, like NixOS.
1820
1821         * PlatformGTK.cmake: The GStreamer pbutils include directory was
1822         missing in the header search path.
1823
1824 2016-11-09  Chris Dumez  <cdumez@apple.com>
1825
1826         [WK2][!NETWORK_SESSION] Add support for downloading file backed blobs
1827         https://bugs.webkit.org/show_bug.cgi?id=164522
1828
1829         Reviewed by Alex Christensen.
1830
1831         Add support for downloading file backed blobs for the non-NETWORK_SESSION
1832         code path of WebKit2, which is still use on pre-Sierra macOS.
1833
1834         * NetworkProcess/Downloads/Download.cpp:
1835         (WebKit::Download::~Download):
1836         * NetworkProcess/Downloads/Download.h:
1837         (WebKit::Download::setBlobFileReferences):
1838         * NetworkProcess/Downloads/DownloadManager.cpp:
1839         (WebKit::DownloadManager::startDownload):
1840         (WebKit::DownloadManager::convertNetworkLoadToDownload):
1841         * NetworkProcess/Downloads/DownloadManager.h:
1842         * NetworkProcess/NetworkResourceLoader.cpp:
1843         (WebKit::NetworkResourceLoader::convertToDownload):
1844
1845 2016-11-09  Chris Dumez  <cdumez@apple.com>
1846
1847         [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
1848         https://bugs.webkit.org/show_bug.cgi?id=164458
1849         <rdar://problem/28905514>
1850
1851         Reviewed by Darin Adler.
1852
1853         Add support for downloading file backed blobs on WebKit2.
1854         It previously wasn't working because we weren't calling
1855         BlobDataFileReference::prepareForFileAccess() for each blob file before
1856         starting the download, similarly to what is done in NetworkResourceLoader's
1857         consumeSandboxExtensions().
1858
1859         * NetworkProcess/Downloads/DownloadManager.cpp:
1860         (WebKit::DownloadManager::startDownload):
1861         * NetworkProcess/Downloads/DownloadManager.h:
1862         (WebKit::DownloadManager::startDownload):
1863         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1864         (WebKit::NetworkConnectionToWebProcess::startDownload):
1865         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1866         * NetworkProcess/NetworkDataTask.cpp:
1867         (WebKit::NetworkDataTask::create):
1868         * NetworkProcess/NetworkDataTask.h:
1869         * NetworkProcess/NetworkDataTaskBlob.cpp:
1870         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1871         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
1872         (WebKit::NetworkDataTaskBlob::download):
1873         * NetworkProcess/NetworkDataTaskBlob.h:
1874         * NetworkProcess/NetworkLoad.cpp:
1875         (WebKit::NetworkLoad::NetworkLoad):
1876         * NetworkProcess/NetworkLoadParameters.h:
1877         * NetworkProcess/NetworkProcess.cpp:
1878         (WebKit::NetworkProcess::downloadRequest):
1879         * NetworkProcess/NetworkResourceLoader.cpp:
1880         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1881         (WebKit::NetworkResourceLoader::startNetworkLoad):
1882         * NetworkProcess/PingLoad.h:
1883
1884 2016-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1885
1886         NetworkSession: Network process crash when converting main resource to download
1887         https://bugs.webkit.org/show_bug.cgi?id=164220
1888
1889         Reviewed by Alex Christensen.
1890
1891         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
1892         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
1893         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
1894         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
1895         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
1896         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
1897         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
1898         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
1899         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
1900         created yet. That's not expected to happen and when the response completion handler is called in the
1901         NetworkDataTask it tries to use either the client or the download and it crashes.
1902         We need to cleanup and destroy the ResourceLoader as soon as it becomes a download, because that's the expected
1903         behavior, but at the same time we need to keep the NetworkLoad alive until the NetworkDataTask finishes to become
1904         a download. This patch creates a PendingDownload to take the ownership of the NetworkLoad, so that
1905         ResourceLoader can be cleaned up and destroyed. The DownloadManager now will handle the PendingDownload as if it
1906         was created by startDownload(), but ensuring it's deleted right before the final Download object is added to the
1907         downloads map. That way NetworkDataTask will always have a valid client until the final Download is created,
1908         first the ResourceLoader and then the PendingDownload. Since the DownloadManager is the owner of the
1909         PendingDownload we no longer need the didBecomeDownload() callback to delete the NetworkLoad, because the
1910         NetworkLoad will always be owned by the PendingDownload now that will be deleted by the DownloadManager.
1911
1912         * NetworkProcess/Downloads/DownloadManager.cpp:
1913         (WebKit::DownloadManager::dataTaskBecameDownloadTask): Change the ASSERT because at this point we should always
1914         have a PendingDownload, and then remove it from the map here before adding the final Download to the map.
1915         (WebKit::DownloadManager::convertNetworkLoadToDownload): This replaces convertHandleToDownload, but it also now
1916         used for the NetworkSession. It creates a PendingDownload for the given NetworkLoad.
1917         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Do not take the PendingDownload from the
1918         map here, just check it's present, because it will be removed from dataTaskBecameDownloadTask().
1919         (WebKit::DownloadManager::convertHandleToDownload): Deleted.
1920         * NetworkProcess/Downloads/DownloadManager.h:
1921         * NetworkProcess/Downloads/PendingDownload.cpp:
1922         (WebKit::PendingDownload::PendingDownload): Add a constructor that receives a NetworkLoad.
1923         * NetworkProcess/Downloads/PendingDownload.h:
1924         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1925         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Just ask the ResourceLoader to be
1926         converted to a download.
1927         * NetworkProcess/NetworkDataTask.h:
1928         * NetworkProcess/NetworkDataTaskBlob.cpp:
1929         (WebKit::NetworkDataTaskBlob::download): Do not call didBecomeDownload() and add an assert to ensure the client
1930         has already been removed right after the final Download object is created.
1931         * NetworkProcess/NetworkLoad.cpp:
1932         (WebKit::NetworkLoad::NetworkLoad): Use a pointer for the client instead of a reference because now we need to
1933         change the client when the load is converted to a download. We don't need to null check the client in any case
1934         because the member is only updated internally and always from a passed reference.
1935         (WebKit::NetworkLoad::sharedDidReceiveResponse):
1936         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
1937         (WebKit::NetworkLoad::convertTaskToDownload): This now receives a PendingDownload. It updates the client and no
1938         longer sends DidStart, because the PendingDownload sends it now.
1939         (WebKit::NetworkLoad::didReceiveChallenge):
1940         (WebKit::NetworkLoad::didReceiveData):
1941         (WebKit::NetworkLoad::didCompleteWithError):
1942         (WebKit::NetworkLoad::didSendData):
1943         (WebKit::NetworkLoad::wasBlocked):
1944         (WebKit::NetworkLoad::cannotShowURL):
1945         (WebKit::NetworkLoad::didReceiveBuffer):
1946         (WebKit::NetworkLoad::didFinishLoading):
1947         (WebKit::NetworkLoad::didFail):
1948         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
1949         (WebKit::NetworkLoad::didBecomeDownload): Deleted.
1950         * NetworkProcess/NetworkLoad.h:
1951         * NetworkProcess/NetworkLoadClient.h: Remove didBecomeDownload().
1952         * NetworkProcess/NetworkResourceLoader.cpp:
1953         (WebKit::NetworkResourceLoader::convertToDownload): This replaces didBecomeDownload() and
1954         didConvertToDownload(). It transfers the NetworkLoad to the DownloadManager.
1955         (WebKit::NetworkResourceLoader::abort): We don't need to check if the load was converted to a download here,
1956         because m_networkLoad will always be null here in such case.
1957         (WebKit::NetworkResourceLoader::didBecomeDownload): Deleted
1958         (WebKit::NetworkResourceLoader::didConvertToDownload): Deleted
1959         * NetworkProcess/NetworkResourceLoader.h:
1960         * NetworkProcess/PingLoad.h: Remove didBecomeDownload().
1961         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto.
1962         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Ditto.
1963         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Ditto.
1964         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1965         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Do not call didBecomeDownload().
1966         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1967         (WebKit::NetworkDataTaskSoup::download): Do not call didBecomeDownload() and add an assert to ensure the client
1968         has already been removed right after the final Download object is created.
1969
1970 2016-11-09  Alex Christensen  <achristensen@webkit.org>
1971
1972         Unreviewed, rolling out r208438.
1973
1974         crashes
1975
1976         Reverted changeset:
1977
1978         "[WK2][NETWORK_SESSION] Add support for downloading file
1979         backed blobs"
1980         https://bugs.webkit.org/show_bug.cgi?id=164458
1981         http://trac.webkit.org/changeset/208438
1982
1983 2016-11-04  Brent Fulgham  <bfulgham@apple.com>
1984
1985         Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
1986         https://bugs.webkit.org/show_bug.cgi?id=155185
1987         <rdar://problem/11101440>
1988
1989         Reviewed by Brady Eidson.
1990
1991         Provide SPI to access the new quirk for localStorage. The quirk defaults to 'on'. When active, this
1992         quirk says that localStorage access should be granted, without needing to grant universal file access.
1993
1994         If the quirk is turned off, then localStorage is blocked unless the WebKit client explicitly
1995         grants universal file access.
1996         
1997         Tested by existing TestWebKitAPI tests and WebKit2.LocalStorageQuirkTest
1998
1999         * Shared/WebPreferencesDefinitions.h:
2000         * UIProcess/API/C/WKPreferences.cpp:
2001         (WKPreferencesSetNeedsLocalStorageQuirk): Added.
2002         (WKPreferencesGetNeedsLocalStorageQuirk): Added.
2003         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2004         * UIProcess/API/Cocoa/WKWebView.mm:
2005         (-[WKWebView _initializeWithConfiguration:]): Honor the new localStorage quirk.
2006         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2007         (-[WKWebViewConfiguration init]): Honor the new localStorage quirk flag.
2008         (-[WKWebViewConfiguration copyWithZone:]): Ditto.
2009         (-[WKWebViewConfiguration _needsLocalStorageQuirk]): Added.
2010         (-[WKWebViewConfiguration _setNeedsLocalStorageQuirk:]): Added.
2011         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2012         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2013         (WKBundleSetNeedsLocalStorageQuirk): Added.
2014         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2015         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2016         (WebKit::InjectedBundle::setNeedsLocalStorageQuirk): Added.
2017         * WebProcess/InjectedBundle/InjectedBundle.h:
2018         * WebProcess/WebPage/WebPage.cpp:
2019         (WebKit::WebPage::updatePreferences): Honor the new localStorage quirk flag.
2020
2021 2016-11-09  Simon Fraser  <simon.fraser@apple.com>
2022
2023         Implement visual-viewport based position:fixed handling for Mac async scrolling
2024         https://bugs.webkit.org/show_bug.cgi?id=164495
2025
2026         Reviewed by Tim Horton.
2027
2028         Educate the scrolling tree about visual and layout viewports. This is runtime-switchable,
2029         so we push the enable flag to via the root state node, then push the layout viewport,
2030         and the min/max scroll position that contstrain it, through frame state nodes.
2031
2032         When a scroll happens, we compute a new layout viewport when the visual viewport hits
2033         an edge, and push that down through setScrollLayerPosition() since it's used to position
2034         fixed and sticky layers.
2035
2036         The iOS code is made to compile, but not work yet.
2037
2038         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2039         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
2040         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
2041         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2042         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
2043         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2044         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2045         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
2046         * UIProcess/Scrolling/RemoteScrollingTree.h:
2047         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2048         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2049         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition):
2050         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2051         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
2052
2053 2016-11-09  Beth Dakin  <bdakin@apple.com>
2054
2055         More attempted build fix.
2056
2057         * UIProcess/Cocoa/WebViewImpl.mm:
2058
2059 2016-11-09  Alex Christensen  <achristensen@webkit.org>
2060
2061         Clean up Storage code
2062         https://bugs.webkit.org/show_bug.cgi?id=164562
2063
2064         Reviewed by Brady Eidson.
2065
2066         Use more Refs!
2067
2068         * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
2069         * Platform/IPC/Connection.cpp:
2070         (IPC::Connection::addWorkQueueMessageReceiver):
2071         * Platform/IPC/Connection.h:
2072         * UIProcess/Storage/LocalStorageDatabase.cpp:
2073         (WebKit::LocalStorageDatabase::create):
2074         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
2075         * UIProcess/Storage/LocalStorageDatabase.h:
2076         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2077         (WebKit::LocalStorageDatabaseTracker::create):
2078         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
2079         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
2080         * UIProcess/Storage/StorageManager.cpp:
2081         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
2082         (WebKit::StorageManager::StorageManager):
2083         * UIProcess/Storage/StorageManager.h:
2084         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2085         (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
2086         * UIProcess/mac/SecItemShimProxy.cpp:
2087         (WebKit::SecItemShimProxy::initializeConnection):
2088         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2089         (WebKit::PluginProcessConnectionManager::initializeConnection):
2090         * WebProcess/WebPage/EventDispatcher.cpp:
2091         (WebKit::EventDispatcher::initializeConnection):
2092         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
2093         (WebKit::ViewUpdateDispatcher::initializeConnection):
2094
2095 2016-11-09  Beth Dakin  <bdakin@apple.com>
2096
2097         Another attempted build fix.
2098
2099         * UIProcess/Cocoa/WebViewImpl.mm:
2100
2101 2016-11-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2102
2103         Experimental features should not be enabled by default
2104         https://bugs.webkit.org/show_bug.cgi?id=164367
2105
2106         Reviewed by Darin Adler.
2107
2108         We have two classes of experimental features:
2109
2110         (1) Features that are unstable and should be off by default, except for the developers
2111             currently working on them. This is straightforward to handle; the default value should
2112             be false.
2113         (2) Features that are still not ready for end users, but are stable enough for testing. We
2114             want these features to be enabled in testing environments like the bots, MiniBrowser,
2115             Safari Tech Preview, and so forth, but not in stable release builds.
2116
2117         Implement this. It is better than having all experimental features on unconditionally, and
2118         expecting them to be disabled manually on release branches, which is not something we are
2119         keen to do. An exception is Cocoa ports, which to my knowledge do not currently have any
2120         concept of development builds. These ports seem happy to continue disabling features
2121         manually in release branches, and should continue to do so at least for now.
2122
2123         We also have features that we wish to enumerate at runtime, yet have enabled by default
2124         unconditionally. We do not currently have any infrastructure to support this and should not
2125         abuse the experimental status for this purpose; it requires future work. All settings can
2126         still be toggled at runtime by clients that know about them using the existing runtime
2127         features API.
2128
2129         Lastly, the custom elements feature is ready to be enabled by default, so it's no longer
2130         experimental and can graduate to the list of normal boolean features.
2131
2132         * Shared/WebPreferencesDefinitions.h:
2133
2134 2016-11-09  Beth Dakin  <bdakin@apple.com>
2135
2136         Build fix.
2137
2138         * UIProcess/Cocoa/WebViewImpl.mm:
2139
2140 2016-11-09  Brady Eidson  <beidson@apple.com>
2141
2142         IndexedDB 2.0: Encapsulate cursor iteration parameters for easy future expansion.
2143         https://bugs.webkit.org/show_bug.cgi?id=164504
2144
2145         Reviewed by Darin Adler.
2146
2147         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2148         (WebKit::WebIDBConnectionToClient::iterateCursor):
2149         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2150         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2151
2152         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2153         (WebKit::WebIDBConnectionToServer::iterateCursor):
2154         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2155
2156 2016-11-09  Darin Adler  <darin@apple.com>
2157
2158         Move Range from ExceptionCode to ExceptionOr
2159         https://bugs.webkit.org/show_bug.cgi?id=164457
2160
2161         Reviewed by Alex Christensen.
2162
2163         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
2164         (webkit_dom_range_set_start): Updated exception handling.
2165         (webkit_dom_range_set_end): Ditto.
2166         (webkit_dom_range_set_start_before): Ditto.
2167         (webkit_dom_range_set_start_after): Ditto.
2168         (webkit_dom_range_set_end_before): Ditto.
2169         (webkit_dom_range_set_end_after): Ditto.
2170         (webkit_dom_range_select_node): Ditto.
2171         (webkit_dom_range_select_node_contents): Ditto.
2172         (webkit_dom_range_compare_boundary_points): Ditto.
2173         (webkit_dom_range_delete_contents): Ditto.
2174         (webkit_dom_range_extract_contents): Ditto.
2175         (webkit_dom_range_clone_contents): Ditto.
2176         (webkit_dom_range_insert_node): Ditto.
2177         (webkit_dom_range_surround_contents): Ditto.
2178         (webkit_dom_range_create_contextual_fragment): Ditto.
2179         (webkit_dom_range_compare_node): Ditto.
2180         (webkit_dom_range_intersects_node): Ditto.
2181         (webkit_dom_range_compare_point): Ditto.
2182         (webkit_dom_range_is_point_in_range): Ditto.
2183         (webkit_dom_range_expand): Ditto.
2184         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
2185         (-[WKDOMRange setStart:offset:]): Ditto.
2186         (-[WKDOMRange setEnd:offset:]): Ditto.
2187         (-[WKDOMRange selectNode:]): Ditto.
2188         (-[WKDOMRange selectNodeContents:]): Ditto.
2189         * WebProcess/WebPage/WebFrame.cpp:
2190         (WebKit::WebFrame::contentsAsString): Ditto.
2191         * WebProcess/WebPage/ios/WebPageIOS.mm:
2192         (WebKit::WebPage::rangeForWebSelectionAtPosition): Ditto.
2193         (WebKit::WebPage::rangeForBlockAtPoint): Ditto.
2194         (WebKit::WebPage::selectWithGesture): Ditto.
2195         (WebKit::containsRange): Ditto.
2196         (WebKit::unionDOMRanges): Ditto.
2197         (WebKit::WebPage::switchToBlockSelectionAtPoint): Ditto.
2198         (WebKit::WebPage::getPositionInformation): Ditto.
2199
2200
2201 2016-11-09  Darin Adler  <darin@apple.com>
2202
2203         Move EventTarget from ExceptionCode to ExceptionOr
2204         https://bugs.webkit.org/show_bug.cgi?id=164465
2205
2206         Reviewed by Youenn Fablet.
2207
2208         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
2209         (webkit_dom_attr_dispatch_event): Updated exception handling.
2210         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
2211         (webkit_dom_cdata_section_dispatch_event): Ditto.
2212         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
2213         (webkit_dom_character_data_dispatch_event): Ditto.
2214         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
2215         (webkit_dom_comment_dispatch_event): Ditto.
2216         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
2217         (webkit_dom_dom_window_dispatch_event): Ditto.
2218         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
2219         (webkit_dom_document_dispatch_event): Ditto.
2220         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
2221         (webkit_dom_document_fragment_dispatch_event): Ditto.
2222         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
2223         (webkit_dom_document_type_dispatch_event): Ditto.
2224         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2225         (webkit_dom_element_dispatch_event): Ditto.
2226         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
2227         (webkit_dom_html_anchor_element_dispatch_event): Ditto.
2228         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
2229         (webkit_dom_html_applet_element_dispatch_event): Ditto.
2230         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
2231         (webkit_dom_html_area_element_dispatch_event): Ditto.
2232         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
2233         (webkit_dom_html_br_element_dispatch_event): Ditto.
2234         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
2235         (webkit_dom_html_base_element_dispatch_event): Ditto.
2236         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
2237         (webkit_dom_html_body_element_dispatch_event): Ditto.
2238         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
2239         (webkit_dom_html_button_element_dispatch_event): Ditto.
2240         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
2241         (webkit_dom_html_canvas_element_dispatch_event): Ditto.
2242         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
2243         (webkit_dom_html_d_list_element_dispatch_event): Ditto.
2244         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
2245         (webkit_dom_html_directory_element_dispatch_event): Ditto.
2246         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
2247         (webkit_dom_html_div_element_dispatch_event): Ditto.
2248         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
2249         (webkit_dom_html_document_dispatch_event): Ditto.
2250         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
2251         (webkit_dom_html_element_dispatch_event): Ditto.
2252         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
2253         (webkit_dom_html_embed_element_dispatch_event): Ditto.
2254         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
2255         (webkit_dom_html_field_set_element_dispatch_event): Ditto.
2256         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
2257         (webkit_dom_html_font_element_dispatch_event): Ditto.
2258         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
2259         (webkit_dom_html_form_element_dispatch_event): Ditto.
2260         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
2261         (webkit_dom_html_frame_element_dispatch_event): Ditto.
2262         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
2263         (webkit_dom_html_frame_set_element_dispatch_event): Ditto.
2264         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
2265         (webkit_dom_html_hr_element_dispatch_event): Ditto.
2266         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
2267         (webkit_dom_html_heading_element_dispatch_event): Ditto.
2268         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
2269         (webkit_dom_html_head_element_dispatch_event): Ditto.
2270         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
2271         (webkit_dom_html_html_element_dispatch_event): Ditto.
2272         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
2273         (webkit_dom_html_iframe_element_dispatch_event): Ditto.
2274         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
2275         (webkit_dom_html_image_element_dispatch_event): Ditto.
2276         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
2277         (webkit_dom_html_input_element_dispatch_event): Ditto.
2278         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
2279         (webkit_dom_html_li_element_dispatch_event): Ditto.
2280         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
2281         (webkit_dom_html_label_element_dispatch_event): Ditto.
2282         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
2283         (webkit_dom_html_legend_element_dispatch_event): Ditto.
2284         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
2285         (webkit_dom_html_link_element_dispatch_event): Ditto.
2286         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
2287         (webkit_dom_html_map_element_dispatch_event): Ditto.
2288         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
2289         (webkit_dom_html_marquee_element_dispatch_event): Ditto.
2290         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
2291         (webkit_dom_html_menu_element_dispatch_event): Ditto.
2292         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
2293         (webkit_dom_html_meta_element_dispatch_event): Ditto.
2294         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
2295         (webkit_dom_html_mod_element_dispatch_event): Ditto.
2296         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
2297         (webkit_dom_html_o_list_element_dispatch_event): Ditto.
2298         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
2299         (webkit_dom_html_object_element_dispatch_event): Ditto.
2300         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
2301         (webkit_dom_html_opt_group_element_dispatch_event): Ditto.
2302         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
2303         (webkit_dom_html_option_element_dispatch_event): Ditto.
2304         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
2305         (webkit_dom_html_paragraph_element_dispatch_event): Ditto.
2306         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
2307         (webkit_dom_html_param_element_dispatch_event): Ditto.
2308         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
2309         (webkit_dom_html_pre_element_dispatch_event): Ditto.
2310         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
2311         (webkit_dom_html_quote_element_dispatch_event): Ditto.
2312         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
2313         (webkit_dom_html_script_element_dispatch_event): Ditto.
2314         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2315         (webkit_dom_html_select_element_dispatch_event): Ditto.
2316         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
2317         (webkit_dom_html_style_element_dispatch_event): Ditto.
2318         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
2319         (webkit_dom_html_table_caption_element_dispatch_event): Ditto.
2320         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
2321         (webkit_dom_html_table_cell_element_dispatch_event): Ditto.
2322         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
2323         (webkit_dom_html_table_col_element_dispatch_event): Ditto.
2324         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
2325         (webkit_dom_html_table_element_dispatch_event): Ditto.
2326         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
2327         (webkit_dom_html_table_row_element_dispatch_event): Ditto.
2328         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
2329         (webkit_dom_html_table_section_element_dispatch_event): Ditto.
2330         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
2331         (webkit_dom_html_text_area_element_dispatch_event): Ditto.
2332         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
2333         (webkit_dom_html_title_element_dispatch_event): Ditto.
2334         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
2335         (webkit_dom_html_u_list_element_dispatch_event): Ditto.
2336         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
2337         (webkit_dom_node_dispatch_event): Ditto.
2338         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
2339         (webkit_dom_processing_instruction_dispatch_event): Ditto.
2340         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
2341         (webkit_dom_text_dispatch_event): Ditto.
2342
2343 2016-11-08  Dean Jackson  <dino@apple.com>
2344
2345         Rendering support for ExtendedColors
2346         https://bugs.webkit.org/show_bug.cgi?id=164443
2347         <rdar://problems/29123243>
2348
2349         Reviewed by Simon Fraser and Darin Adler.
2350
2351         Implement argument coders for Color.
2352
2353         * Shared/WebCoreArgumentCoders.cpp:
2354         (IPC::ArgumentCoder<Color>::encode):
2355         (IPC::ArgumentCoder<Color>::decode):
2356         * Shared/WebCoreArgumentCoders.h:
2357         * UIProcess/API/Cocoa/WKWebView.mm:
2358         (-[WKWebView _updateScrollViewBackground]):
2359
2360 2016-11-09  Beth Dakin  <bdakin@apple.com>
2361
2362         Build fix.
2363
2364         * UIProcess/Cocoa/WebViewImpl.mm:
2365         (WebKit::WebViewImpl::~WebViewImpl):
2366
2367 2016-11-09  Chris Dumez  <cdumez@apple.com>
2368
2369         [Mac] Stop using deprecated AppKit enumeration values
2370         https://bugs.webkit.org/show_bug.cgi?id=164494
2371
2372         Reviewed by Darin Adler.
2373
2374         Stop using deprecated AppKit enumeration values.
2375
2376         * Shared/mac/ChildProcessMac.mm:
2377         (WebKit::ChildProcess::stopNSAppRunLoop):
2378         * Shared/mac/WebEventFactory.mm:
2379         (WebKit::mouseButtonForEvent):
2380         (WebKit::mouseEventTypeForEvent):
2381         (WebKit::clickCountForEvent):
2382         (WebKit::globalPointForEvent):
2383         (WebKit::pointForEvent):
2384         (WebKit::textFromEvent):
2385         (WebKit::unmodifiedTextFromEvent):
2386         (WebKit::isKeypadEvent):
2387         (WebKit::isKeyUpEvent):
2388         (WebKit::WebEventFactory::createWebKeyboardEvent):
2389         * UIProcess/Cocoa/WebViewImpl.mm:
2390         (WebKit::WebViewImpl::becomeFirstResponder):
2391         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
2392         (WebKit::WebViewImpl::viewDidMoveToWindow):
2393         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
2394         (WebKit::WebViewImpl::createFullScreenWindow):
2395         (WebKit::WebViewImpl::sendToolTipMouseExited):
2396         (WebKit::WebViewImpl::sendToolTipMouseEntered):
2397         (WebKit::applicationFlagsForDrag):
2398         (WebKit::WebViewImpl::setLastMouseDownEvent):
2399         (WebKit::WebViewImpl::doneWithKeyEvent):
2400         (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
2401         (WebKit::WebViewImpl::performKeyEquivalent):
2402         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2403         (WebKit::PluginProcessProxy::beginModal):
2404         * UIProcess/mac/WebContextMenuProxyMac.mm:
2405         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
2406         * UIProcess/mac/WebInspectorProxyMac.mm:
2407         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2408         (WebKit::WebPopupMenuProxyMac::populate):
2409         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2410         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2411         (WebKit::modifierFlagsFromWebEvent):
2412         (WebKit::getEventTypeFromWebEvent):
2413         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
2414         (WebKit::cssAlignmentValueForNSTextAlignment):
2415         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2416         (WebKit::convertImageToBitmap):
2417
2418 2016-11-09  Beth Dakin  <bdakin@apple.com>
2419
2420         Support TouchBar in WebKit
2421         https://bugs.webkit.org/show_bug.cgi?id=164437
2422         -and corresponding-
2423         rdar://problem/28876524
2424
2425         Reviewed by Darin Adler.
2426
2427         * UIProcess/API/Cocoa/WKViewPrivate.h:
2428         * UIProcess/API/Cocoa/WKWebView.mm:
2429         (-[WKWebView makeTouchBar]):
2430         (-[WKWebView candidateListTouchBarItem]):
2431         (-[WKWebView _web_didAddMediaControlsManager:]):
2432         (-[WKWebView _web_didRemoveMediaControlsManager]):
2433         (-[WKWebView _interactWithMediaControlsForTesting]):
2434         (-[WKWebView _wantsMediaPlaybackControlsView]):
2435         (-[WKWebView _setWantsMediaPlaybackControlsView:]):
2436         (-[WKWebView _mediaPlaybackControlsView]):
2437         (-[WKWebView _addMediaPlaybackControlsView:]):
2438         (-[WKWebView _removeMediaPlaybackControlsView]):
2439         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2440         * UIProcess/API/mac/WKView.mm:
2441         (-[WKView makeTouchBar]):
2442         (-[WKView candidateListTouchBarItem]):
2443         (-[WKView _web_didAddMediaControlsManager:]):
2444         (-[WKView _web_didRemoveMediaControlsManager]):
2445         (-[WKView _wantsMediaPlaybackControlsView]):
2446         (-[WKView _setWantsMediaPlaybackControlsView:]):
2447         (-[WKView _mediaPlaybackControlsView]):
2448         (-[WKView _addMediaPlaybackControlsView:]):
2449         (-[WKView _removeMediaPlaybackControlsView]):
2450         * UIProcess/Cocoa/WebViewImpl.h:
2451         (WebKit::WebViewImpl::currentTouchBar):
2452         (WebKit::WebViewImpl::clientWantsMediaPlaybackControlsView):
2453         (WebKit::WebViewImpl::setClientWantsMediaPlaybackControlsView):
2454         (WebKit::WebViewImpl::setIsCustomizingTouchBar):
2455         * UIProcess/Cocoa/WebViewImpl.mm:
2456         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
2457         (-[WKTextListTouchBarViewController didDestroyView]):
2458         (-[WKTextListTouchBarViewController _selectList:]):
2459         (-[WKTextListTouchBarViewController setCurrentListType:]):
2460         (-[WKTextTouchBarItemController initWithWebViewImpl:]):
2461         (-[WKTextTouchBarItemController didDestroyView]):
2462         (-[WKTextTouchBarItemController touchBar:makeItemForIdentifier:]):
2463         (-[WKTextTouchBarItemController itemForIdentifier:]):
2464         (-[WKTextTouchBarItemController candidateListTouchBarItem:endSelectingCandidateAtIndex:]):
2465         (-[WKTextTouchBarItemController candidateListTouchBarItem:changedCandidateListVisibility:]):
2466         (-[WKTextTouchBarItemController textListTouchBarViewController]):
2467         (-[WKTextTouchBarItemController setTextIsBold:]):
2468         (-[WKTextTouchBarItemController setTextIsItalic:]):
2469         (-[WKTextTouchBarItemController setTextIsUnderlined:]):
2470         (-[WKTextTouchBarItemController _wkChangeTextStyle:]):
2471         (-[WKTextTouchBarItemController setCurrentTextAlignment:]):
2472         (-[WKTextTouchBarItemController _wkChangeTextAlignment:]):
2473         (-[WKTextTouchBarItemController textColor]):
2474         (-[WKTextTouchBarItemController setTextColor:]):
2475         (-[WKTextTouchBarItemController _wkChangeColor:]):
2476         (-[WKTextTouchBarItemController textListViewController]):
2477         (WebKit::WebViewImpl::makeTouchBar):
2478         (WebKit::WebViewImpl::candidateListTouchBarItem):
2479         (WebKit::WebViewImpl::mediaPlaybackControlsView):
2480         (WebKit::WebViewImpl::useMediaPlaybackControlsView):
2481         (WebKit::WebViewImpl::dismissTextTouchBarPopoverItemWithIdentifier):
2482         (WebKit::textTouchBarCustomizationAllowedIdentifiers):
2483         (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers):
2484         (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers):
2485         (WebKit::touchBarDidExitCustomization):
2486         (WebKit::touchBarWillEnterCustomization):
2487         (WebKit::didChangeAutomaticTextCompletion):
2488         (WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers):
2489         (WebKit::WebViewImpl::setUpTextTouchBar):
2490         (WebKit::WebViewImpl::isRichlyEditable):
2491         (WebKit::WebViewImpl::textTouchBar):
2492         (WebKit::WebViewImpl::updateTextTouchBar):
2493         (WebKit::WebViewImpl::updateMediaTouchBar):
2494         (WebKit::WebViewImpl::forceRequestCandidatesForTesting):
2495         (WebKit::WebViewImpl::updateTouchBar):
2496         (WebKit::WebViewImpl::shouldRequestCandidates):
2497         (WebKit::WebViewImpl::showCandidates):
2498         (WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView):
2499         (WebKit::WebViewImpl::setEditableElementIsFocused):
2500         (WebKit::WebViewImpl::becomeFirstResponder):
2501         (WebKit::WebViewImpl::selectionDidChange):
2502         (WebKit::WebViewImpl::videoControlsManagerDidChange):
2503         (WebKit::WebViewImpl::updateWebViewImplAdditions): Deleted.
2504
2505 2016-11-09  Chris Dumez  <cdumez@apple.com>
2506
2507         [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
2508         https://bugs.webkit.org/show_bug.cgi?id=164458
2509         <rdar://problem/28905514>
2510
2511         Reviewed by Darin Adler.
2512
2513         Add support for downloading file backed blobs on WebKit2.
2514         It previously wasn't working because we weren't calling
2515         BlobDataFileReference::prepareForFileAccess() for each blob file before
2516         starting the download, similarly to what is done in NetworkResourceLoader's
2517         consumeSandboxExtensions().
2518
2519         * NetworkProcess/Downloads/DownloadManager.cpp:
2520         (WebKit::DownloadManager::startDownload):
2521         * NetworkProcess/Downloads/DownloadManager.h:
2522         (WebKit::DownloadManager::startDownload):
2523         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2524         (WebKit::NetworkConnectionToWebProcess::startDownload):
2525         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
2526         * NetworkProcess/NetworkDataTask.cpp:
2527         (WebKit::NetworkDataTask::create):
2528         * NetworkProcess/NetworkDataTask.h:
2529         * NetworkProcess/NetworkDataTaskBlob.cpp:
2530         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2531         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
2532         (WebKit::NetworkDataTaskBlob::download):
2533         * NetworkProcess/NetworkDataTaskBlob.h:
2534         * NetworkProcess/NetworkLoad.cpp:
2535         (WebKit::NetworkLoad::NetworkLoad):
2536         * NetworkProcess/NetworkLoadParameters.h:
2537         * NetworkProcess/NetworkProcess.cpp:
2538         (WebKit::NetworkProcess::downloadRequest):
2539         * NetworkProcess/NetworkResourceLoader.cpp:
2540         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2541         (WebKit::NetworkResourceLoader::startNetworkLoad):
2542         * NetworkProcess/PingLoad.h:
2543
2544 2016-11-09  Chris Dumez  <cdumez@apple.com>
2545
2546         [WK2] Network cache speculative revalidation can cause loads to hang
2547         https://bugs.webkit.org/show_bug.cgi?id=164532
2548         <rdar://problem/28519331>
2549
2550         Reviewed by Alex Christensen.
2551
2552         Network cache speculative revalidation could cause loads to hang when HTTP
2553         authentication was involved because NetworkCacheSpeculativeLoad failed to
2554         call NetworkLoad::continueCanAuthenticateAgainstProtectionSpace() in its
2555         canAuthenticateAgainstProtectionSpaceAsync() callback.
2556
2557         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2558         (WebKit::NetworkCache::SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync):
2559         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2560
2561 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
2562
2563         URTBF after r208361.
2564
2565         * PlatformMac.cmake:
2566
2567 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
2568
2569         Unreviewed typo fix after r160616 to fix the build on case sensitive file systems.
2570
2571         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2572
2573 2016-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2574
2575         [SOUP] Layout test http/tests/misc/authentication-redirect-3/authentication-sent-to-redirect-same-origin-with-location-credentials.html fails
2576         https://bugs.webkit.org/show_bug.cgi?id=139358
2577
2578         Reviewed by Michael Catanzaro.
2579
2580         Stop putting the credentials in the URL unconditionally and ensure we only do that when provided by the URL
2581         itself. Libsoup has its own cache of SoupAuth, so we don't need to pass user/pass in the URL for every single
2582         request, libsoup will authenticate those automatically.
2583
2584         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2585         (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
2586
2587 2016-11-04  Filip Pizlo  <fpizlo@apple.com>
2588
2589         WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows
2590         https://bugs.webkit.org/show_bug.cgi?id=152045
2591
2592         Reviewed by Andy Estes.
2593
2594         * Platform/IPC/Connection.cpp:
2595         (IPC::Connection::SyncMessageState::wait):
2596         (IPC::Connection::sendMessage):
2597         (IPC::Connection::timeoutRespectingIgnoreTimeoutsForTesting):
2598         (IPC::Connection::waitForMessage):
2599         (IPC::Connection::sendSyncMessage):
2600         (IPC::Connection::waitForSyncReply):
2601         * Platform/IPC/Connection.h:
2602         (IPC::Connection::sendSync):
2603         (IPC::Connection::waitForAndDispatchImmediately):
2604         * Platform/IPC/MessageSender.h:
2605         (IPC::MessageSender::sendSync):
2606         * UIProcess/ChildProcessProxy.h:
2607         (WebKit::ChildProcessProxy::sendSync):
2608         * UIProcess/Network/NetworkProcessProxy.cpp:
2609         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
2610         * UIProcess/Storage/StorageManager.cpp:
2611         (WebKit::StorageManager::applicationWillTerminate):
2612         * UIProcess/WebProcessProxy.cpp:
2613         (WebKit::WebProcessProxy::sendProcessWillSuspendImminently):
2614         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2615         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
2616         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2617         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2618         (-[WKOneShotDisplayLinkHandler displayLinkFired:]):
2619         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2620         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2621         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
2622         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2623         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2624         * UIProcess/mac/WKImmediateActionController.mm:
2625         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
2626         * UIProcess/mac/WebPageProxyMac.mm:
2627         (WebKit::WebPageProxy::stringSelectionForPasteboard):
2628         (WebKit::WebPageProxy::dataSelectionForPasteboard):
2629         (WebKit::WebPageProxy::readSelectionFromPasteboard):
2630         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
2631         (WebKit::WebPageProxy::acceptsFirstMouse):
2632         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2633         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
2634         (WebKit::WebChromeClient::runJavaScriptAlert):
2635         (WebKit::WebChromeClient::runJavaScriptConfirm):
2636         (WebKit::WebChromeClient::runJavaScriptPrompt):
2637         (WebKit::WebChromeClient::print):
2638         (WebKit::WebChromeClient::exceededDatabaseQuota):
2639         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2640         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2641         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2642         * WebProcess/WebPage/WebPage.cpp:
2643         (WebKit::WebPage::postSynchronousMessageForTesting):
2644
2645 2016-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2646
2647         Safari does not emit composition end if blurred for dead key / Japanese IME
2648         https://bugs.webkit.org/show_bug.cgi?id=164369
2649         <rdar://problem/29050439>
2650
2651         Reviewed by Ryosuke Niwa.
2652
2653         Split WebPage::discardedComposition into two steps, where we first discard marked text and then update the
2654         editor state. This allows the codepath where we cancel the composition early (before setting the selection) to
2655         discard marked text without also forcing an editor state update at the same time. The editor state is later
2656         updated in WebPage::didChangeSelection.
2657
2658         * UIProcess/WebPageProxy.cpp:
2659         (WebKit::WebPageProxy::compositionWasCanceled):
2660         * UIProcess/WebPageProxy.h:
2661         * UIProcess/WebPageProxy.messages.in:
2662         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2663         (WebKit::WebEditorClient::canceledComposition):
2664         * WebProcess/WebCoreSupport/WebEditorClient.h:
2665         * WebProcess/WebPage/WebPage.cpp:
2666         (WebKit::WebPage::didChangeSelection):
2667         (WebKit::WebPage::discardedComposition):
2668         (WebKit::WebPage::canceledComposition):
2669         * WebProcess/WebPage/WebPage.h:
2670
2671 2016-11-04  Alex Christensen  <achristensen@webkit.org>
2672
2673         Unreviewed, rolling out r208293.
2674
2675         asserts in API tests.
2676
2677         Reverted changeset:
2678
2679         "NetworkSession: Network process crash when converting main
2680         resource to download"
2681         https://bugs.webkit.org/show_bug.cgi?id=164220
2682         http://trac.webkit.org/changeset/208293
2683
2684 2016-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
2685
2686         Add a setting and preferences to enable/disable async image decoding
2687         https://bugs.webkit.org/show_bug.cgi?id=164417
2688
2689         Reviewed by Simon Fraser.
2690
2691         Hook up the asyncImageDecodingEnabled setting for WebKit2.
2692
2693         * Shared/WebPreferencesDefinitions.h:
2694         * UIProcess/API/Cocoa/WKPreferences.mm:
2695         (-[WKPreferences _asyncImageDecodingEnabled]):
2696         (-[WKPreferences _setAsyncImageDecodingEnabled:]):
2697         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2698         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2699         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2700         * WebProcess/WebPage/WebPage.cpp:
2701         (WebKit::WebPage::updatePreferences):
2702
2703 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
2704
2705         Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
2706         https://bugs.webkit.org/show_bug.cgi?id=164420
2707
2708         Reviewed by Tim Horton.
2709
2710         Rename:
2711             commitNewTreeState -> commitTreeState ("new" was redundant)
2712             updateBeforeChildren -> commitStateBeforeChildren
2713             updateAfterChildren -> commitStateAfterChildren
2714
2715
2716         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2717         (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
2718         (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): Deleted.
2719         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2720         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2721         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2722         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
2723         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
2724         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren): Deleted.
2725         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): Deleted.
2726         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2727         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2728
2729 2016-11-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2730
2731         NetworkSession: Add NetworkDataTask implementation for blobs
2732         https://bugs.webkit.org/show_bug.cgi?id=163939
2733
2734         Reviewed by Alex Christensen.
2735
2736         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
2737         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
2738         is enabled.
2739
2740         * CMakeLists.txt: Add new files to compilation.
2741         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2742         * NetworkProcess/Downloads/BlobDownloadClient.h:
2743         * NetworkProcess/Downloads/Download.cpp:
2744         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
2745         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
2746         reveices a NetworkDataTask and is used by Soup backend and blobs.
2747         (WebKit::Download::~Download):
2748         (WebKit::Download::start):
2749         (WebKit::Download::startWithHandle):
2750         (WebKit::Download::cancel):
2751         (WebKit::Download::didReceiveAuthenticationChallenge):
2752         (WebKit::Download::didReceiveData):
2753         (WebKit::Download::didFinish):
2754         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
2755         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
2756         * NetworkProcess/Downloads/Download.h:
2757         (WebKit::Download::Download):
2758         (WebKit::Download::suggestedName):
2759         (WebKit::Download::request):
2760         * NetworkProcess/Downloads/DownloadManager.cpp:
2761         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
2762         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
2763         * NetworkProcess/Downloads/DownloadManager.h:
2764         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2765         (WebKit::Download::platformCancelNetworkLoad):
2766         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
2767         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2768         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
2769         using NetworkSession.
2770         * NetworkProcess/NetworkDataTask.cpp:
2771         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
2772         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
2773         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
2774         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2775         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
2776         (WebKit::NetworkDataTaskBlob::clearStream):
2777         (WebKit::NetworkDataTaskBlob::resume):
2778         (WebKit::NetworkDataTaskBlob::suspend):
2779         (WebKit::NetworkDataTaskBlob::cancel):
2780         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
2781         (WebKit::NetworkDataTaskBlob::getSizeForNext):
2782         (WebKit::NetworkDataTaskBlob::didGetSize):
2783         (WebKit::NetworkDataTaskBlob::seek):
2784         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
2785         (WebKit::NetworkDataTaskBlob::read):
2786         (WebKit::NetworkDataTaskBlob::readData):
2787         (WebKit::NetworkDataTaskBlob::readFile):
2788         (WebKit::NetworkDataTaskBlob::didOpen):
2789         (WebKit::NetworkDataTaskBlob::didRead):
2790         (WebKit::NetworkDataTaskBlob::consumeData):
2791         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
2792         (WebKit::NetworkDataTaskBlob::suggestedFilename):
2793         (WebKit::NetworkDataTaskBlob::download):
2794         (WebKit::NetworkDataTaskBlob::writeDownload):
2795         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
2796         (WebKit::NetworkDataTaskBlob::didFailDownload):
2797         (WebKit::NetworkDataTaskBlob::didFinishDownload):
2798         (WebKit::NetworkDataTaskBlob::didFail):
2799         (WebKit::NetworkDataTaskBlob::didFinish):
2800         * NetworkProcess/NetworkDataTaskBlob.h: Added.
2801         * NetworkProcess/NetworkLoad.cpp:
2802         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
2803         (WebKit::NetworkLoad::~NetworkLoad):
2804         (WebKit::NetworkLoad::setDefersLoading):
2805         (WebKit::NetworkLoad::cancel):
2806         (WebKit::NetworkLoad::continueWillSendRequest):
2807         (WebKit::NetworkLoad::continueDidReceiveResponse):
2808         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2809         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
2810         * NetworkProcess/NetworkLoad.h:
2811         * NetworkProcess/NetworkSession.cpp:
2812         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
2813         * NetworkProcess/NetworkSession.h:
2814         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
2815         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
2816         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
2817         because in Cocoa all tasks are invalidated and canceled by the network session.
2818         * NetworkProcess/mac/NetworkLoadMac.mm:
2819         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2820         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
2821         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
2822         (WebKit::NetworkDataTaskSoup::download):
2823         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2824         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2825         * NetworkProcess/soup/NetworkSessionSoup.h:
2826         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
2827         * PlatformGTK.cmake: Ditto.
2828         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
2829
2830 2016-11-03  Simon Fraser  <simon.fraser@apple.com>
2831
2832         Give all the geometry classes a single-argument scale() function for consistency
2833         https://bugs.webkit.org/show_bug.cgi?id=164400
2834
2835         Reviewed by Zalan Bujtas.
2836         
2837         Use single-argument scale() functions.
2838
2839         * PluginProcess/PluginControllerProxy.cpp:
2840         (WebKit::PluginControllerProxy::paint):
2841         * Shared/mac/RemoteLayerBackingStore.mm:
2842         (WebKit::RemoteLayerBackingStore::drawInContext):
2843         * UIProcess/API/Cocoa/WKWebView.mm:
2844         (-[WKWebView _didCommitLayerTree:]):
2845         (-[WKWebView _takeViewSnapshot]):
2846         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
2847         (-[WKWebView _scrollByContentOffset:]):
2848         (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
2849         * UIProcess/ios/WKContentView.mm:
2850         (-[WKContentView _didCommitLayerTree:]):
2851         * UIProcess/ios/WKContentViewInteraction.mm:
2852         (-[WKContentView _updateTapHighlight]):
2853         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2854         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
2855         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
2856         * UIProcess/mac/ViewGestureControllerMac.mm:
2857         (WebKit::ViewGestureController::scaledMagnificationOrigin):
2858         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2859         (WebKit::InjectedBundleRangeHandle::renderedImage):
2860         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2861         (WebKit::NetscapePlugin::snapshot):
2862         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2863         (WebKit::PDFPlugin::scrollToPoint):
2864         * WebProcess/WebPage/WebFrame.cpp:
2865         (WebKit::WebFrame::createSelectionSnapshot):
2866         * WebProcess/WebPage/WebPage.cpp:
2867         (WebKit::WebPage::scalePageInViewCoordinates):
2868         (WebKit::WebPage::scaleView):
2869         (WebKit::WebPage::snapshotAtSize):
2870         (WebKit::WebPage::snapshotNode):
2871         (WebKit::WebPage::drawRectToImage):
2872         * WebProcess/WebPage/ios/WebPageIOS.mm:
2873         (WebKit::WebPage::restorePageState):
2874
2875 2016-11-03  Chris Dumez  <cdumez@apple.com>
2876
2877         [WK2][Cocoa] Implement user interface for HTML form validation
2878         https://bugs.webkit.org/show_bug.cgi?id=164143
2879         <rdar://problem/28944652>
2880
2881         Reviewed by Simon Fraser.
2882
2883         Implement the ValidationMessageClient in WebKit2 and have it display
2884         a ValidationBubble on Cocoa. ValidationBubble is implemented using
2885         native popovers on both Mac and iOS. As a result, Mac and iOS WK2
2886         now use native popover for HTML form validation instead of the old
2887         Shadow DOM based UI in WebCore.
2888
2889         The native popover shows at the bottom (or top) of the input and it
2890         disapears as soon as the user starts typing or interacts with the
2891         view (e.g. tap / scroll / zoom).
2892
2893         The feature is still disabled at runtime.
2894
2895         * UIProcess/API/Cocoa/WKWebView.mm:
2896         (-[WKWebView _initializeWithConfiguration:]):
2897         (-[WKWebView _keyboardWillShow:]):
2898         (-[WKWebView _keyboardDidShow:]):
2899         (-[WKWebView _contentsOfUserInterfaceItem:]):
2900         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2901         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2902         * UIProcess/PageClient.h:
2903         * UIProcess/WebPageProxy.cpp:
2904         (WebKit::WebPageProxy::handleWheelEvent):
2905         (WebKit::WebPageProxy::setPageZoomFactor):
2906         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
2907         (WebKit::WebPageProxy::pageDidScroll):
2908         (WebKit::WebPageProxy::resetState):
2909         (WebKit::WebPageProxy::hideValidationMessage):
2910         * UIProcess/WebPageProxy.h:
2911         (WebKit::WebPageProxy::validationBubble):
2912         (WebKit::WebPageProxy::setIsKeyboardAnimatingIn):
2913         * UIProcess/WebPageProxy.messages.in:
2914         * UIProcess/ios/PageClientImplIOS.h:
2915         * UIProcess/ios/PageClientImplIOS.mm:
2916         (WebKit::PageClientImpl::createValidationBubble):
2917         * UIProcess/ios/WKContentViewInteraction.mm:
2918         (-[WKContentView _willStartScrollingOrZooming]):
2919         (-[WKContentView scrollViewWillStartPanOrPinchGesture]):
2920         (-[WKContentView _didEndScrollingOrZooming]):
2921         * UIProcess/ios/WebPageProxyIOS.mm:
2922         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2923         (WebKit::WebPageProxy::potentialTapAtPosition):
2924         (WebKit::WebPageProxy::showValidationMessage):
2925         (WebKit::WebPageProxy::setIsScrollingOrZooming):
2926         * UIProcess/mac/PageClientImpl.h:
2927         * UIProcess/mac/PageClientImpl.mm:
2928         (WebKit::PageClientImpl::createValidationBubble):
2929         * UIProcess/mac/WebPageProxyMac.mm:
2930         (WebKit::WebPageProxy::showValidationMessage):
2931         * WebKit2.xcodeproj/project.pbxproj:
2932         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
2933         (WebKit::WebValidationMessageClient::WebValidationMessageClient):
2934         (WebKit::WebValidationMessageClient::~WebValidationMessageClient):
2935         (WebKit::WebValidationMessageClient::showValidationMessage):
2936         (WebKit::WebValidationMessageClient::hideValidationMessage):
2937         (WebKit::WebValidationMessageClient::isValidationMessageVisible):
2938         * WebProcess/WebCoreSupport/WebValidationMessageClient.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
2939         * WebProcess/WebPage/WebPage.cpp:
2940         (WebKit::m_userInterfaceLayoutDirection):
2941
2942 2016-11-03  Tim Horton  <timothy_horton@apple.com>
2943
2944         Printing to PDF should produce internal links when HTML has internal links
2945         https://bugs.webkit.org/show_bug.cgi?id=112081
2946         <rdar://problem/5955705>
2947
2948         Reviewed by Simon Fraser.
2949
2950         * UIProcess/mac/WKPrintingView.h:
2951         * UIProcess/mac/WKPrintingView.mm:
2952         (linkDestinationName):
2953         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
2954         Propagate link-to-destination annotations (and each page's destinations)
2955         into the printed PDF.
2956         Generate a unique destination name based on the page and position, because
2957         we have lost the fragment name information.
2958
2959         (-[WKPrintingView drawRect:]):
2960         Compute all of the destinations for every page, so that we can add them
2961         to the context as we paint the pages (we need the page CTM in order to add them).
2962
2963 2016-11-03  Alex Christensen  <achristensen@webkit.org>
2964
2965         Unreviewed, rolling out r208298.
2966         https://bugs.webkit.org/show_bug.cgi?id=163939
2967
2968         caused asan crashes
2969
2970         Reverted changeset:
2971
2972         "NetworkSession: Add NetworkDataTask implementation for blobs"
2973         https://bugs.webkit.org/show_bug.cgi?id=163939
2974         http://trac.webkit.org/changeset/208298
2975
2976 2016-11-03  Ryan Haddad  <ryanhaddad@apple.com>
2977
2978         Unreviewed, rolling out r208330.
2979
2980         This change appears to have caused two editing tests to fail
2981         on macOS.
2982
2983         Reverted changeset:
2984
2985         "Reduce PassRefPtr use in WebKit2"
2986         https://bugs.webkit.org/show_bug.cgi?id=164360
2987         http://trac.webkit.org/changeset/208330
2988
2989 2016-11-03  Dan Bernstein  <mitz@apple.com>
2990
2991         WKWebView’s _observedRenderingProgressEvents not restored after web process crash
2992         https://bugs.webkit.org/show_bug.cgi?id=164368
2993         <rdar://problem/29091954>
2994
2995         Reviewed by Anders Carlsson.
2996
2997         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm.
2998
2999         * Shared/WebPageCreationParameters.cpp:
3000         (WebKit::WebPageCreationParameters::encode): Encode new observedLayoutMilestones member.
3001         (WebKit::WebPageCreationParameters::decode): Decode it.
3002         * Shared/WebPageCreationParameters.h: Declared new observedLayoutMilestones member variable.
3003
3004         * UIProcess/WebPageProxy.cpp:
3005         (WebKit::WebPageProxy::WebPageProxy): Removed initializer for
3006           m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
3007         (WebKit::WebPageProxy::listenForLayoutMilestones): Update new m_observedLayoutMilestones
3008           member variable. Don’t update m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
3009         (WebKit::WebPageProxy::creationParameters): Set the observedLayoutMilestones member in the
3010           creation parameters.
3011
3012         * UIProcess/WebPageProxy.h: Declared new member variable, deleted
3013           m_wantsSessionRestorationRenderTreeSizeThresholdEvent declaration.
3014
3015         * UIProcess/ios/WebPageProxyIOS.mm:
3016         (WebKit::WebPageProxy::didCommitLayerTree): Rather than using
3017           m_wantsSessionRestorationRenderTreeSizeThresholdEvent, use m_observedLayoutMilestones.
3018
3019         * WebProcess/WebPage/WebPage.cpp:
3020         (WebKit::WebPage::WebPage): Add the observed layout milestones from the creation parameters.
3021
3022 2016-11-02  Alex Christensen  <achristensen@webkit.org>
3023
3024         Reduce PassRefPtr use in WebKit2
3025         https://bugs.webkit.org/show_bug.cgi?id=164360
3026
3027         Reviewed by Tim Horton.
3028
3029         * Shared/API/APISecurityOrigin.h:
3030         (API::SecurityOrigin::SecurityOrigin):
3031         * Shared/API/APISerializedScriptValue.h:
3032         (API::SerializedScriptValue::create):
3033         (API::SerializedScriptValue::SerializedScriptValue):
3034         * Shared/API/c/WKSharedAPICast.h:
3035         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
3036         (WebKit::toAPI):
3037         * Shared/APIWebArchive.h:
3038         * Shared/APIWebArchive.mm:
3039         (API::WebArchive::create):
3040         (API::WebArchive::WebArchive):
3041         * UIProcess/API/APIHitTestResult.cpp:
3042         (API::HitTestResult::create):
3043         * UIProcess/API/APIHitTestResult.h:
3044         * UIProcess/API/APIUIClient.h:
3045         (API::UIClient::createNewPage):
3046         * UIProcess/API/C/WKPage.cpp:
3047         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
3048         (WebKit::RunBeforeUnloadConfirmPanelResultListener::RunBeforeUnloadConfirmPanelResultListener):
3049         (WebKit::RunJavaScriptAlertResultListener::create):
3050         (WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
3051         (WebKit::RunJavaScriptConfirmResultListener::create):
3052         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
3053         (WebKit::RunJavaScriptPromptResultListener::create):
3054         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
3055         (WKPageSetPageUIClient):
3056         * UIProcess/API/Cocoa/WKWebView.mm:
3057         (-[WKWebView _takeViewSnapshot]):
3058         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3059         * UIProcess/Cocoa/UIDelegate.h:
3060         * UIProcess/Cocoa/UIDelegate.mm:
3061         (WebKit::UIDelegate::UIClient::createNewPage):
3062         * UIProcess/ios/WKGeolocationProviderIOS.mm:
3063         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
3064         * UIProcess/mac/WKImmediateActionController.mm:
3065         (-[WKImmediateActionController _webHitTestResult]):
3066         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3067         (contextMenuItems):
3068         (WKBundlePageCopyContextMenuItems):
3069         (WKBundlePageCopyContextMenuAtPointInWindow):
3070         * WebProcess/UserContent/WebUserContentController.cpp:
3071         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
3072         * WebProcess/WebPage/WebUndoStep.cpp:
3073         (WebKit::WebUndoStep::create):
3074         * WebProcess/WebPage/WebUndoStep.h:
3075         (WebKit::WebUndoStep::WebUndoStep):
3076
3077 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
3078
3079         Remove PageThrottler & all related code
3080         https://bugs.webkit.org/show_bug.cgi?id=164302
3081
3082         Reviewed by Ryosuke Niwa.
3083
3084         All relevant information now available from the ActivityState.
3085
3086         * PluginProcess/PluginProcess.cpp:
3087         (WebKit::PluginProcess::PluginProcess):
3088         (WebKit::PluginProcess::createWebProcessConnection):
3089         (WebKit::PluginProcess::audioHardwareDidBecomeActive): Deleted.
3090         (WebKit::PluginProcess::audioHardwareDidBecomeInactive): Deleted.
3091         * PluginProcess/PluginProcess.h:
3092         (): Deleted.
3093         * PluginProcess/WebProcessConnection.cpp:
3094         (WebKit::WebProcessConnection::audioHardwareDidBecomeActive): Deleted.
3095         (WebKit::WebProcessConnection::audioHardwareDidBecomeInactive): Deleted.
3096         * PluginProcess/WebProcessConnection.h:
3097         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3098         (WebKit::NPRuntimeObjectMap::evaluate):
3099         * WebProcess/Plugins/Plugin.h:
3100         (WebKit::Plugin::audioHardwareActivity): Deleted.
3101         * WebProcess/Plugins/PluginProcessConnection.cpp:
3102         (WebKit::PluginProcessConnection::PluginProcessConnection):
3103         (WebKit::PluginProcessConnection::didReceiveMessage):
3104         (WebKit::PluginProcessConnection::audioHardwareDidBecomeActive): Deleted.
3105         (WebKit::PluginProcessConnection::audioHardwareDidBecomeInactive): Deleted.
3106         * WebProcess/Plugins/PluginProcessConnection.h:
3107         (WebKit::PluginProcessConnection::supportsAsynchronousPluginInitialization):
3108         (WebKit::PluginProcessConnection::audioHardwareActivity): Deleted.
3109         * WebProcess/Plugins/PluginProcessConnection.messages.in:
3110         * WebProcess/Plugins/PluginProxy.cpp:
3111         (WebKit::PluginProxy::audioHardwareActivity): Deleted.
3112         * WebProcess/Plugins/PluginProxy.h:
3113         * WebProcess/Plugins/PluginView.cpp:
3114         (WebKit::PluginView::audioHardwareActivity): Deleted.
3115         * WebProcess/Plugins/PluginView.h:
3116         * WebProcess/WebPage/WebPage.cpp:
3117
3118 2016-11-03  Dan Bernstein  <mitz@apple.com>
3119
3120         REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
3121         https://bugs.webkit.org/show_bug.cgi?id=164340
3122         <rdar://problem/29074344>
3123
3124         Reviewed by Tim Horton.
3125
3126         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function.
3127         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3128         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper
3129           function that sends the message to the UI process and resets
3130           m_pendingNewlyReachedLayoutMilestones.
3131         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the
3132           pending milestones and send them to the UI process. This way we don’t miss milestones that
3133           fire during the commit.
3134
3135 2016-11-02  David Kilzer  <ddkilzer@apple.com>
3136
3137         Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
3138         <https://webkit.org/b/164333>
3139         <rdar://problem/29072727>
3140
3141         Reviewed by Alex Christensen.
3142
3143         * WebProcess/WebProcess.cpp:
3144         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
3145         Add private method to log diagnostic message.
3146         (WebKit::WebProcess::networkProcessConnectionClosed):
3147         Call logDiagnosticMessageForNetworkProcessCrash().
3148         * WebProcess/WebProcess.h:
3149         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
3150         Declare new method.
3151
3152 2016-11-02  Alex Christensen  <achristensen@webkit.org>
3153
3154         Remove Battery Status API from the tree
3155         https://bugs.webkit.org/show_bug.cgi?id=164213
3156
3157         Reviewed by Sam Weinig.
3158
3159         * CMakeLists.txt:
3160         * PlatformEfl.cmake:
3161         * Shared/API/APIObject.h:
3162         * Shared/API/c/WKBase.h:
3163         * Shared/WebBatteryStatus.cpp: Removed.
3164         * Shared/WebBatteryStatus.h: Removed.
3165         * UIProcess/API/C/WKAPICast.h:
3166         * UIProcess/API/C/WKBatteryManager.cpp: Removed.
3167         * UIProcess/API/C/WKBatteryManager.h: Removed.
3168         * UIProcess/API/C/WKBatteryStatus.cpp: Removed.
3169         * UIProcess/API/C/WKBatteryStatus.h: Removed.
3170         * UIProcess/API/C/WKContext.cpp:
3171         (WKContextGetBatteryManager): Deleted.
3172         * UIProcess/API/C/WKContext.h:
3173         * UIProcess/API/efl/ewk_context.cpp:
3174         (EwkContext::EwkContext):
3175         * UIProcess/API/efl/ewk_context_private.h:
3176         * UIProcess/API/efl/ewk_main.cpp:
3177         (WebKit::EwkMain::initialize):
3178         (WebKit::EwkMain::finalize):
3179         (WebKit::EwkMain::shutdownInitializedEFLModules):
3180         * UIProcess/API/gtk/WebKitBatteryProvider.cpp: Removed.
3181         * UIProcess/API/gtk/WebKitBatteryProvider.h: Removed.
3182         * UIProcess/API/gtk/WebKitWebContext.cpp:
3183         (webkitWebContextConstructed):
3184         * UIProcess/WebBatteryManagerProxy.cpp: Removed.
3185         * UIProcess/WebBatteryManagerProxy.h: Removed.
3186         * UIProcess/WebBatteryManagerProxy.messages.in: Removed.
3187         * UIProcess/WebBatteryProvider.cpp: Removed.
3188         * UIProcess/WebBatteryProvider.h: Removed.
3189         * UIProcess/WebProcessPool.cpp:
3190         (WebKit::m_hiddenPageThrottlingTimer):
3191         * UIProcess/efl/BatteryProvider.cpp: Removed.
3192         * UIProcess/efl/BatteryProvider.h: Removed.
3193         * WebProcess/Battery: Removed.
3194         * WebProcess/Battery/WebBatteryManager.cpp: Removed.
3195         * WebProcess/Battery/WebBatteryManager.h: Removed.
3196         * WebProcess/Battery/WebBatteryManager.messages.in: Removed.
3197         * WebProcess/WebCoreSupport/WebBatteryClient.cpp: Removed.
3198         * WebProcess/WebCoreSupport/WebBatteryClient.h: Removed.
3199         * WebProcess/WebPage/WebPage.cpp:
3200         (WebKit::m_userInterfaceLayoutDirection):
3201         * WebProcess/WebProcess.cpp:
3202         (WebKit::m_resourceLoadStatisticsStorage):
3203
3204 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3205
3206         NetworkSession: Add NetworkDataTask implementation for blobs
3207         https://bugs.webkit.org/show_bug.cgi?id=163939
3208
3209         Reviewed by Alex Christensen.
3210
3211         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
3212         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
3213         is enabled.
3214
3215         * CMakeLists.txt: Add new files to compilation.
3216         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
3217         * NetworkProcess/Downloads/BlobDownloadClient.h:
3218         * NetworkProcess/Downloads/Download.cpp:
3219         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
3220         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
3221         reveices a NetworkDataTask and is used by Soup backend and blobs.
3222         (WebKit::Download::~Download):
3223         (WebKit::Download::start):
3224         (WebKit::Download::startWithHandle):
3225         (WebKit::Download::cancel):
3226         (WebKit::Download::didReceiveAuthenticationChallenge):
3227         (WebKit::Download::didReceiveData):
3228         (WebKit::Download::didFinish):
3229         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
3230         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
3231         * NetworkProcess/Downloads/Download.h:
3232         (WebKit::Download::Download):
3233         (WebKit::Download::suggestedName):
3234         (WebKit::Download::request):
3235         * NetworkProcess/Downloads/DownloadManager.cpp:
3236         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
3237         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
3238         * NetworkProcess/Downloads/DownloadManager.h:
3239         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
3240         (WebKit::Download::platformCancelNetworkLoad):
3241         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
3242         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3243         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
3244         using NetworkSession.
3245         * NetworkProcess/NetworkDataTask.cpp:
3246         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
3247         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
3248         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
3249         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
3250         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
3251         (WebKit::NetworkDataTaskBlob::clearStream):
3252         (WebKit::NetworkDataTaskBlob::resume):
3253         (WebKit::NetworkDataTaskBlob::suspend):
3254         (WebKit::NetworkDataTaskBlob::cancel):
3255         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
3256         (WebKit::NetworkDataTaskBlob::getSizeForNext):
3257         (WebKit::NetworkDataTaskBlob::didGetSize):
3258         (WebKit::NetworkDataTaskBlob::seek):
3259         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
3260         (WebKit::NetworkDataTaskBlob::read):
3261         (WebKit::NetworkDataTaskBlob::readData):
3262         (WebKit::NetworkDataTaskBlob::readFile):
3263         (WebKit::NetworkDataTaskBlob::didOpen):
3264         (WebKit::NetworkDataTaskBlob::didRead):
3265         (WebKit::NetworkDataTaskBlob::consumeData):
3266         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
3267         (WebKit::NetworkDataTaskBlob::suggestedFilename):
3268         (WebKit::NetworkDataTaskBlob::download):
3269         (WebKit::NetworkDataTaskBlob::writeDownload):
3270         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
3271         (WebKit::NetworkDataTaskBlob::didFailDownload):
3272         (WebKit::NetworkDataTaskBlob::didFinishDownload):
3273         (WebKit::NetworkDataTaskBlob::didFail):
3274         (WebKit::NetworkDataTaskBlob::didFinish):
3275         * NetworkProcess/NetworkDataTaskBlob.h: Added.
3276         * NetworkProcess/NetworkLoad.cpp:
3277         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
3278         (WebKit::NetworkLoad::~NetworkLoad):
3279         (WebKit::NetworkLoad::setDefersLoading):
3280         (WebKit::NetworkLoad::cancel):
3281         (WebKit::NetworkLoad::continueWillSendRequest):
3282         (WebKit::NetworkLoad::continueDidReceiveResponse):
3283         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
3284         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
3285         * NetworkProcess/NetworkLoad.h:
3286         * NetworkProcess/NetworkSession.cpp:
3287         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
3288         * NetworkProcess/NetworkSession.h:
3289         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
3290         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
3291         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
3292         because in Cocoa all tasks are invalidated and canceled by the network session.
3293         * NetworkProcess/mac/NetworkLoadMac.mm:
3294         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3295         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
3296         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
3297         (WebKit::NetworkDataTaskSoup::download):
3298         * NetworkProcess/soup/NetworkDataTaskSoup.h:
3299         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3300         * NetworkProcess/soup/NetworkSessionSoup.h:
3301         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
3302         * PlatformGTK.cmake: Ditto.
3303         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
3304
3305 2016-11-02  Andy Estes  <aestes@apple.com>
3306
3307         REGRESSION (r199558): File paths selected for upload are stored using the wrong string encoding
3308         https://bugs.webkit.org/show_bug.cgi?id=164311
3309         <rdar://problem/26995374>
3310
3311         Reviewed by Tim Horton.
3312
3313         -[NSURL fileSystemRepresentation] returns a char* in file system representation, which on
3314         iOS is UTF-8, but we were implicitly converting it to a String, which assumes a char* is
3315         Latin-1 encoded.
3316
3317         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3318         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Changed to use fromUTF8() to
3319         convert fileURL.fileSystemRepresentation to a String.
3320
3321 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3322
3323         NetworkSession: Network process crash when converting main resource to download
3324         https://bugs.webkit.org/show_bug.cgi?id=164220
3325
3326         Reviewed by Alex Christensen.
3327
3328         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
3329         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
3330         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
3331         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
3332         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
3333         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
3334         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
3335         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
3336         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
3337         created yet. That's not expected to happen and when the response completion handler is called in the
3338         NetworkDataTask it tries to use either the client or the download and it crashes.
3339
3340         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3341         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): Update ASSERT, because abort doesn't cleanup the
3342         resource loader in case it's becoming a download.
3343         * NetworkProcess/NetworkResourceLoader.cpp:
3344         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
3345         (WebKit::NetworkResourceLoader::isBecomingDownload): Helper method to check if the resource load was converted to a
3346         download, but didBecomeDownload() hasn't been called yet.
3347         (WebKit::NetworkResourceLoader::abort): If the resource load is becoming a download do not call cleanup()
3348         because it will be called by didBecomeDownload() later.
3349         * NetworkProcess/NetworkResourceLoader.h:
3350
3351 2016-11-02  David Kilzer  <ddkilzer@apple.com>
3352
3353         Add logging for "WebKit encountered an internal error" messages
3354         <https://webkit.org/b/164272>
3355         <rdar://problem/28546064>
3356
3357         Reviewed by Alex Christensen.
3358
3359         * NetworkProcess/NetworkResourceLoader.cpp:
3360         (WebKit::NetworkResourceLoader::startNetworkLoad):
3361         * WebProcess/Network/WebLoaderStrategy.cpp:
3362         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3363         * WebProcess/Network/WebResourceLoader.cpp:
3364         (WebKit::WebResourceLoader::didReceiveResource):
3365         - Add logging for various internalError() events.
3366
3367 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3368
3369         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
3370         https://bugs.webkit.org/show_bug.cgi?id=164303
3371
3372         Reviewed by Michael Catanzaro.
3373
3374         This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap
3375         BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error.
3376
3377         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
3378         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
3379         (WebKit::AcceleratedBackingStoreX11::update):
3380
3381 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3382
3383         [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
3384         https://bugs.webkit.org/show_bug.cgi?id=164315
3385
3386         Reviewed by Michael Catanzaro.