blob: e2ecf533bbec690dd50ce30e326f78207c7b01eb [file] [log] [blame]
2017-03-23 Andreas Kling <akling@apple.com>
Let the UI process do memory kills and replace crashes with diagnostic logging.
<https://webkit.org/b/170016>
<rdar://problem/31091292>
Reviewed by Chris Dumez.
Have the WebProcess memory kill callback send a notification to the UI process
instead of outright crashing. The UI process then sends a diagnostic logging message
before carefully taking down the web process.
Also add drive-by diagnostic logging for background CPU limit kills.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::simulateProcessCrash):
(WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
(WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
(WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
2017-03-23 Tim Horton <timothy_horton@apple.com>
Test DataDetectors supported schemes in lowercase
https://bugs.webkit.org/show_bug.cgi?id=169994
<rdar://problem/30788920>
Reviewed by Wenson Hsieh.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _actionForLongPress]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
Lower-case the scheme before looking in tapAndHoldSchemes, which is
guaranteed to be in lower-case. WebCore already does this in places
that it confers with tapAndHoldSchemes.
2017-03-22 Andy Estes <aestes@apple.com>
[Cocoa] Add an option to exclude overflow when snapshotting a WKWebProcessPlugInNodeHandle
https://bugs.webkit.org/show_bug.cgi?id=169991
<rdar://problem/30141083>
Reviewed by Tim Horton.
When snapshotting an element using -[WKWebProcessPlugInNodeHandle renderedImageWithOptions:],
the image is sized to encompass all descendants, even if the element is styled with
overflow:hidden. This patch adds a WKSnapshotOption to exclude overflow, resulting in an
image that's always sized to the node's bounding box.
* Shared/API/c/WKImage.h: Defined kWKSnapshotOptionsExcludeOverflow.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Converted the
WKSnapshotOptions argument to a SnapshotOptions using toSnapshotOptions(), and called
InjectedBundleNodeHandle::renderedImage() with shouldExcludeOverflow set to true if the
WKSnapshotOptions included kWKSnapshotOptionsExcludeOverflow.
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(WKBundleNodeHandleCopySnapshotWithOptions): Ditto.
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::renderedImage): If shouldExcludeOverflow is true, use
RenderObject::absoluteBoundingBoxRectIgnoringTransforms() as the paintingRect for
imageForRect().
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2017-03-22 Wenson Hsieh <wenson_hsieh@apple.com>
WKScrollView should not require data interaction gestures to fail before panning
https://bugs.webkit.org/show_bug.cgi?id=169986
Reviewed by Tim Horton.
This workaround is no longer needed.
* UIProcess/ios/WKScrollView.mm:
2017-03-22 Andreas Kling <akling@apple.com>
Let MemoryPressureHandler track whether the process is active or inactive.
<https://webkit.org/b/169990>
Reviewed by Antti Koivisto.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
2017-03-21 Wenson Hsieh <wenson_hsieh@apple.com>
Add support for showing the platform data interaction caret
https://bugs.webkit.org/show_bug.cgi?id=169898
<rdar://problem/31146295>
Reviewed by Beth Dakin.
Add support for showing the caret rect when data interacting over an editable target. To do this, we add
boilerplate plumbing to inform the WKContentView whenever the WebPageProxy's current caret rect changes.
* Platform/spi/ios/UIKitSPI.h:
Define IPI to retrieve the default insertion caret color.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformDragControllerAction):
(WebKit::WebPageProxy::dragEnded):
(WebKit::WebPageProxy::didEndDragging):
(WebKit::WebPageProxy::resetCurrentDragInformation):
(WebKit::WebPageProxy::setDragCaretRect):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didChangeDataInteractionCaretRect):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView insertionPointColor]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dragEnded):
2017-03-22 John Wilander <wilander@apple.com>
Resource Load Statistics: Fix partitioning bug for client-side cookie access
https://bugs.webkit.org/show_bug.cgi?id=169906
<rdar://problem/31164456>
Reviewed by Alex Christensen.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
This function no longer asks the NetworkStorageSession
whether it should partition or not. That decision is
now made as part of
WebCore::NetworkStorageSession::cookieStoragePartition().
The empty partition signals no partitioning.
2017-03-22 Andy Estes <aestes@apple.com>
[QuickLook] Rename QuickLookHandle to PreviewLoader
https://bugs.webkit.org/show_bug.cgi?id=169961
Reviewed by Andreas Kling.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
(WebKit::WebFrameLoaderClient::createPreviewLoaderClient):
(WebKit::WebFrameLoaderClient::createQuickLookHandleClient): Deleted.
* WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp.
(WebKit::WebPreviewLoaderClient::WebPreviewLoaderClient):
(WebKit::WebPreviewLoaderClient::~WebPreviewLoaderClient):
(WebKit::WebPreviewLoaderClient::didReceiveDataArray):
(WebKit::WebPreviewLoaderClient::didFinishLoading):
(WebKit::WebPreviewLoaderClient::didFail):
(WebKit::WebPreviewLoaderClient::didRequestPassword):
(WebKit::WebPreviewLoaderClient::didReceivePassword):
* WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didReceivePasswordForQuickLookDocument):
2017-03-22 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Add SPI to notify clients when data interaction is beginning or ending
https://bugs.webkit.org/show_bug.cgi?id=169952
<rdar://problem/31187804>
Reviewed by Beth Dakin.
Adds two new UI delegate SPI hooks.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2017-03-21 Sergio Villar Senin <svillar@igalia.com>
[Soup] "Only from websites I visit" cookie policy is broken
https://bugs.webkit.org/show_bug.cgi?id=168912
Reviewed by Carlos Garcia Campos.
Do not reset the first party for cookies on redirects. That's properly done for the main
resource in DocumentLoader::willSendRequest and, in the case of subresources, is absolutely
wrong (which is what we were doing since r143931).
The most notable effect was that subresources loaded via redirects were effectively
bypassing the "no third party" policy for cookies.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
2017-03-19 Wenson Hsieh <wenson_hsieh@apple.com>
Teach TextIndicator to estimate the background color of the given Range
https://bugs.webkit.org/show_bug.cgi?id=169869
<rdar://problem/31127272>
Reviewed by Anders Carlsson and Simon Fraser.
Send the estimated background color over XPC, and adopt TextIndicatorOptionComputeEstimatedBackgroundColor when
snapshotting after performing an edit data interaction.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<TextIndicatorData>::encode):
(IPC::ArgumentCoder<TextIndicatorData>::decode):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didConcludeEditDataInteraction):
2017-03-21 Chris Dumez <cdumez@apple.com>
[WK2] Call processDidCrash() right away when terminating a process that exceeded background CPU limit
https://bugs.webkit.org/show_bug.cgi?id=169573
<rdar://problem/30960968>
Reviewed by Andreas Kling.
Call processDidCrash() right away when terminating a process that exceeded background CPU limit
and let the client decide when to reload the content.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::terminateProcess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
2017-03-21 Aidan Holm <aidanholm+webkit@gmail.com>
[GTK] Add function webkit_dom_element_get_bounding_client_rect
https://bugs.webkit.org/show_bug.cgi?id=163892
Reviewed by Carlos Garcia Campos.
Wrap WebCore::ClientRect as WebKitDOMClientRect.
Wrap WebCore::ClientRectList as WebKitDOMClientRectList.
Implement webkit_dom_element_get_bounding_client_rect().
Implement webkit_dom_element_get_client_rects().
* PlatformGTK.cmake:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp: Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: Added.
(WebKit::kit):
(WebKit::core):
(WebKit::wrapClientRect):
(webkit_dom_client_rect_finalize):
(webkit_dom_client_rect_get_property):
(webkit_dom_client_rect_constructed):
(webkit_dom_client_rect_class_init):
(webkit_dom_client_rect_init):
(webkit_dom_client_rect_get_top):
(webkit_dom_client_rect_get_right):
(webkit_dom_client_rect_get_bottom):
(webkit_dom_client_rect_get_left):
(webkit_dom_client_rect_get_width):
(webkit_dom_client_rect_get_height):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h: Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectPrivate.h: Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h: Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h: Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_get_property):
(webkit_dom_element_class_init):
(webkit_dom_element_get_scroll_height):
(webkit_dom_element_get_bounding_client_rect):
(webkit_dom_element_get_client_rects):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
* WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
* WebProcess/InjectedBundle/API/gtk/DOM/webkitdomautocleanups.h:
* WebProcess/InjectedBundle/API/gtk/DOM/webkitdomdefines.h:
2017-03-20 Alex Christensen <achristensen@webkit.org>
WebPageProxy DecidePolicyForNavigationAction and DecidePolicyForResponseSync should be Delayed reply messages
https://bugs.webkit.org/show_bug.cgi?id=167183
<rdar://problem/30203539>
Reviewed by Andy Estes.
Before this patch, the WKNavigationDelegate's decidePolicyForNavigationAction must synchronously call the decisionHandler.
If it stores the decisionHandler and calls it after decidePolicyForNavigationAction returns, we can get incorrect behavior.
This can be seen when the _WKWebsitePolicies given to the decisionHandler had no effect.
Now, we will have the WebProcess waiting on the UIProcess to respond to the Delayed reply before continuing.
This will not be a regression because currently everybody is either calling the decisionHandler immediately or getting incorrect behavior,
and the behavior will be the same if the decisionHandler is called immediately. It is possible that we could make the WebProcess
not wait on the response, but we would need to make WebCore's loading truly asynchronous first
(getting rid of ResourceHandleClient's synchronous methods).
Covered by making an API test asynchronously call the decisionHandler.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForResponseSync):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2017-03-20 Alex Christensen <achristensen@webkit.org>
Fix GTK build after r214190
https://bugs.webkit.org/show_bug.cgi?id=169885
* UIProcess/InspectorServer/WebSocketServerConnection.cpp:
(WebKit::WebSocketServerConnection::sendWebSocketMessage):
(WebKit::WebSocketServerConnection::sendHTTPResponseHeader):
(WebKit::WebSocketServerConnection::sendRawData):
Finish renaming send to sendData.
2017-03-20 Anders Carlsson <andersca@apple.com>
Fix a paste-o in WebPaymentCoordinatorProxy::platformCompletePaymentSession
https://bugs.webkit.org/show_bug.cgi?id=169881
rdar://problem/31030944
Reviewed by Dan Bernstein.
Don't always pass PKPaymentAuthorizationStatusFailure to the completion handler.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
2017-03-20 Wenson Hsieh <wenson_hsieh@apple.com>
TextIndicator should support a mode where selection rects are used to size the snapshot
https://bugs.webkit.org/show_bug.cgi?id=169845
<rdar://problem/31127818>
Reviewed by Beth Dakin.
Adopt the new TextIndicatorOptionUseSelectionRectForSizing flag when generating an edit data interaction snapshot.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didConcludeEditDataInteraction):
2017-03-20 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Add missing types to WebKitAutocleanups.
* UIProcess/API/gtk/WebKitAutocleanups.h:
2017-03-19 Brian Burg <bburg@apple.com>
[Cocoa] Web Automation: non-sticky virtual keys like 'left arrow' don't work properly
https://bugs.webkit.org/show_bug.cgi?id=169733
<rdar://problem/30162608>
Reviewed by Joseph Pecoraro.
There were several issues that caused certain virtual keys to not work correctly.
When a virtual key like 'left arrow' was dispatched as a keydown event, it was
ultimately being translated into an insertText: command instead of moveLeft:.
- The automation browser window was not properly made key window and active, so
AppKit never tried to match the NSEvent as a key equivalent. That code path
must be taken in this case, as it translates arrow keys into command selectors.
- AppKit relies on its own private use area (PUA) unicode characters to encode
control keys that do not affect key modifier state, like the arrow keys.
Since these PUA characters were not being used as the 'characters' of the
NSEvents we synthesize, the events are treated as unknown and AppKit falls
back to inserting the codepoint as uninterpreted text.
- The Mac implementation of platformSimulateKeyStroke did not allow non-sticky
virtual keys to use the 'InsertByKey' interaction which sends keydown+keyup.
This is a programming mistake that causes such inputs to assert in debug builds
and bail out to do nothing in non-debug builds.
- A few simulated virtual keys that are matched to key equivalents did not properly set
'charactersIgnoringModifiers' on NSEvents, which may use the wrong editing command.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::performKeyboardInteractions):
Fix this guard so that we actually call into key event synthesis code for iOS.
* UIProcess/Automation/WebAutomationSession.h: Add declarations.
* UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::charCodeForVirtualKey): Moved from iOS implementation.
(WebKit::WebAutomationSession::charCodeIgnoringModifiersForVirtualKey): Added.
There are only a few special cases for now. We will probably need to hardcode
the decomposition for other ASCII characters so the expected DOM events are fired
when entering a shifted character (i.e., 'A' should be 'Shift'+'a', not 'A').
* UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
(WebKit::WebAutomationSession::platformSimulateKeyStroke):
Use charCodeIgnoringModifiersForVirtualKey().
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::sendSynthesizedEventsToPage): use -becomeKeyWindow.
(WebKit::keyHasStickyModifier): Added.
(WebKit::keyCodeForVirtualKey): Added.
(WebKit::eventModifierFlagsForVirtualKey):Added.
(WebKit::WebAutomationSession::platformSimulateKeyStroke):
Separately compute key stickiness, keyCode, event modifier, and charCode for
the simulated keystroke. The code to compute charCode is now shared between
iOS and macOS since the PUA characters are the same for both AppKit and UIKit.
2017-03-17 Brady Eidson <beidson@apple.com>
Make HTTPCookieStorage operate in the UIProcess in absence of a WebProcessPool.
<rdar://problem/31102330> and https://bugs.webkit.org/show_bug.cgi?id=169797
Reviewed by Alex Christensen.
* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::~HTTPCookieStore):
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::setCookie):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::registerObserver):
(API::HTTPCookieStore::unregisterObserver):
(API::HTTPCookieStore::cookieManagerDestroyed):
(API::HTTPCookieStore::registerForNewProcessPoolNotifications):
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::create):
(WebKit::WebProcessPool::notifyThisWebProcessPoolWasCreated):
(WebKit::m_hiddenPageThrottlingTimer):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):
(WebKit::WebsiteDataStore::processPoolForCookieStorageNotifications): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
2017-03-17 Chris Dumez <cdumez@apple.com>
[WK2] Disable background tab responsiveness detection on iOS
https://bugs.webkit.org/show_bug.cgi?id=169824
<rdar://problem/30913776>
Reviewed by Dan Bernstein.
Disable background tab responsiveness detection on iOS where background tabs
often get suspended. This feature was not tested or meant to be enabled on
iOS, this was an oversight on my part.
* UIProcess/BackgroundProcessResponsivenessTimer.cpp:
(WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive):
2017-03-17 Michael Saboff <msaboff@apple.com>
Use USE_INTERNAL_SDK to compute ENABLE_FAST_JIT_PERMISSIONS instead of HAVE_INTERNAL_SDK
https://bugs.webkit.org/show_bug.cgi?id=169817
Reviewed by Filip Pizlo.
* Configurations/FeatureDefines.xcconfig:
2017-03-17 Antti Koivisto <antti@apple.com>
Add a reload policy where only expired subresources are revalidated
https://bugs.webkit.org/show_bug.cgi?id=169756
Reviewed by Andreas Kling.
* UIProcess/API/C/WKPage.cpp:
(WKPageReload):
(WKPageReloadWithoutContentBlockers):
(WKPageReloadFromOrigin):
(WKPageReloadExpiredOnly):
* UIProcess/API/C/WKPage.h:
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController reload]):
(-[WKBrowsingContextController reloadFromOrigin]):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView reload]):
(-[WKWebView reloadFromOrigin]):
(-[WKWebView _reloadWithoutContentBlockers]):
(-[WKWebView _reloadExpiredOnly]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::reloadBrowsingContext):
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reload):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reload):
(WebKit::shouldReuseCommittedSandboxExtension):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2017-03-16 Alex Christensen <achristensen@webkit.org>
Use completion handlers instead of return values for sending websocket data
https://bugs.webkit.org/show_bug.cgi?id=169802
Reviewed by Carlos Garcia Campos.
* UIProcess/InspectorServer/WebSocketServerConnection.cpp:
(WebKit::WebSocketServerConnection::sendWebSocketMessage):
(WebKit::WebSocketServerConnection::sendHTTPResponseHeader):
(WebKit::WebSocketServerConnection::sendRawData):
2017-03-17 Tomas Popela <tpopela@redhat.com>
Fix uninitialized public members in WebProcess
https://bugs.webkit.org/show_bug.cgi?id=169604
Reviewed by Michael Catanzaro.
Found by Coverity scan.
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
(WebKit::NetscapePluginX11::NetscapePluginX11):
2017-03-17 Tomas Popela <tpopela@redhat.com>
Fix uninitialized public members in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=169598
Reviewed by Alex Christensen.
Found by Coverity scan.
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
2017-03-16 Alex Christensen <achristensen@webkit.org>
Fix GTK build.
* UIProcess/InspectorServer/WebSocketServerConnection.h:
2017-03-16 Alex Christensen <achristensen@webkit.org>
Fix GTK build.
* UIProcess/InspectorServer/WebSocketServerConnection.cpp:
(WebKit::WebSocketServerConnection::didReceiveSocketStreamData):
* UIProcess/InspectorServer/WebSocketServerConnection.h:
2017-03-16 Michael Saboff <msaboff@apple.com>
Turn off JavaScript Configuration File processing for Debug builds
https://bugs.webkit.org/show_bug.cgi?id=169799
Reviewed by Dean Jackson.
Change the default value for m_javaScriptConfigurationFileEnabled for Debug
builds to be the same as a Release build, that is false (off).
* UIProcess/WebProcessPool.h:
2017-03-16 Simon Fraser <simon.fraser@apple.com>
Improve the system tracing points
https://bugs.webkit.org/show_bug.cgi?id=169790
Reviewed by Zalan Bujtas.
Use a more cohesive set of system trace points that give a good overview of what
WebKit is doing. Added points for resource loading, render tree building, sync messages
to the web process, async image decode, WASM and fetching cookies.
* UIProcess/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::sendSync):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleTouchEventSynchronously):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::buildTransaction):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::didUpdate):
(WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
2017-03-16 Youenn Fablet <youenn@apple.com>
Wrap legacy WebRTC API in runtime flag
https://bugs.webkit.org/show_bug.cgi?id=169646
Reviewed by Alex Christensen.
Adding preference to legacy API.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetWebRTCLegacyAPIEnabled):
(WKPreferencesGetWebRTCLegacyAPIEnabled):
* UIProcess/API/C/WKPreferencesRef.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2017-03-16 Brady Eidson <beidson@apple.com>
Update the WKHTTPCookieStore API to be simpler and add observers.
<rdar://problem/31096000> and https://bugs.webkit.org/show_bug.cgi?id=169776
Reviewed by Alex Christensen.
When reviewing the API internally we realized the NSHTTPCookieStorage model doesn't
necessarily fit perfectly, and that to handle partitioned cookies going forward we
need to be much simpler right now.
We also realized that we should implement the "cookie store changed" observer for
any clients that might be providing a cookie viewing API.
* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::~HTTPCookieStore):
(API::HTTPCookieStore::deleteCookie):
(API::APIWebCookieManagerProxyObserver::APIWebCookieManagerProxyObserver):
(API::HTTPCookieStore::registerObserver):
(API::HTTPCookieStore::unregisterObserver):
(API::HTTPCookieStore::cookiesDidChange):
(API::HTTPCookieStore::cookieManagerDestroyed):
(API::HTTPCookieStore::registerForNewProcessPoolNotifications):
(API::HTTPCookieStore::unregisterForNewProcessPoolNotifications):
(API::HTTPCookieStore::setCookies): Deleted.
(API::HTTPCookieStore::removeCookiesSinceDate): Deleted.
(API::HTTPCookieStore::setHTTPCookieAcceptPolicy): Deleted.
(API::HTTPCookieStore::getHTTPCookieAcceptPolicy): Deleted.
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/Cocoa/WKHTTPCookieStore.h:
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
(WKHTTPCookieStoreObserver::WKHTTPCookieStoreObserver):
(-[WKHTTPCookieStore dealloc]):
(-[WKHTTPCookieStore allCookies:]):
(-[WKHTTPCookieStore addObserver:]):
(-[WKHTTPCookieStore removeObserver:]):
(-[WKHTTPCookieStore fetchCookies:]): Deleted.
(-[WKHTTPCookieStore fetchCookiesForURL:completionHandler:]): Deleted.
(-[WKHTTPCookieStore setCookies:forURL:mainDocumentURL:completionHandler:]): Deleted.
(-[WKHTTPCookieStore removeCookiesSinceDate:completionHandler:]): Deleted.
(-[WKHTTPCookieStore setCookieAcceptPolicy:completionHandler:]): Deleted.
(kitCookiePolicyToNSCookiePolicy): Deleted.
(-[WKHTTPCookieStore fetchCookieAcceptPolicy:]): Deleted.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::~WebCookieManagerProxy):
(WebKit::WebCookieManagerProxy::processPoolDestroyed):
(WebKit::WebCookieManagerProxy::registerObserver):
(WebKit::WebCookieManagerProxy::unregisterObserver):
(WebKit::WebCookieManagerProxy::cookiesDidChange):
(WebKit::WebCookieManagerProxy::setCookieObserverCallback): Deleted.
* UIProcess/WebCookieManagerProxy.h:
(WebKit::WebCookieManagerProxy::Observer::~Observer):
Add the ability for interested clients to listen for the creation of new WebProcessPools,
which is needed by APIHTTPCookieStore:
* UIProcess/WebProcessPool.cpp:
(WebKit::generateListenerIdentifier):
(WebKit::processPoolCreationListenerFunctionMap):
(WebKit::WebProcessPool::registerProcessPoolCreationListener):
(WebKit::WebProcessPool::unregisterProcessPoolCreationListener):
(WebKit::WebProcessPool::create):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::processPoolForCookieStorageNotifications):
(WebKit::WebsiteDataStore::isAssociatedProcessPool):
(WebKit::WebsiteDataStore::processPools):
* UIProcess/WebsiteData/WebsiteDataStore.h:
2017-03-16 Brian Burg <bburg@apple.com>
[iOS WK2] Web Automation: implement platform methods for simulating keyboard events
https://bugs.webkit.org/show_bug.cgi?id=169487
<rdar://problem/28360564>
Reviewed by Joseph Pecoraro.
Reimplement platformSimulateKey{Stroke, Sequence} to simulate events coming from UIKit.
These events are sent directly into WebCore without going through the keyboard system,
since we don't need to show the keyboard when simulating keystrokes. For example, the
keystrokes may not be representable given the current keyboard layout and system language.
* UIProcess/Automation/WebAutomationSession.cpp:
* UIProcess/Automation/WebAutomationSession.h:
Un-stub implementations that now exist for iOS.
* UIProcess/Automation/ios/WebAutomationSessionIOS.mm: Added.
(WebKit::WebAutomationSession::sendSynthesizedEventsToPage): Added.
This is similar to the Mac version, but it sends events directly into WebPageProxy
instead of sending them to the NSWindow containing the WebView.
(WebKit::WebAutomationSession::platformSimulateKeyStroke):
Use a somewhat different strategy for determining the charCode/keyCode since we cannot
rely on the system keyboard / input manager to generate and deliver real key events.
Compared to the Mac platform method, this requires setting up fewer fields and does
not use AppKit's current modifier state to determine the effect of sticky modifiers.
(WebKit::WebAutomationSession::platformSimulateKeySequence):
This is almost verbatim from the Mac platform method but uses a different event class.
* WebKit2.xcodeproj/project.pbxproj: Add new file.
2017-03-16 Youenn Fablet <youenn@apple.com>
[mac-wk2 debug] LayoutTest webrtc/video-mute.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=169758
Reviewed by Eric Carlson.
Test is timing out due to the UIProcess requesting to disable/enable ICE candidate filtering
on a page whose preference is set to not enabling ICE candidate filtering.
Current fix is to act upon what UI process asks if the page preference is to enable ICE candidate filtering.
If ICE candidate filtering preference is disable for that page (WebKitTestRunner case), no disabling/enabling is done at all.
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::endedCaptureSession):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_backgroundCPULimit):
(WebKit::m_backgroundCPULimit):
(WebKit::WebPage::disableICECandidateFiltering):
(WebKit::WebPage::enableICECandidateFiltering):
* WebProcess/WebPage/WebPage.h:
2017-03-16 Alex Christensen <achristensen@webkit.org>
Clean up WKContentExtension API
https://bugs.webkit.org/show_bug.cgi?id=169772
Reviewed by Geoffrey Garen.
Based on feedback I have decided to do the following:
1. Rename lookup to lookUp because look and up are two words.
2. Change the parameter of removeContentExtension to a WKContentExtension* to match addContentExtension.
3. Add an identifier property accessor to WKContentExtension.
4. Change the order of the new error types. This wasn't exactly based on any feedback, but they look more organized now.
* UIProcess/API/Cocoa/WKContentExtension.h:
* UIProcess/API/Cocoa/WKContentExtension.mm:
(-[WKContentExtension identifier]):
* UIProcess/API/Cocoa/WKContentExtensionStore.h:
* UIProcess/API/Cocoa/WKContentExtensionStore.mm:
(toWKErrorCode):
(-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]):
(-[WKContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]): Deleted.
* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/WKError.mm:
(localizedDescriptionForErrorCode):
* UIProcess/API/Cocoa/WKUserContentController.h:
* UIProcess/API/Cocoa/WKUserContentController.mm:
(-[WKUserContentController removeContentExtension:]):
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
(toUserContentExtensionStoreError):
(-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
2017-03-16 Tomas Popela <tpopela@redhat.com>
Fix uninitialized public members in Webkit2/UIProcess/API/gtk
https://bugs.webkit.org/show_bug.cgi?id=169602
Reviewed by Michael Catanzaro.
Found by Coverity scan.
* UIProcess/API/gtk/WebKitMimeInfo.cpp:
* UIProcess/API/gtk/WebKitSettings.cpp:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
2017-03-16 Zan Dobersek <zdobersek@igalia.com>
Unreviewed follow-up to r213787. Move the DatabaseProcess build targets
to the top of WebKit2_SOURCES list in order to maintain the alphabetical
order.
* CMakeLists.txt:
2017-03-15 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
2017-03-15 Jer Noble <jer.noble@apple.com>
Optionally capture audio in the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=169609
Reviewed by Alex Christensen.
Add a new class pair, UserMediaCaptureManager/Proxy, to allow a RealtimeMediaSource
requested in a WebProcess to be created in the UIProcess and push its audio data across the
process boundary to its clients in the WebProcess. Because these classes are clients of the
RealtimeMediaSourceCenter::singleton(), they must be a singleton in the WebProcess as well,
so they are attached to the WebProcess class in the web process and to WebProcessProxy in
the UIProcess.
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: Added.
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::~SourceProxy):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::source):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::description):
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::numberOfFrames):
(WebKit::UserMediaCaptureManagerProxy::UserMediaCaptureManagerProxy):
(WebKit::UserMediaCaptureManagerProxy::~UserMediaCaptureManagerProxy):
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
(WebKit::UserMediaCaptureManagerProxy::startProducingData):
(WebKit::UserMediaCaptureManagerProxy::stopProducingData):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
(WebKit::UserMediaCaptureManagerProxy::process):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: Added.
* WebProcess/cocoa/UserMediaCaptureManager.cpp: Added.
(WebKit::nextSessionID):
(WebKit::UserMediaCaptureManager::Source::Source):
(WebKit::UserMediaCaptureManager::Source::~Source):
(WebKit::UserMediaCaptureManager::Source::setCapabilities):
(WebKit::UserMediaCaptureManager::Source::setSettings):
(WebKit::UserMediaCaptureManager::Source::description):
(WebKit::UserMediaCaptureManager::Source::setStorage):
(WebKit::UserMediaCaptureManager::Source::setRingBufferFrameBounds):
(WebKit::UserMediaCaptureManager::Source::audioSamplesAvailable):
(WebKit::UserMediaCaptureManager::UserMediaCaptureManager):
(WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
(WebKit::UserMediaCaptureManager::supplementName):
(WebKit::UserMediaCaptureManager::initialize):
(WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints):
(WebKit::UserMediaCaptureManager::sourceStopped):
(WebKit::UserMediaCaptureManager::sourceMutedChanged):
(WebKit::UserMediaCaptureManager::sourceEnabledChanged):
(WebKit::UserMediaCaptureManager::sourceSettingsChanged):
(WebKit::UserMediaCaptureManager::storageChanged):
(WebKit::UserMediaCaptureManager::ringBufferFrameBoundsChanged):
(WebKit::UserMediaCaptureManager::audioSamplesAvailable):
(WebKit::UserMediaCaptureManager::startProducingData):
(WebKit::UserMediaCaptureManager::stopProducingData):
* WebProcess/cocoa/UserMediaCaptureManager.h: Added.
* WebProcess/cocoa/UserMediaCaptureManager.messages.in: Added.
Initialize UserMediaCaptureManager/Proxy:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
* UIProcess/WebProcessProxy.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
WebUserMediaClientMac is no longer necessary now that the UserMediaCaptureManager overrides
the factories:
* WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
(WebKit::WebUserMediaClient::WebUserMediaClient):
(WebKit::WebUserMediaClient::initializeFactories): Deleted.
Add a new preference and WebProcessCreationParameters member to control whether
capturing is done in the UIProcess:
* Shared/WebPreferencesDefinitions.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
Add new files to the project:
* DerivedSources.make:
* WebKit2.xcodeproj/project.pbxproj:
2017-03-15 Tim Horton <timothy_horton@apple.com>
Null deref under callAfterNextPresentationUpdate
https://bugs.webkit.org/show_bug.cgi?id=169710
<rdar://problem/30987863>
Reviewed by Simon Fraser.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::callAfterNextPresentationUpdate):
Call the callback with an error if we don't have a web process or drawing area.
2017-03-15 Chris Dumez <cdumez@apple.com>
Document state (e.g. form data) is lost after a tab is terminated in the background for power reasons
https://bugs.webkit.org/show_bug.cgi?id=169635
<rdar://problem/31046729>
Reviewed by Andreas Kling.
Document state (e.g. form data) was lost after a tab was terminated in the background for power
reasons. To address the issue, we now save the document state whenever a page is backgrounded.
This document state automatically gets restored when reloading the page after termination.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::visibilityDidChange):
(WebKit::WebPage::setActivityState):
* WebProcess/WebPage/WebPage.h:
2017-03-15 Wenson Hsieh <wenson_hsieh@apple.com>
WebContent crash due to bad variant access in WebKit: WebKit::WebPage::expandedRangeFromHandle
https://bugs.webkit.org/show_bug.cgi?id=169657
<rdar://problem/30631070>
Reviewed by Tim Horton.
In WebPageIOS.mm, the call to unionDOMRanges from WebPage::expandedRangeFromHandle invokes
Range::compareBoundaryPoints, assuming that the return value is not an exception, and then attempts to perform
integer comparison on the result. This is one speculative cause of the web content crash in the radar.
There isn't a known way to reproduce this crash.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::unionDOMRanges):
2017-03-15 Tim Horton <timothy_horton@apple.com>
Un-deprecate the original PDFPlugin
https://bugs.webkit.org/show_bug.cgi?id=169655
Reviewed by Anders Carlsson.
* Shared/mac/PDFKitImports.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Plugins/PDF/DeprecatedPDFLayerControllerSPI.h: Removed.
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h: Removed.
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: Removed.
* WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
The transition to the non-deprecated PDFPlugin never happened,
and we have a very different plan now.
2017-03-15 Alex Christensen <achristensen@webkit.org>
Compiled content extensions should include the JSON source
https://bugs.webkit.org/show_bug.cgi?id=169643
Reviewed by Geoffrey Garen.
* UIProcess/API/APIContentExtensionStore.cpp:
(API::ContentExtensionStore::ContentExtensionStore):
(API::ContentExtensionMetaData::fileSize):
(API::encodeContentExtensionMetaData):
(API::decodeContentExtensionMetaData):
(API::compiledToFile):
(API::createExtension):
(API::ContentExtensionStore::getContentExtensionSource):
* UIProcess/API/APIContentExtensionStore.h:
* UIProcess/API/Cocoa/WKContentExtensionStore.mm:
(toWKErrorCode):
(-[WKContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
(-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
(-[WKContentExtensionStore _getContentExtensionSourceForIdentifier:completionHandler:]):
* UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h:
* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
(toUserContentExtensionStoreError):
(-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
(-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
(-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
2017-03-15 Dean Jackson <dino@apple.com>
Sort Xcode project files
https://bugs.webkit.org/show_bug.cgi?id=169669
Reviewed by Antoine Quint.
* WebKit2.xcodeproj/project.pbxproj:
2017-03-14 Andy Estes <aestes@apple.com>
[iOS] -[WKWebView _dataForDisplayedPDF] returns nil when called before an encrypted PDF has been unlocked
https://bugs.webkit.org/show_bug.cgi?id=169653
<rdar://problem/24137675>
Reviewed by Tim Horton.
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView pdfDocument]): Changed to return _cgPDFDocument directly instead of via the
UIPDFDocument, which is only created after the PDF has been unlocked.
2017-03-14 Tim Horton <timothy_horton@apple.com>
Let PDFLayerController drive cursor updates so that it's correct more often
https://bugs.webkit.org/show_bug.cgi?id=169626
<rdar://problem/30762943>
Reviewed by Simon Fraser.
* WebProcess/Plugins/PDF/DeprecatedPDFLayerControllerSPI.h:
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(-[WKPDFLayerControllerDelegate setMouseCursor:]):
(WebKit::PDFPlugin::handleMouseEvent):
(WebKit::PDFPlugin::handleMouseEnterEvent):
(WebKit::pdfLayerControllerCursorTypeToCursor):
(WebKit::PDFPlugin::notifyCursorChanged):
Disable updateCursor and use the setMouseCursor delegate method when possible.
2017-03-14 Andrew Gold <agold@apple.com>
Extend WKPreferences to include preferences for testing MediaCapture.
https://bugs.webkit.org/show_bug.cgi?id=169560
Reviewed by Youenn Fablet.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _mockCaptureDevicesEnabled]):
(-[WKPreferences _setMockCaptureDevicesEnabled:]):
(-[WKPreferences _mediaCaptureRequiresSecureConnection]):
(-[WKPreferences _setMediaCaptureRequiresSecureConnection:]):
(-[WKPreferences _enumeratingAllNetworkInterfacesEnabled]):
(-[WKPreferences _setEnumeratingAllNetworkInterfacesEnabled:]):
(-[WKPreferences _iceCandidateFiltertingEnabled]):
(-[WKPreferences _setICECandidateFilteringEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2017-03-14 Brady Eidson <beidson@apple.com>
Rename WKHTTPCookieStorage to WKHTTPCookieStore.
https://bugs.webkit.org/show_bug.cgi?id=169630
Reviewed by Tim Horton.
* CMakeLists.txt:
* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* UIProcess/API/APIHTTPCookieStore.cpp: Renamed from Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.cpp.
(API::HTTPCookieStore::HTTPCookieStore):
(API::HTTPCookieStore::~HTTPCookieStore):
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::setCookie):
(API::HTTPCookieStore::setCookies):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::removeCookiesSinceDate):
(API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
(API::HTTPCookieStore::getHTTPCookieAcceptPolicy):
* UIProcess/API/APIHTTPCookieStore.h: Renamed from Source/WebKit2/UIProcess/API/APIHTTPCookieStorage.h.
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::httpCookieStore):
(API::WebsiteDataStore::httpCookieStorage): Deleted.
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/Cocoa/WKHTTPCookieStore.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.h.
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorage.mm.
(coreCookiesToNSCookies):
(-[WKHTTPCookieStore dealloc]):
(-[WKHTTPCookieStore fetchCookies:]):
(-[WKHTTPCookieStore fetchCookiesForURL:completionHandler:]):
(-[WKHTTPCookieStore setCookie:completionHandler:]):
(-[WKHTTPCookieStore deleteCookie:completionHandler:]):
(-[WKHTTPCookieStore setCookies:forURL:mainDocumentURL:completionHandler:]):
(-[WKHTTPCookieStore removeCookiesSinceDate:completionHandler:]):
(-[WKHTTPCookieStore setCookieAcceptPolicy:completionHandler:]):
(kitCookiePolicyToNSCookiePolicy):
(-[WKHTTPCookieStore fetchCookieAcceptPolicy:]):
(-[WKHTTPCookieStore _apiObject]):
* UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKHTTPCookieStorageInternal.h.
(WebKit::wrapper):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _httpCookieStore]):
(-[WKWebsiteDataStore _httpCookieStorage]): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebProcessPool.cpp:
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):
* WebKit2.xcodeproj/project.pbxproj:
2017-03-14 Anders Carlsson <andersca@apple.com>
Propagate PassKit errors
https://bugs.webkit.org/show_bug.cgi?id=169633
rdar://problem/31043392
Reviewed by Dean Jackson.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSError):
2017-03-06 Jer Noble <jer.noble@apple.com>
Refactor: Allow WebKit2 to override the creation of RealtimeMediaSources
https://bugs.webkit.org/show_bug.cgi?id=169227
Reviewed by Eric Carlson.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
(WebKit::WebUserMediaClient::WebUserMediaClient):
(WebKit::WebUserMediaClient::initializeFactories): Add empty non-Cocoa implementation.
* WebProcess/WebCoreSupport/WebUserMediaClient.h:
* WebProcess/WebCoreSupport/cocoa/WebUserMediaClientMac.mm: Added.
(WebKit::WebUserMediaClient::initializeFactories): Initialize a (for now) pass-through factory.
2017-03-14 Dean Jackson <dino@apple.com>
Rename LayerTypeWebGLLayer and use it for both WebGL and WebGPU
https://bugs.webkit.org/show_bug.cgi?id=169628
<rdar://problems/31047025>
Reviewed by Simon Fraser.
Rename LayerTypeWebGLLayer to LayerTypeContentsProvidedLayer
and use it for both WebGLLayer and WebGPULayer, to avoid
code duplication.
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::description):
* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
(WebKit::PlatformCALayerRemoteCustom::clone):
2017-03-13 Jer Noble <jer.noble@apple.com>
Make classes used by Media Stream encode/decode friendly
https://bugs.webkit.org/show_bug.cgi?id=169567
Reviewed by Eric Carlson.
Make the encoder and decoder for MediaConstraintsData a little less wordy.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<MediaConstraintsData>::encode):
(IPC::ArgumentCoder<MediaConstraintsData>::decode):
2017-03-14 Jer Noble <jer.noble@apple.com>
Adapt CARingBuffer to be usable across processes
https://bugs.webkit.org/show_bug.cgi?id=169591
Reviewed by Alex Christensen.
Add a new class which wraps a SharedMemory object and uses that shared memory as the
backing store of a CARingBuffer. This backing store can be set to "read only", which
prevents the backing from being de- or re-allocated.
* WebKit2.xcodeproj/project.pbxproj:
* Shared/Cocoa/SharedRingBufferStorage.cpp: Added.
(WebKit::SharedRingBufferStorage::setStorage):
(WebKit::SharedRingBufferStorage::setReadOnly):
(WebKit::SharedRingBufferStorage::allocate):
(WebKit::SharedRingBufferStorage::deallocate):
(WebKit::SharedRingBufferStorage::data):
* Shared/Cocoa/SharedRingBufferStorage.h: Added.
(WebKit::SharedRingBufferStorage::SharedRingBufferStorage):
(WebKit::SharedRingBufferStorage::invalidate):
(WebKit::SharedRingBufferStorage::storage):
(WebKit::SharedRingBufferStorage::readOnly):
2017-03-14 Eric Carlson <eric.carlson@apple.com>
[iOS] The web process should inherit application state from UI process
https://bugs.webkit.org/show_bug.cgi?id=169156
<rdar://problem/30845473>
Reviewed by Brady Eidson.
Move PID proxy setup to platformInitializeWebProcess as suggested in
post-landing feedback.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformInitialize):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
2017-03-14 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r213915.
Caused WK2 LayoutTests to exit early with timeouts.
Reverted changeset:
"Fix uninitialized public members in NetworkProcess"
https://bugs.webkit.org/show_bug.cgi?id=169598
http://trac.webkit.org/changeset/213915
2017-03-14 Brady Eidson <beidson@apple.com>
REGRESSION (r213877): WebKit2.CookieManager fails.
https://bugs.webkit.org/show_bug.cgi?id=169581
Reviewed by Tim Horton.
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::processPoolDestroyed): Invalidate the new sets of callbacks.
(WebKit::WebCookieManagerProxy::processDidClose): Ditto.
2017-03-14 Tomas Popela <tpopela@redhat.com>
Fix uninitialized public members in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=169598
Reviewed by Alex Christensen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
2017-03-10 Ada Chan <adachan@apple.com>
[Mac] Add API to get the NSURLProtectionSpace from WKProtectionSpaceRef
https://bugs.webkit.org/show_bug.cgi?id=169494
<rdar://problem/11872163>
Reviewed by Dan Bernstein.
* UIProcess/API/C/mac/WKProtectionSpaceNS.h: Added.
* UIProcess/API/C/mac/WKProtectionSpaceNS.mm: Added.
(WKProtectionSpaceCopyNSURLProtectionSpace):
* WebKit2.xcodeproj/project.pbxproj:
2017-03-14 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Adopt updated data operation interfaces for data interaction
https://bugs.webkit.org/show_bug.cgi?id=169414
<rdar://problem/30948186>
Reviewed by Tim Horton.
Plumb additional information about the data interaction caret over to the UI process after handling a data
interaction action in the web process.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformDragControllerAction):
(WebKit::WebPageProxy::resetCurrentDragInformation):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::currentDragCaretRect):
(WebKit::WebPageProxy::resetCurrentDragInformation): Deleted.
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):
2017-03-14 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Data interaction tests occasionally hit assertions in debug builds
https://bugs.webkit.org/show_bug.cgi?id=169002
<rdar://problem/30994806>
Reviewed by Tim Horton.
Renames setIgnoreCompositionSelectionChange to setIgnoreSelectionChanges. See WebCore ChangeLog for more details.
* Shared/EditorState.cpp:
(WebKit::EditorState::encode):
(WebKit::EditorState::decode):
* Shared/EditorState.h:
* UIProcess/gtk/WebPageProxyGtk.cpp:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::editorStateChanged):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::editorStateChanged):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState):
(WebKit::WebPage::performDragControllerAction):
(WebKit::WebPage::setComposition):
(WebKit::WebPage::didChangeSelection):
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::setSelectionChangeUpdatesEnabledInAllFrames):
(WebKit::FindController::willFindString):
(WebKit::FindController::didFailToFindString):
(WebKit::FindController::didHideFindIndicator):
(WebKit::setCompositionSelectionChangeEnabledInAllFrames): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateSelectionAppearance):
(WebKit::WebPage::replaceSelectedText):
(WebKit::WebPage::replaceDictatedText):
2017-03-14 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix syntax error in GTK+ API docs.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_class_init):
2017-03-13 Brady Eidson <beidson@apple.com>
WKWebView provides no access to cookies.
https://bugs.webkit.org/show_bug.cgi?id=140191
Reviewed by Tim Horton.
This adds a new WKHTTPCookieManager SPI.
It follows the NSHTTPCookieStorage API but asynchronous (with completion handlers).
* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* UIProcess/API/APIHTTPCookieStorage.cpp: Added.
(API::HTTPCookieStorage::HTTPCookieStorage):
(API::HTTPCookieStorage::~HTTPCookieStorage):
(API::HTTPCookieStorage::cookies):
(API::HTTPCookieStorage::setCookie):
(API::HTTPCookieStorage::setCookies):
(API::HTTPCookieStorage::deleteCookie):
(API::HTTPCookieStorage::removeCookiesSinceDate):
(API::HTTPCookieStorage::setHTTPCookieAcceptPolicy):
(API::HTTPCookieStorage::getHTTPCookieAcceptPolicy):
* UIProcess/API/APIHTTPCookieStorage.h: Added.
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::defaultDataStore):
(API::WebsiteDataStore::httpCookieStorage):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/C/WKCookieManager.cpp:
(WKCookieManagerDeleteAllCookiesModifiedAfterDate):
(WKCookieManagerSetHTTPCookieAcceptPolicy):
(WKCookieManagerGetHTTPCookieAcceptPolicy):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreGetDefaultDataStore):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setCookieAcceptPolicy:]):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(+[WKWebsiteDataStore defaultDataStore]):
(-[WKWebsiteDataStore _httpCookieStorage]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/WKHTTPCookieStorage.h:
* UIProcess/API/Cocoa/WKHTTPCookieStorage.mm: Added.
(coreCookiesToNSCookies):
(-[WKHTTPCookieStorage dealloc]):
(-[WKHTTPCookieStorage fetchCookies:]):
(-[WKHTTPCookieStorage fetchCookiesForURL:completionHandler:]):
(-[WKHTTPCookieStorage setCookie:completionHandler:]):
(-[WKHTTPCookieStorage deleteCookie:completionHandler:]):
(-[WKHTTPCookieStorage setCookies:forURL:mainDocumentURL:completionHandler:]):
(-[WKHTTPCookieStorage removeCookiesSinceDate:completionHandler:]):
(-[WKHTTPCookieStorage setCookieAcceptPolicy:completionHandler:]):
(kitCookiePolicyToNSCookiePolicy):
(-[WKHTTPCookieStorage fetchCookieAcceptPolicy:]):
(-[WKHTTPCookieStorage _apiObject]):
* UIProcess/API/Cocoa/WKHTTPCookieStorageInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h.
(WebKit::wrapper):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
(WebKit::WebCookieManagerProxy::deleteCookiesForHostname):
(WebKit::WebCookieManagerProxy::deleteAllCookies):
(WebKit::WebCookieManagerProxy::deleteCookie):
(WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManagerProxy::setCookie):
(WebKit::WebCookieManagerProxy::setCookies):
(WebKit::WebCookieManagerProxy::getAllCookies):
(WebKit::WebCookieManagerProxy::getCookies):
(WebKit::WebCookieManagerProxy::didSetCookies):
(WebKit::WebCookieManagerProxy::didGetCookies):
(WebKit::WebCookieManagerProxy::didDeleteCookies):
(WebKit::WebCookieManagerProxy::startObservingCookieChanges):
(WebKit::WebCookieManagerProxy::stopObservingCookieChanges):
(WebKit::WebCookieManagerProxy::setCookieObserverCallback):
(WebKit::WebCookieManagerProxy::cookiesDidChange):
(WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::didSetHTTPCookieAcceptPolicy):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebCookieManagerProxy.messages.in:
* UIProcess/WebFrameProxy.h:
* UIProcess/WebProcessPool.cpp:
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):
(WebKit::WebsiteDataStore::processPools):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::deleteCookie):
(WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManager::getAllCookies):
(WebKit::WebCookieManager::getCookies):
(WebKit::WebCookieManager::setCookie):
(WebKit::WebCookieManager::setCookies):
(WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/Cookies/WebCookieManager.messages.in:
2017-03-13 John Wilander <wilander@apple.com>
Resource Load Statistics: More efficient network process messaging + Fix bug in user interaction reporting
https://bugs.webkit.org/show_bug.cgi?id=169506
Reviewed by Alex Christensen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
Now takes two vectors – domainsToRemove and domainsToAdd.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
The message now takes two vectors – domainsToRemove and domainsToAdd.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
Now takes two vectors – domainsToRemove and domainsToAdd.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
The message now takes two vectors – domainsToRemove and domainsToAdd.
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
Now converts to the two vectors needed by
WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler().
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::classifyResource):
No longer explicitly calls ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
Changed the order of two blocks to not build a vector if we are to return early.
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
Now calls WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler().
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
Now takes a handler with two vectors – domainsToRemove and domainsToAdd.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
Now takes two vectors – domainsToRemove and domainsToAdd.
(WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
Now submits a handler that takes two vectors – domainsToRemove and domainsToAdd.
* UIProcess/WebsiteData/WebsiteDataStore.h:
2017-03-13 Dean Jackson <dino@apple.com>
Respect the runtime flag for WebGPU, default feature to off, and print a warning
https://bugs.webkit.org/show_bug.cgi?id=169564
<rdar://problems/31018864>
Reviewed by Tim Horton.
Make sure WebGPU respects its runtime feature flag. Also, since
this implementation doesn't validate content, it should default
to being disabled.
* Shared/WebPreferencesDefinitions.h:
2017-03-13 Anders Carlsson <andersca@apple.com>
Fix more build warnings.
* UIProcess/mac/WKWebInspectorWKWebView.mm:
(WebKit::runOpenPanel):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformSave):
2017-03-13 Anders Carlsson <andersca@apple.com>
Fix build warnings.
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformSave):
2017-03-13 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Clean up RunLoop and WorkQueue with Seconds and Function
https://bugs.webkit.org/show_bug.cgi?id=169537
Reviewed by Sam Weinig.
* Shared/ChildProcess.cpp:
(WebKit::didCloseOnConnectionWorkQueue):
* UIProcess/Storage/LocalStorageDatabase.cpp:
* WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
(WebKit::AcceleratedSurfaceX11::resize):
2017-03-13 Chris Dumez <cdumez@apple.com>
Allow termination of background WebProcesses that go over a given CPU usage threshold
https://bugs.webkit.org/show_bug.cgi?id=169456
<rdar://problem/30960968>
Reviewed by Andreas Kling.
Allow termination of background WebProcesses that go over a given CPU usage threshold.
This can be enabled client side via the WKPageConfigurationSetBackgroundCPULimit()
SPI. The client provides the actual CPU threshold it wants to use at page level.
If such limit is set, whenever a WebContent process has no visible pages, we start
monitoring its CPU usage over 15 minutes periods. At the end of each period, we
check if the process' average CPU usage over this period was greater than the
background CPU limit. If it greater, the WebContent process send an IPC message to
the UIProcess letting it know that it exceeded the CPU limit. The UI process will
then log a message and terminate the process unless it has any audio playing.
Once a WebProcess has been terminated, we do not let the client know until one of its
pages becomes visible again. When this happens, we call the processDidCrash
delegate and Safari will take care of reloading the tab and showing the crash
banner then. This is done because we do not want to reload content that is
using a lot of CPU while in the background.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Add backgroundCPULimit to WebPageCreationParameters.
* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::copy):
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::backgroundCPULimit):
(API::PageConfiguration::setBackgroundCPULimit):
Add backgroundCPULimit to APIPageConfiguration.
* UIProcess/API/C/WKPageConfigurationRef.cpp:
(WKPageConfigurationSetBackgroundCPULimit):
* UIProcess/API/C/WKPageConfigurationRef.h:
Add SPI to set background CPU limit.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
Reset m_wasTerminatedDueToResourceExhaustionWhileInBackground flag
as the process was restarted.
(WebKit::WebPageProxy::dispatchActivityStateChange):
When the visibility state changes for a page that was terminated
while in the background due to exceeded CPU limit, notify the
client that the process crashed via the processDidCrash delegate.
Safari will use this delegate to reload the tab and show the crash
banner.
(WebKit::WebPageProxy::terminateProcess):
Add parameter to terminateProcess() to provide the reason. If the
page was terminated due to reaching CPU limit, set a flag so we
can delay calling processDidCrash until the page becomes visible
again.
(WebKit::WebPageProxy::creationParameters):
Set backgroundCPULimit on the WebPageCreationParameters.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::pagesCopy):
Add utility function to copy the list of pages to a Vector.
(WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
When we get an IPC message from a WebContent process to let us
know that the process exceeded the background CPU limit, we log
a message and we terminate it if it has no audio playing.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
Add DidExceedBackgroundCPULimit IPC message so the WebContent process
can let us know when it goes over the background CPU limit.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_backgroundCPULimit):
(WebKit::WebPage::setActivityState):
Notify the WebProcess whenever the activity state of a WebPage changes.
The WebProcess currently uses this information to determine when the
visibility of a page changes. This is needed as we only want to monitor
CPU usage of *background* WebContent processes (processes that have no
visible WebPage).
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::backgroundCPULimit):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
(WebKit::WebProcess::removeWebPage):
Call updateBackgroundCPULimit() whenever a WebPage is added or removed
since the limit is per page.
(WebKit::WebProcess::updateBackgroundCPULimit):
(WebKit::WebProcess::updateBackgroundCPUMonitorState):
No-ops on other platforms than Mac at the moment.
(WebKit::WebProcess::pageActivityStateDidChange):
Call updateBackgroundCPUMonitorState() whenever the visibility of the
WebPage changes as we only monitor the CPU usage of *background* WebContent
processes.
(WebKit::WebProcess::hasVisibleWebPage):
Add utility function to determine if there is any visible WebPage in this
WebContent process. If the function returns false, then we consider the
WebContent process to be a *background* WebContent process.
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateBackgroundCPULimit):
Compute the WebProcess' background CPU limit given the limit set for each
of its WebPages. We use the largest (i.e. most permissive) background CPU
limit among all the pages.
(WebKit::WebProcess::updateBackgroundCPUMonitorState):
Update the state of the background CPU monitor. This is called whenever
the background CPU limit of the process changes or whenever the visibility
of a WebPage changes.
2017-03-13 Michael Saboff <msaboff@apple.com>
Add iOS plumbing to WebProcess to enable JavaScriptCore configuration and logging
https://bugs.webkit.org/show_bug.cgi?id=169489
Reviewed by Geoffrey Garen.
Added new preference for enabling the use of a JavaScript configuration file
in iOS builds. The preference is used to enable the processing of the
configuration file.
(API::ProcessPoolConfiguration::ProcessPoolConfiguration):
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
(API::WebsiteDataStore::tempDirectoryFileSystemRepresentation):
(API::WebsiteDataStore::defaultDataStoreConfiguration):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::setJavaScriptConfigurationFileEnabledFromDefaults):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
* UIProcess/WebProcessPool.h:
2017-03-13 Zan Dobersek <zdobersek@igalia.com>
[WK2] Move AcceleratedSurface files under WebProcess/WebPage/CoordinatedGraphics
https://bugs.webkit.org/show_bug.cgi?id=169348
Reviewed by Carlos Garcia Campos.
Move the AcceleratedSurface header and implementation files under the
WebProcess/WebPage directory since that class is not specific to the
GTK+ port.
* PlatformGTK.cmake:
* WebProcess/WebPage/AcceleratedSurface.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/gtk/AcceleratedSurface.cpp.
(WebKit::AcceleratedSurface::create):
(WebKit::AcceleratedSurface::AcceleratedSurface):
(WebKit::AcceleratedSurface::resize):
* WebProcess/WebPage/AcceleratedSurface.h: Renamed from Source/WebKit2/WebProcess/WebPage/gtk/AcceleratedSurface.h.
(WebKit::AcceleratedSurface::window):
(WebKit::AcceleratedSurface::surfaceID):
(WebKit::AcceleratedSurface::shouldPaintMirrored):
2017-03-13 Konstantin Tokarev <annulen@yandex.ru>
[cmake] [WK2] Guard flags intended for GCC-like compilers with COMPILER_IS_GCC_OR_CLANG
https://bugs.webkit.org/show_bug.cgi?id=169551
Reviewed by Yusuke Suzuki.
This change allows building WK2 code with MSVC.
* CMakeLists.txt:
2017-03-13 Chris Dumez <cdumez@apple.com>
[WK2] Only report background WebProcesses as unresponsive in the background after 90 seconds
https://bugs.webkit.org/show_bug.cgi?id=169425
<rdar://problem/30954003>
Reviewed by Andreas Kling.
The background responsiveness checking was previously relying on the
isResponsive(std::function<void(bool)>) API which uses the ResponsivenessTimer
and has a timeout of 3 seconds. We believe this is too aggressive for background
tabs. Update BackgroundResponsiveTimer to stop relying on ResponsivenessTimer
and have its own timeout Timer which a delay of 90 seconds instead.
* UIProcess/API/C/mac/WKPagePrivateMac.mm:
(-[WKObservablePageState _webProcessIsResponsive]):
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController _webProcessIsResponsive]):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _webProcessIsResponsive]):
* UIProcess/BackgroundProcessResponsivenessTimer.cpp:
(WebKit::BackgroundProcessResponsivenessTimer::BackgroundProcessResponsivenessTimer):
(WebKit::BackgroundProcessResponsivenessTimer::~BackgroundProcessResponsivenessTimer):
(WebKit::BackgroundProcessResponsivenessTimer::updateState):
(WebKit::BackgroundProcessResponsivenessTimer::didReceiveBackgroundResponsivenessPong):
(WebKit::BackgroundProcessResponsivenessTimer::invalidate):
(WebKit::BackgroundProcessResponsivenessTimer::processTerminated):
(WebKit::BackgroundProcessResponsivenessTimer::responsivenessCheckTimerFired):
(WebKit::BackgroundProcessResponsivenessTimer::timeoutTimerFired):
(WebKit::BackgroundProcessResponsivenessTimer::setResponsive):
(WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive):
(WebKit::BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck):
(WebKit::BackgroundProcessResponsivenessTimer::client):
* UIProcess/BackgroundProcessResponsivenessTimer.h:
(WebKit::BackgroundProcessResponsivenessTimer::isResponsive):
* UIProcess/ResponsivenessTimer.h:
(WebKit::ResponsivenessTimer::isResponsive):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::updateBackingStoreDiscardableState):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::shutDown):
(WebKit::WebProcessProxy::isResponsive):
(WebKit::WebProcessProxy::didReceiveBackgroundResponsivenessPing):
(WebKit::WebProcessProxy::processTerminated):
(WebKit::WebProcessProxy::updateBackgroundResponsivenessTimer):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::backgroundResponsivenessPing):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2017-03-13 Carlos Garcia Campos <cgarcia@igalia.com>
Web Automation: automation commands hang when trying to navigate go/back and it's not possible
https://bugs.webkit.org/show_bug.cgi?id=169407
Reviewed by Michael Catanzaro.
Trying to navigate back or forward when there are no back/forward items makes the automation commands to hang, because
navigation callback is never called. WebPageProxy returns nullptr to indicate no navigation will take place. In
that case we can consider that the operation succeeded.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::goBackInBrowsingContext):
(WebKit::WebAutomationSession::goForwardInBrowsingContext):
2017-03-13 Zan Dobersek <zdobersek@igalia.com>
[WK2][CMake] Remove the intermediate NetworkProcess_COMMON_SOURCES variable
https://bugs.webkit.org/show_bug.cgi?id=169524
Reviewed by Michael Catanzaro.
The NetworkProcess-specific source files listed in the
NetworkProcess_COMMON_SOURCES variable definition should be directly
inlined into the list with which the WebKit2_SOURCE variable is defined.
The NetworkProcess_COMMON_SOURCES variable is appended to the
WebKit2_SOURCES variable anyway, and is not used anywhere else. The
separate variable was previously use to support configurations that
allowed disabling NetworkProcess.
* CMakeLists.txt:
2017-03-13 Dean Jackson <dino@apple.com>
WebGPU remote layer hosting
https://bugs.webkit.org/show_bug.cgi?id=169539
<rdar://problem/31005380>
Reviewed by Jon Lee.
Implement the host-side part of WebGPULayer.
* Shared/mac/RemoteLayerBackingStore.mm: Add support for LayerTypeWebGPULayer.
(WebKit::RemoteLayerBackingStore::drawInContext):
* Shared/mac/RemoteLayerTreeTransaction.mm: Ditto.
(WebKit::RemoteLayerTreeTransaction::description):
* UIProcess/ios/RemoteLayerTreeHostIOS.mm: Ditto.
(WebKit::RemoteLayerTreeHost::createLayer):
* UIProcess/mac/RemoteLayerTreeHost.mm: Ditto.
(WebKit::RemoteLayerTreeHost::createLayer):
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: Ditto.
(WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
(WebKit::PlatformCALayerRemoteCustom::clone):
2017-03-13 Zan Dobersek <zdobersek@igalia.com>
Unreviewed GTK+ build fix. Use WTF::Function<> for the
WebPageProxy::getContentsAsMHTMLData() parameter, fixing
configurations that support enabling ENABLE(MHTML).
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getContentsAsMHTMLData):
* UIProcess/WebPageProxy.h:
2017-03-12 Dan Bernstein <mitz@apple.com>
[Cocoa] Incorrect availability annotations in WKUserContentController.h
https://bugs.webkit.org/show_bug.cgi?id=169536
Reviewed by Alexey Proskuryakov.
* UIProcess/API/Cocoa/WKUserContentController.h: Use WK_MAC_TBA for macOS availability.
2017-03-12 Brady Eidson <beidson@apple.com>
Transition GenericCallback from std::function to WTF::Function.
https://bugs.webkit.org/show_bug.cgi?id=169530
Reviewed by Dean Jackson.
* UIProcess/GenericCallback.h:
(WebKit::GenericCallback::create):
(WebKit::GenericCallback::performCallbackWithReturnValue):
(WebKit::GenericCallback::GenericCallback):
(WebKit::CallbackMap::put):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
(WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::getWebArchive):
(WebKit::WebFrameProxy::getMainResourceData):
(WebKit::WebFrameProxy::getResourceData):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getSelectionAsWebArchiveData):
(WebKit::WebPageProxy::getMainResourceDataOfFrame):
(WebKit::WebPageProxy::getResourceDataFromFrame):
(WebKit::WebPageProxy::getWebArchiveOfFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::getStatistics):
* UIProcess/WebProcessPool.h:
2017-03-12 Adrian Perez de Castro <aperez@igalia.com>
[GTK] Unbreak build with GTK+ >=3.20 after r213772
https://bugs.webkit.org/show_bug.cgi?id=169533
Reviewed by Michael Catanzaro.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewRunFileChooser): Add missing cast.
2017-03-12 Adrian Perez de Castro <aperez@igalia.com>
[GTK] File choosers should run as modal by default if possible
https://bugs.webkit.org/show_bug.cgi?id=169526
Reviewed by Michael Catanzaro.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewRunFileChooser): If a top-level window containing the web view is found, call
gtk_native_dialog_set_modal() to configure the dialog accordingly.
2017-03-12 Dan Bernstein <mitz@apple.com>
[iOS] Some more -respondsToSelector: checks are unnecessary
https://bugs.webkit.org/show_bug.cgi?id=169525
Reviewed by Tim Horton.
* Platform/spi/ios/UIKitSPI.h: Moved redeclarations of methods that are declared in the
Apple internal SDK into the #if !USE(APPLE_INTERNAL_SDK) section.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Replaced unnecessary -respondsToSelector:
check with compile-time check for the deployment target.
(-[WKWebView _computedContentInset]): Ditto.
(activeMinimumLayoutSize): Ditto.
(-[WKWebView safeAreaInsetsDidChange]): Ditto.
2017-03-11 Said Abou-Hallawa <sabouhallawa@apple.com>
Enable async image decoding for large images
https://bugs.webkit.org/show_bug.cgi?id=165039
Reviewed by Simon Fraser.
Add WK2 preferences for setting/getting LargeImageAsyncDecoding and
AnimatedImageAsyncDecoding.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetLargeImageAsyncDecodingEnabled):
(WKPreferencesGetLargeImageAsyncDecodingEnabled):
(WKPreferencesSetAnimatedImageAsyncDecodingEnabled):
(WKPreferencesGetAnimatedImageAsyncDecodingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
2017-03-11 Alex Christensen <achristensen@webkit.org>
Rollout r213746
https://bugs.webkit.org/show_bug.cgi?id=169497
That change broke a bunch of tests in storage/indexeddb.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::ensurePrivateBrowsingSession):
* NetworkProcess/RemoteNetworkingContext.h:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: Copied from WebKit2/NetworkProcess/soup/RemoteNetworkingContextSoup.cpp.
* PlatformGTK.cmake:
2017-03-11 Brady Eidson <beidson@apple.com>
Cleanup "addCookie" and its sole user.
https://bugs.webkit.org/show_bug.cgi?id=169486
Reviewed by Brian Burg.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::addCookie): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<Cookie>::encode): Deleted.
(IPC::ArgumentCoder<Cookie>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setCookies):
(WebKit::WebCookieManagerProxy::addCookie): Deleted.
* UIProcess/WebCookieManagerProxy.h:
* WebProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::setCookies):
(WebKit::WebCookieManager::addCookie): Deleted.
* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/Cookies/WebCookieManager.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::addCookie): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2017-03-10 Alex Christensen <achristensen@webkit.org>
Fix watch and tv builds after r213294
https://bugs.webkit.org/show_bug.cgi?id=169508
Reviewed by Dan Bernstein.
* Configurations/FeatureDefines.xcconfig:
2017-03-10 Alex Christensen <achristensen@webkit.org>
Add SPI to set NSURLSessionConfiguration.allowsCellularAccess from _WKProcessPoolConfiguration
https://bugs.webkit.org/show_bug.cgi?id=169500
<rdar://problem/29599569>
Reviewed by Joseph Pecoraro.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::globalAllowsCellularAccess):
(WebKit::NetworkSessionCocoa::setAllowsCellularAccess):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration allowsCellularAccess]):
(-[_WKProcessPoolConfiguration setAllowsCellularAccess:]):
2017-03-10 Alex Christensen <achristensen@webkit.org>
Don't compile RemoteNetworkingContext when using NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=169497
Reviewed by Andy Estes.
RemoteNetworkingContext is only really used because PingHandle requires a NetworkingContext.
When using NetworkSession, we use PingLoad instead of PingHandle, so there's no reason to
ensure there's a RemoteNetworkingContext corresponding to new private sessions when they're never used.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::ensurePrivateBrowsingSession):
* NetworkProcess/RemoteNetworkingContext.h:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: Removed.
* PlatformGTK.cmake:
GTK only uses NetworkSession, so RemoteNetworkingContextSoup is no longer necessary.
2017-03-10 Brent Fulgham <bfulgham@apple.com>
[WebRTC][WK2][iOS] Support com.apple.coremedia.compressionsession for more WebRTC Cases
https://bugs.webkit.org/show_bug.cgi?id=169480
<rdar://problem/30978577>
Reviewed by Youenn Fablet.
Always allow 'com.apple.coremedia.compressionsession' since it is also needed when sending
canvas data across a peer connection.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2017-03-10 Andy Estes <aestes@apple.com>
[QuickLook] Add WKNavigationDelegate SPI to notify when a password is requested
https://bugs.webkit.org/show_bug.cgi?id=169459
<rdar://problem/30621913>
Reviewed by Alex Christensen.
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::didRequestPasswordForQuickLookDocument):
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
2017-03-09 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Layer content blurry with nested perspective and transforms
https://bugs.webkit.org/show_bug.cgi?id=169457
rdar://problem/29879484
Reviewed by Tim Horton.
We set rasterizationScale on CALayers to the same values as contentsScale, to
avoid blurry layers when CA rasterizes, which often happens with nested perspective
transforms.
However, in UI-side compositing, if the page is not zoomed, we never applied the
rasterizationScale in the UI process. This happened because the PlatformCALayerRemote
constructor set m_properties.contentsScale, but did not set the dirty bit that
triggers the application of contentsScale and rasterizationScale in RemoteLayerTreePropertyApplier.
The fix is to set this dirty bit.
The rest of the changes are for testing. Internals now exposes layerIDForElement()
for returns an internal (non-stable-across-loads) layerID, which can be passed
to UIScriptController.propertiesOfLayerWithID() in the UI process, which inspects
the built layer (UIView) hierarchy. propertiesOfLayerWithID() returns a dictionary
which the test can dump as JSON, or pull values out of.
A few #pragma once cleanups also.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _propertiesOfLayerWithID:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::layerWithIDForTesting):
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::layerWithIDForTesting):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
2017-03-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r213618.
https://bugs.webkit.org/show_bug.cgi?id=169475
Suspect this is the cause of a large memory regression
(Requested by jonlee_ on #webkit).
Reverted changeset:
"Enable async image decoding for large images"
https://bugs.webkit.org/show_bug.cgi?id=165039
http://trac.webkit.org/changeset/213618
2017-03-10 Zan Dobersek <zdobersek@igalia.com>
[WK2] Guard GLib-specific typedefs in InjectedBundle.h with USE(GLIB)
https://bugs.webkit.org/show_bug.cgi?id=169464
Reviewed by Carlos Garcia Campos.
* WebProcess/InjectedBundle/InjectedBundle.h: Use the more appropriate
USE(GLIB) guard for the two typedefs revolving around GModule, instead
of the PLATFORM(GTK) guard.
2017-03-09 Tomas Popela <tpopela@redhat.com>
Unreviewed, fix documentation typos
* UIProcess/API/gtk/WebKitAuthenticationRequest.cpp:
* UIProcess/API/gtk/WebKitContextMenuActions.h:
* UIProcess/API/gtk/WebKitContextMenuItem.cpp:
* UIProcess/API/gtk/WebKitDownload.cpp:
(webkitDownloadNotifyProgress):
* UIProcess/API/gtk/WebKitEditorState.cpp:
* UIProcess/API/gtk/WebKitEditorState.h:
* UIProcess/API/gtk/WebKitError.h:
* UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
* UIProcess/API/gtk/WebKitFindController.cpp:
* UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp:
* UIProcess/API/gtk/WebKitHitTestResult.cpp:
* UIProcess/API/gtk/WebKitPolicyDecision.cpp:
* UIProcess/API/gtk/WebKitPrintOperation.h:
* UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
* UIProcess/API/gtk/WebKitSecurityManager.cpp:
* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_class_init):
* UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
(webkitUserMediaPermissionRequestAllow):
* UIProcess/API/gtk/WebKitWebContext.cpp:
* UIProcess/API/gtk/WebKitWebInspector.cpp:
(webkit_web_inspector_class_init):
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_class_init):
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(webkit_web_page_class_init):
2017-03-09 Alex Christensen <achristensen@webkit.org>
Fix CMake build
* PlatformMac.cmake:
2017-03-09 Alex Christensen <achristensen@webkit.org>
Fix GTK build after r213696
* CMakeLists.txt:
* PlatformMac.cmake:
2017-03-09 Brian Nicholson <bnicholson@mozilla.com> and Alex Christensen <achristensen@webkit.org>
Expose public APIs for content filters
https://bugs.webkit.org/show_bug.cgi?id=150479
Reviewed by Brady Eidson and Geoff Garen.
This takes _WKUserContentExtensionStore and _WKUserContentFilter and turns them into the consistently-named public API
WKContentExtensionStore and WKContentExtension respectively with the same design and functionaly of the original SPI.
We also added public functions to WKUserContentController corresponding to existing private functions.
The old SPI ObjC classes are now just wrappers around the new ObjC classes, which are wrappers around C++ objects in the API namespace.
The peak-memory-reducing optimization of having NS_RELEASES_ARGUMENT in _compileContentExtensionForIdentifier is kept for Safari,
but the public API doesn't need such an optimization. The public compileContentExtensionForIdentifier will not deallocate the input
NSString during compiling.
We moved the error codes into the WKErrorDomain, which requires changing the values of the error codes and domain, but source
compiled that uses the SPI before and after should still work. Using new applications with old frameworks or vice versa will
have unexpected error codes, though.
* Shared/API/APIObject.h:
* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKPageGroupAddUserContentFilter):
(WKPageGroupRemoveUserContentFilter):
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* UIProcess/API/APIContentExtension.cpp: Copied from UIProcess/API/APIUserContentExtension.cpp.
(API::ContentExtension::ContentExtension):
(API::ContentExtension::~ContentExtension):
(API::UserContentExtension::UserContentExtension): Deleted.
(API::UserContentExtension::~UserContentExtension): Deleted.
* UIProcess/API/APIContentExtension.h: Copied from UIProcess/API/APIUserContentExtension.h.
* UIProcess/API/APIContentExtensionStore.cpp: Copied from UIProcess/API/APIUserContentExtensionStore.cpp.
(API::ContentExtensionStore::defaultStore):
(API::ContentExtensionStore::storeWithPath):
(API::ContentExtensionStore::ContentExtensionStore):
(API::ContentExtensionStore::~ContentExtensionStore):
(API::compiledToFile):
(API::createExtension):
(API::ContentExtensionStore::lookupContentExtension):
(API::ContentExtensionStore::compileContentExtension):
(API::ContentExtensionStore::removeContentExtension):
(API::ContentExtensionStore::synchronousRemoveAllContentExtensions):
(API::ContentExtensionStore::invalidateContentExtensionVersion):
(API::contentExtensionStoreErrorCategory):
(API::UserContentExtensionStore::defaultStore): Deleted.
(API::UserContentExtensionStore::storeWithPath): Deleted.
(API::UserContentExtensionStore::UserContentExtensionStore): Deleted.
(API::UserContentExtensionStore::~UserContentExtensionStore): Deleted.
(API::UserContentExtensionStore::lookupContentExtension): Deleted.
(API::UserContentExtensionStore::compileContentExtension): Deleted.
(API::UserContentExtensionStore::removeContentExtension): Deleted.
(API::UserContentExtensionStore::synchronousRemoveAllContentExtensions): Deleted.
(API::UserContentExtensionStore::invalidateContentExtensionVersion): Deleted.
(API::userContentExtensionStoreErrorCategory): Deleted.
* UIProcess/API/APIContentExtensionStore.h: Copied from UIProcess/API/APIUserContentExtensionStore.h.
(API::make_error_code):
* UIProcess/API/APIUserContentExtension.cpp: Removed.
* UIProcess/API/APIUserContentExtension.h: Removed.
* UIProcess/API/APIUserContentExtensionStore.cpp: Removed.
* UIProcess/API/APIUserContentExtensionStore.h: Removed.
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKPageGroup.cpp:
* UIProcess/API/C/WKUserContentControllerRef.cpp:
(WKUserContentControllerAddUserContentFilter):
(WKUserContentControllerRemoveAllUserContentFilters):
* UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
(WKUserContentExtensionStoreGetTypeID):
* UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm:
(API::ContentExtensionStore::defaultStorePath):
(API::UserContentExtensionStore::defaultStorePath): Deleted.
* UIProcess/API/Cocoa/WKContentExtension.h: Copied from UIProcess/API/Cocoa/_WKUserContentFilter.h.
* UIProcess/API/Cocoa/WKContentExtension.mm: Copied from UIProcess/API/Cocoa/_WKUserContentFilter.mm.
(-[WKContentExtension dealloc]):
(-[WKContentExtension _apiObject]):
(-[_WKUserContentFilter dealloc]): Deleted.
(-[_WKUserContentFilter _apiObject]): Deleted.
* UIProcess/API/Cocoa/WKContentExtensionInternal.h: Copied from UIProcess/API/Cocoa/_WKUserContentFilterInternal.h.
(WebKit::wrapper):
* UIProcess/API/Cocoa/WKContentExtensionStore.h: Copied from UIProcess/API/Cocoa/_WKUserContentExtensionStore.h.
* UIProcess/API/Cocoa/WKContentExtensionStore.mm: Copied from UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm.
(-[WKContentExtensionStore dealloc]):
(+[WKContentExtensionStore defaultStore]):
(+[WKContentExtensionStore storeWithURL:]):
(-[WKContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
(-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]):
(-[WKContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
(-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
(-[WKContentExtensionStore _apiObject]):
(-[WKContentExtensionStore _removeAllContentExtensions]):
(-[WKContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]):
(-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
(-[_WKUserContentExtensionStore dealloc]): Deleted.
(+[_WKUserContentExtensionStore defaultStore]): Deleted.
(+[_WKUserContentExtensionStore storeWithURL:]): Deleted.
(-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): Deleted.
(-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]): Deleted.
(-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): Deleted.
(-[_WKUserContentExtensionStore _apiObject]): Deleted.
(-[_WKUserContentExtensionStore _removeAllContentExtensions]): Deleted.
(-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]): Deleted.
* UIProcess/API/Cocoa/WKContentExtensionStoreInternal.h: Copied from UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h.
(WebKit::wrapper):
* UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h: Copied from UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h.
* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/WKError.mm:
(localizedDescriptionForErrorCode):
* UIProcess/API/Cocoa/WKUserContentController.h:
* UIProcess/API/Cocoa/WKUserContentController.mm:
(-[WKUserContentController addContentExtension:]):
(-[WKUserContentController removeContentExtension:]):
(-[WKUserContentController removeAllContentExtensions]):
(-[WKUserContentController _addUserContentFilter:]):
(-[WKUserContentController _removeUserContentFilter:]):
(-[WKUserContentController _removeAllUserContentFilters]):
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
(+[_WKUserContentExtensionStore defaultStore]):
(+[_WKUserContentExtensionStore storeWithURL:]):
(-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
(-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
(-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
(-[_WKUserContentExtensionStore _apiObject]):
(-[_WKUserContentExtensionStore _removeAllContentExtensions]):
(-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]):
(-[_WKUserContentExtensionStore _initWithWKContentExtensionStore:]):
(-[_WKUserContentExtensionStore dealloc]): Deleted.
* UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h:
(WebKit::wrapper): Deleted.
* UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
(-[_WKUserContentFilter _apiObject]):
(-[_WKUserContentFilter _initWithWKContentExtension:]):
(-[_WKUserContentFilter dealloc]): Deleted.
* UIProcess/API/Cocoa/_WKUserContentFilterInternal.h:
(WebKit::wrapper): Deleted.
* UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h: Added.
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::addProcess):
(WebKit::WebUserContentControllerProxy::addContentExtension):
(WebKit::WebUserContentControllerProxy::removeContentExtension):
(WebKit::WebUserContentControllerProxy::removeAllContentExtensions):
(WebKit::WebUserContentControllerProxy::addUserContentExtension): Deleted.
(WebKit::WebUserContentControllerProxy::removeUserContentExtension): Deleted.
(WebKit::WebUserContentControllerProxy::removeAllUserContentExtensions): Deleted.
* UIProcess/UserContent/WebUserContentControllerProxy.h:
* UIProcess/WebPageGroup.cpp:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::addContentExtensions):
(WebKit::WebUserContentController::removeContentExtension):
(WebKit::WebUserContentController::removeAllContentExtensions):
(WebKit::WebUserContentController::addUserContentExtensions): Deleted.
(WebKit::WebUserContentController::removeUserContentExtension): Deleted.
(WebKit::WebUserContentController::removeAllUserContentExtensions): Deleted.
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/UserContent/WebUserContentController.messages.in:
* WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
(WebKit::blockedByContentFilterError):
2017-03-09 Brady Eidson <beidson@apple.com>
Fix some debug builds after r213686
Unreviewed.
* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
(WebKit::WebURLSchemeHandlerCocoa::WebURLSchemeHandlerCocoa): Remove the 32-bit NOT_REACHED protection for now.
2017-03-09 Keith Miller <keith_miller@apple.com>
WebAssembly: Enable fast memory for WK2
https://bugs.webkit.org/show_bug.cgi?id=169437
Reviewed by Tim Horton.
I forgot to do this when I enabled implemented fast memory
for wasm.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
2017-03-09 Michael Saboff <msaboff@apple.com>
Add plumbing to WebProcess to enable JavaScriptCore configuration and logging
https://bugs.webkit.org/show_bug.cgi?id=169387
Reviewed by Filip Pizlo.
Added a path and sandbox extension for JavaScript configuration directory.
These are sent to the Web process on startup along with other parameters.
When JavaScript configuration file processing is enabled, the WebProcess
will look for the file WebContent.config in that directory and configure
JavaScriptCore with its contents.
The directory location is for Mac is ~/Library/WebKit/JavaScriptConfig and
the location on iOS is <process-container-path>/Library/WebKit/JavaScriptConfig.
JavaScript configuration file processing is controlled via a boolean kept in
the WebProcess pool. For Debug builds, config file processing is enabled.
For Release builds it is disabled.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
(API::ProcessPoolConfiguration::ProcessPoolConfiguration):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextJavaScriptConfigurationFileEnabled):
(WKContextSetJavaScriptConfigurationFileEnabled):
* UIProcess/API/C/WKContext.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory):
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory):
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::setJavaScriptConfigurationFileEnabled):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
2017-03-09 John Wilander <wilander@apple.com>
Resource Load Statistics: Remove statistics data as part of full website data removal
https://bugs.webkit.org/show_bug.cgi?id=169448
Reviewed by Alex Christensen.
* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStore):
Infrastructure for test.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
Infrastructure for test.
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
Change due to the break-out of
WebResourceLoadStatisticsStore::writeStoreToDisk().
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
Now sets m_writePersistentStoreHandler in
WebCore::ResourceLoadStatisticsStore.
(WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
Separated out this function to make it available for the function set as
m_writePersistentStoreHandler in WebCore::ResourceLoadStatisticsStore.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
Both WebsiteDataStore::removeData() functions now cover resource load
statistics.
2017-03-09 Brady Eidson <beidson@apple.com>
Add WKURLSchemeHandler API for handling custom protocols.
https://bugs.webkit.org/show_bug.cgi?id=169422
Reviewed by Tim Horton.
This introduces two new protocols to the WK2 API surface:
- WKURLSchemeHandler
- WKURLSchemeHandlerTask
By registering an object that conforms to the WKURLSchemeHandler protocol with a WKWebViewConfiguration an application will
be handed an object conforming to WKURLSchemeHandlerTask for each resource load in that WKWebView with a custom URL scheme.
Using that id <WKURLSchemeHandlerTask>, the application can communicate the data for the resource back to WebKit.
* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/APIURLSchemeHandlerTask.cpp:
(API::URLSchemeHandlerTask::create):
(API::URLSchemeHandlerTask::URLSchemeHandlerTask):
* UIProcess/API/APIURLSchemeHandlerTask.h:
Add the WKURLSchemeHandler @protocol:
* UIProcess/API/Cocoa/WKURLSchemeHandler.h: Added.
Add the WKURLSchemeHandlerTask @protocol, as well as WebKit's concrete implementation of it:
* UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h: Added.
* UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm: Added.
(raiseExceptionIfNecessary):
(-[WKURLSchemeHandlerTaskImpl request]):
(-[WKURLSchemeHandlerTaskImpl didReceiveResponse:]):
(-[WKURLSchemeHandlerTaskImpl didReceiveData:]):
(-[WKURLSchemeHandlerTaskImpl didFinish]):
(-[WKURLSchemeHandlerTaskImpl didFailWithError:]):
(-[WKURLSchemeHandlerTaskImpl _apiObject]):
* UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h:
(WebKit::wrapper):
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView urlSchemeHandlerForURLScheme:]):
(+[WKWebView handlesURLScheme:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:]):
(-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]):
(-[WKWebViewConfiguration _urlSchemeHandlers]):
* UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h:
(WebKit::WebURLSchemeHandlerCocoa::apiHandler):
* UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm: Added.
(WebKit::WebURLSchemeHandlerCocoa::create):
(WebKit::WebURLSchemeHandlerCocoa::WebURLSchemeHandlerCocoa):
(WebKit::WebURLSchemeHandlerCocoa::platformStartTask):
(WebKit::WebURLSchemeHandlerCocoa::platformStopTask):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
(WebKit::WebPageProxy::urlSchemeHandlerForScheme):
(WebKit::WebPageProxy::startURLSchemeHandlerTask):
(WebKit::WebPageProxy::stopURLSchemeHandlerTask):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::generateWebURLSchemeHandlerIdentifier):
(WebKit::WebURLSchemeHandler::WebURLSchemeHandler):
(WebKit::WebURLSchemeHandler::~WebURLSchemeHandler):
(WebKit::WebURLSchemeHandler::startTask):
(WebKit::WebURLSchemeHandler::stopTask):
* UIProcess/WebURLSchemeHandler.h:
(WebKit::WebURLSchemeHandler::identifier):
* UIProcess/WebURLSchemeHandlerTask.cpp: Added.
(WebKit::WebURLSchemeHandlerTask::create):
(WebKit::WebURLSchemeHandlerTask::WebURLSchemeHandlerTask):
(WebKit::WebURLSchemeHandlerTask::didReceiveResponse):
(WebKit::WebURLSchemeHandlerTask::didReceiveData):
(WebKit::WebURLSchemeHandlerTask::didComplete):
(WebKit::WebURLSchemeHandlerTask::pageDestroyed):
(WebKit::WebURLSchemeHandlerTask::stop):
* UIProcess/WebURLSchemeHandlerTask.h: Added.
(WebKit::WebURLSchemeHandlerTask::identifier):
(WebKit::WebURLSchemeHandlerTask::request):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::remove):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::urlSchemeHandlerForScheme):
(WebKit::WebPage::registerURLSchemeHandler):
(WebKit::WebPage::urlSchemeHandlerTaskDidReceiveResponse):
(WebKit::WebPage::urlSchemeHandlerTaskDidReceiveData):
(WebKit::WebPage::urlSchemeHandlerTaskDidComplete):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: Added.
(WebKit::WebURLSchemeHandlerProxy::WebURLSchemeHandlerProxy):
(WebKit::WebURLSchemeHandlerProxy::~WebURLSchemeHandlerProxy):
(WebKit::WebURLSchemeHandlerProxy::startNewTask):
(WebKit::WebURLSchemeHandlerProxy::taskDidReceiveResponse):
(WebKit::WebURLSchemeHandlerProxy::taskDidReceiveData):
(WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
* WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
(WebKit::WebURLSchemeHandlerProxy::identifier):
(WebKit::WebURLSchemeHandlerProxy::page):
* WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp: Added.
(WebKit::WebURLSchemeHandlerTaskProxy::WebURLSchemeHandlerTaskProxy):
(WebKit::WebURLSchemeHandlerTaskProxy::startLoading):
(WebKit::WebURLSchemeHandlerTaskProxy::stopLoading):
(WebKit::WebURLSchemeHandlerTaskProxy::didReceiveResponse):
(WebKit::WebURLSchemeHandlerTaskProxy::didReceiveData):
(WebKit::WebURLSchemeHandlerTaskProxy::didComplete):
* WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h:
(WebKit::WebURLSchemeHandlerTaskProxy::request):
* WebKit2.xcodeproj/project.pbxproj:
* CMakeLists.txt:
2017-03-09 Joseph Pecoraro <pecoraro@apple.com>
Unreviewed follow-up to r213682.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
Forward declare SPIs to address possible build errors.
2017-03-09 Andrew Gold <agold@apple.com>
WKWebView should provide a way for clients to know the specific media state.
https://bugs.webkit.org/show_bug.cgi?id=169140
<rdar://problem/30838285>
Reviewed by Alex Christensen.
Instead of notifying the UIDelegate only when a capture begins and ends,
we now notify the UIDelegate of any change in capture state.
* UIProcess/API/APIUIClient.h:
(API::UIClient::mediaCaptureStateDidChange):
(API::UIClient::didBeginCaptureSession): Deleted.
(API::UIClient::didEndCaptureSession): Deleted.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange):
(WebKit::UIDelegate::UIClient::didBeginCaptureSession): Deleted.
(WebKit::UIDelegate::UIClient::didEndCaptureSession): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange):
2017-03-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Show HTTP protocol version and other Network Load Metrics (IP Address, Priority, Connection ID)
https://bugs.webkit.org/show_bug.cgi?id=29687
<rdar://problem/19281586>
Reviewed by Matt Baker and Brian Burg.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(toNetworkLoadPriority):
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
* Shared/WebCoreArgumentCoders.h:
Additional optional metrics on NetworkLoadMetrics.
2017-03-09 Daniel Bates <dabates@apple.com>
Guard Credential Management implementation behind a runtime enabled feature flag
https://bugs.webkit.org/show_bug.cgi?id=169364
<rdar://problem/30957425>
Reviewed by Brent Fulgham.
Add WebKit2 preference for Credential Management (disabled by default).
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetCredentialManagementEnabled): Added.
(WKPreferencesGetCredentialManagementEnabled): Added.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2017-03-09 Andy Estes <aestes@apple.com>
[iOS] Add SPI to print to a single tall PDF page
https://bugs.webkit.org/show_bug.cgi?id=169439
<rdar://problem/30120532>
Reviewed by Tim Horton.
* Shared/PrintInfo.cpp:
(WebKit::PrintInfo::encode): Encoded snapshotFirstPage.
(WebKit::PrintInfo::decode): Decoded snapshotFirstPage.
(WebKit::PrintInfo::PrintInfo): Deleted.
* Shared/PrintInfo.h: Initialized member variables in place instead of in a default ctor.
* UIProcess/_WKWebViewPrintFormatter.h: Declared BOOL property snapshotFirstPage.
* UIProcess/_WKWebViewPrintFormatter.mm:
(-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]): Added to set a custom paper size.
(-[_WKWebViewPrintFormatter rectForPageAtIndex:]): Returned the custom paper rect if
snapshotFirstPage is true.
* UIProcess/_WKWebViewPrintFormatterInternal.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _wk_pageCountForPrintFormatter:]): Computed the custom paper size to be the
smaller of the document height and the maximum PDF page height.
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _wk_pageCountForPrintFormatter:]): Changed to return a maximum page size of 1
if snapshotFirstPage is true.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::computePagesForPrintingAndDrawToPDF): Ditto.
2017-03-09 Anders Carlsson <andersca@apple.com>
Add delegate support to WebCore
https://bugs.webkit.org/show_bug.cgi?id=169427
Part of rdar://problem/28880714.
Reviewed by Geoffrey Garen.
* Configurations/FeatureDefines.xcconfig:
Add feature define.
2017-03-09 Alex Christensen <achristensen@webkit.org>
[Content Extensions] Introduce if-top-url and unless-top-url
https://bugs.webkit.org/show_bug.cgi?id=169433
Reviewed by Brady Eidson.
Rename conditionedFilters to topURLFilters to reflect the fact that they are the filters
that are run on the top URL, and possibly just the domain of the top url.
I was a bit too aggressive when renaming domain* to condition* in r213533.
* Shared/WebCompiledContentExtension.cpp:
(WebKit::WebCompiledContentExtension::conditionsApplyOnlyToDomain):
(WebKit::WebCompiledContentExtension::topURLFiltersBytecode):
(WebKit::WebCompiledContentExtension::topURLFiltersBytecodeLength):
(WebKit::WebCompiledContentExtension::conditionedFiltersBytecode): Deleted.
(WebKit::WebCompiledContentExtension::conditionedFiltersBytecodeLength): Deleted.
* Shared/WebCompiledContentExtension.h:
* Shared/WebCompiledContentExtensionData.cpp:
(WebKit::WebCompiledContentExtensionData::encode):
(WebKit::WebCompiledContentExtensionData::decode):
* Shared/WebCompiledContentExtensionData.h:
(WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
* UIProcess/API/APIUserContentExtensionStore.cpp:
(API::encodeContentExtensionMetaData):
(API::decodeContentExtensionMetaData):
(API::compiledToFile):
(API::createExtension):
(API::UserContentExtensionStore::invalidateContentExtensionVersion):
(API::userContentExtensionStoreErrorCategory):
* UIProcess/API/APIUserContentExtensionStore.h:
Increment CurrentContentExtensionFileVersion because we have changed the format of the binary on disk.
We only added 4 bytes, but that's binary incompatible and requires re-compiling any existing content extensions.
2017-03-09 Brent Fulgham <bfulgham@apple.com>
[WK2][iOS] Extend WebProcess sandbox to support audio and video compression/decompression
https://bugs.webkit.org/show_bug.cgi?id=169431
<rdar://problem/30844650>
Reviewed by Youenn Fablet.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2017-03-09 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Add a UI delegate hook for custom handling of data interaction operations
https://bugs.webkit.org/show_bug.cgi?id=169430
<rdar://problem/30954654>
Reviewed by Tim Horton.
Introduce a new SPI method on the UI delegate for clients who need to override data interaction operation behaviors.
Note that implementing this delegate method and returning YES will not propagate a `drop` event to the page.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2017-03-08 Matt Rajca <mrajca@apple.com>
Let clients control autoplay quirks with website policies.
https://bugs.webkit.org/show_bug.cgi?id=169390
Reviewed by Wenson Hsieh.
Many sites incorrectly assume media will start off playing and display a pause button from the
start. We can trick many of these sites into updating their controls by sending a "pause"
event when we prevent a media element from playing.
We don't want this to become standard web behavior, however, since ultimately sites should adapt
to the new behavior. This patch lets clients decide which limited set of sites gets to use auto-play
quirks.
* Shared/WebsitePolicies.h:
(WebKit::WebsitePolicies::encode):
(WebKit::WebsitePolicies::decode):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesSetAllowsAutoplayQuirks):
(WKWebsitePoliciesGetAllowsAutoplayQuirks):
* UIProcess/API/C/WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setAllowsAutoplayQuirks:]):
(-[_WKWebsitePolicies allowsAutoplayQuirks]):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateWebsitePolicies):
2017-03-09 Chris Dumez <cdumez@apple.com>
[WK2] Prevent app nap for the active tab
https://bugs.webkit.org/show_bug.cgi?id=169417
<rdar://problem/30876965>
Reviewed by Gavin Barraclough.
Prevent app nap for the active tab to minimize the risks of breakage.
From the AppNap documentation [1], the app is only a candidate for app nap if it not the
foreground app. However, in the Safari case, the foreground app is Safari (UIProcess) and
the same policy does not apply to our foreground WebContent process unless we explicitly
make it so. This patch addresses the issue by taking a UserActivity when the tab is
active to prevent app nap.
[1] https://developer.apple.com/library/content/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/AppNap.html
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateThrottleState):
2017-03-08 Anders Carlsson <andersca@apple.com>
Add new delegate methods
https://bugs.webkit.org/show_bug.cgi?id=169394
Part of rdar://problem/28880714.
Reviewed by Tim Horton.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate invalidate]):
(toShippingMethod):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]):
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]):
(WebKit::toPKPaymentAuthorizationStatus):
(WebKit::toPKPaymentErrorCode):
(WebKit::toNSError):
(WebKit::toNSErrors):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
2017-03-09 Tim Horton <timothy_horton@apple.com>
WKWebView should automatically respect insets from the view controller hierarchy
https://bugs.webkit.org/show_bug.cgi?id=169398
<rdar://problem/30617593>
Reviewed by Dean Jackson.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _computedContentInset]):
(activeMinimumLayoutSize):
(-[WKWebView _frameOrBoundsChanged]):
Factor insets from above us in the view controller hierarchy into our
content insets (and layout size) automatically.
2017-03-09 Tomas Popela <tpopela@redhat.com>
Correctly process the return value of gdk_drag_context_get_selected_action()
Reviewed by Carlos Garcia Campos.
It returns the action itself and not the bitmask.
* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::drop):
2017-03-09 Adrian Perez de Castro <aperez@igalia.com>
[GTK] Use GtkFileChooserNative for open/save dialogs
https://bugs.webkit.org/show_bug.cgi?id=169278
Reviewed by Carlos Garcia Campos.
When building with GTK+ 3.20.0 or newer, use GtkFileChooserNative instead of GtkFileChooserDialog to allow for
better integration with the runtime environment and use native open/save dialogs. This also makes WebKitGTK+ use
portal-based load/save dialogs when running inside the Flatpak sandbox.
The existing GtkFileChooserDialog implementation will still be used when building against older versions of
GTK+, so this change does not require a new version of the toolkit.
* UIProcess/API/gtk/WebKitWebView.cpp:
(fileChooserDialogResponseCallback):
(webkitWebViewRunFileChooser):
2017-03-08 Wenson Hsieh <wenson_hsieh@apple.com>
Add plumbing for WebCore to notify WebKit2 when an edit drag has concluded
https://bugs.webkit.org/show_bug.cgi?id=169392
<rdar://problem/30882974>
Reviewed by Tim Horton.
Add boilerplate plumbing for didConcludeEditDataInteraction from the web process to the UI process. Also makes
some minor tweaks to WKContentView along the way.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didConcludeEditDataInteraction):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
Bail out of zooming to the focus rect when performing a data interaction operation. This needs to eventually
work, but is not high priority at the moment.
(-[WKContentView becomeFirstResponderForWebView]):
(-[WKContentView _displayFormNodeInputView]):
(-[WKContentView useSelectionAssistantWithMode:]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView suppressAssistantSelectionView]):
(-[WKContentView setSuppressAssistantSelectionView:]):
Add a mechanism for suppressing the text interaction assistant's selection view. If the text interaction
assistant exists while beginning or ending suppression, the selection will be deactivated or activated. If there
is not text interaction assistant, then we instead remember whether or not we should be suppressing the
selection, and bail out of activating the selection if so.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didConcludeEditDataInteraction):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::didConcludeEditDrag):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didConcludeEditDataInteraction):
2017-03-08 John Wilander <wilander@apple.com>
Resource Load Statistics: Communicate to the network process which domains to partition
https://bugs.webkit.org/show_bug.cgi?id=169322
<rdar://problem/30768921>
Reviewed by Alex Christensen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
Now consults WebCore::NetworkStorageSession::shouldPartitionCookiesForHost()
to decide whether partitioning should be applied or not.
* UIProcess/API/C/WKCookieManager.cpp:
(WKCookieManagerSetCookieStoragePartitioningEnabled):
To allow TestRunner to configure cookie partitioning.
* UIProcess/API/C/WKCookieManager.h:
* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler):
To allow TestRunner to set a domain for which
partitioning should be applied.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setCookieStoragePartitioningEnabled):
To allow TestRunner to configure cookie partitioning.
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
To allow TestRunner to set a domain for which
partitioning should be applied.
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::classifyResource):
Now tells the network process as soon as a domain
has been classified as prevalent.
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
Overloaded function to allow injection of handlers for communication with the
network process.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
(WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
Now sets two callback handlers for communication with the network process.
* UIProcess/WebsiteData/WebsiteDataStore.h:
2017-03-08 Michael Catanzaro <mcatanzaro@igalia.com>
Fix -Wattributes warning spam
https://bugs.webkit.org/show_bug.cgi?id=169243
Reviewed by Alexey Proskuryakov.
* Shared/API/c/WKDeclarationSpecifiers.h: Add WK_UNAVAILABLE macro.
* UIProcess/API/C/WKPageGroup.h: Use it.
2017-03-08 Said Abou-Hallawa <sabouhallawa@apple.com>
Enable async image decoding for large images
https://bugs.webkit.org/show_bug.cgi?id=165039
Reviewed by Simon Fraser.
Add WK2 preferences for setting/getting LargeImageAsyncDecoding and
AnimatedImageAsyncDecoding.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetLargeImageAsyncDecodingEnabled):
(WKPreferencesGetLargeImageAsyncDecodingEnabled):
(WKPreferencesSetAnimatedImageAsyncDecodingEnabled):
(WKPreferencesGetAnimatedImageAsyncDecodingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
2017-03-08 Wenson Hsieh <wenson_hsieh@apple.com>
Add TextIndicator support for providing a snapshot excluding selected content
https://bugs.webkit.org/show_bug.cgi?id=169309
<rdar://problem/30883525>
Reviewed by Tim Horton.
Serialize the snapshot excluding the selection and the snapshot's bounds when sending TextIndicatorData over
IPC to the UI process.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<TextIndicatorData>::encode):
(IPC::ArgumentCoder<TextIndicatorData>::decode):
2017-03-08 Brent Fulgham <bfulgham@apple.com>
REGRESSION(r213564): Netflix does not play content
https://bugs.webkit.org/show_bug.cgi?id=169391
<rdar://problem/30930190>
Reviewed by Alex Christensen.
Add the missing IOKit properties identified during testing on Netflix.
* WebProcess/com.apple.WebProcess.sb.in:
2017-03-08 Anders Carlsson <andersca@apple.com>
Clean up WebPaymentCoordinatorProxy
https://bugs.webkit.org/show_bug.cgi?id=169393
Part of rdar://problem/28880714.
Reviewed by Beth Dakin.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
Move this to where it belongs.
(WebKit::toPKPaymentSummaryItems):
Add a new helper function.
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
Use the new helper function.
2017-03-08 Brent Fulgham <bfulgham@apple.com>
[Mac][WK2] Whitelist a local cache needed by CFNetwork
https://bugs.webkit.org/show_bug.cgi?id=169388
<rdar://problem/30224000>
Reviewed by Alex Christensen.
Whitelist access to a local cache needed by CFNetwork.
* WebProcess/com.apple.WebProcess.sb.in:
2017-03-08 Anders Carlsson <andersca@apple.com>
Simplify the PaymentCoordinator interface
https://bugs.webkit.org/show_bug.cgi?id=169382
Part of rdar://problem/28880714.
Reviewed by Tim Horton.
Send the new structs over the wire to the UI process and update the various proxy object to take them instead of
multiple parameters.
* Scripts/webkit/messages.py:
(headers_for_type):
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::encode):
(IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode):
(IPC::ArgumentCoder<WebCore::PaymentError>::encode):
(IPC::ArgumentCoder<WebCore::PaymentError>::decode):
(IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode):
(IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
(IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::encode):
(IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
(IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::encode):
(IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
(WebKit::isValidEnum): Deleted.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinator::completeShippingContactSelection):
(WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
(WebKit::WebPaymentCoordinator::completePaymentSession):
* WebProcess/ApplePay/WebPaymentCoordinator.h:
2017-03-08 Brent Fulgham <bfulgham@apple.com>
Remove the trace command from the sandbox profile.
* WebProcess/com.apple.WebProcess.sb.in: Unreviewed.
2017-03-08 Brent Fulgham <bfulgham@apple.com>
REGRESSION(r212904): [WK2][Mac] Revise sandbox to support AES3
https://bugs.webkit.org/show_bug.cgi?id=169361
<rdar://problem/30927476>
Unreviewed sandbox revert. Avoid web compatibility issue by
restoring access to AES3 Plugin path.
Tests: Existing media tests, on older Mac hardware.
* WebProcess/com.apple.WebProcess.sb.in:
2017-03-08 Simon Fraser <simon.fraser@apple.com>
Add support for history.scrollRestoration
https://bugs.webkit.org/show_bug.cgi?id=147782
rdar://problem/22614568
Reviewed by Sam Weinig.
Need to send shouldRestoreScrollPosition to the UI process in SessionState,
WKWebView now stores _unobscuredCenterToRestore and _scrollOffsetToRestore as
std::optionals, and they will be nullopt if scroll restoration should not happen.
ViewGestureControllerIOS also needs knowledge of whether scroll restoration will
happen, and compares UI-process scroll position vs. the position at snapshot time
to know if the snapshot should be shown (this prevents showing a misleading snapshot
when swiping back on a navigation where scroll restoration is disabled).
* Shared/SessionState.cpp:
(WebKit::FrameState::encode):
(WebKit::FrameState::decode):
* Shared/SessionState.h:
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::pageState):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processDidExit]):
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::viewScrollPosition):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::viewScrollPosition):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::viewScrollPosition):
(WebKit::PageClientImpl::restorePageState):
(WebKit::PageClientImpl::restorePageCenterAndScale):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::restorePageState):
(WebKit::WebPageProxy::restorePageCenterAndScale):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::viewScrollPosition):
* UIProcess/mac/ViewSnapshotStore.h:
(WebKit::ViewSnapshot::setViewScrollPosition):
(WebKit::ViewSnapshot::viewScrollPosition):
* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshotStore::recordSnapshot):
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFrameState):
(WebKit::applyFrameState):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::restoreViewState):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::restorePageState):
2017-03-08 Matt Rajca <mrajca@apple.com>
Add support for updating autoplay policies after a page has been loaded.
https://bugs.webkit.org/show_bug.cgi?id=169360
Reviewed by Alex Christensen.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateWebsitePolicies):
2017-03-08 Tim Horton <timothy_horton@apple.com>
Switching focus from a UITextField to an editable WKWebView causes the keyboard to dance
https://bugs.webkit.org/show_bug.cgi?id=168932
<rdar://problem/30193996>
Reviewed by Beth Dakin.
When WKWebView first becomes first responder from a tap, we don't have
enough information to immediately respond accurately to various questions
from UIKit, because we haven't had time to ask the Web Content process
what is under the touch. Defer updating input views until we get a
response or lose first responder status, so that the keyboard doesn't
start transitioning to its new state until we know what that is.
There is currently no test because TestWebKitAPI has no UIApplication,
and thus cannot generate mock events.
* Platform/spi/ios/UIKitSPI.h:
* WebKit2.xcodeproj/project.pbxproj:
* UIProcess/ios/InputViewUpdateDeferrer.h: Added.
* UIProcess/ios/InputViewUpdateDeferrer.mm: Added.
Add an RAII object that defers input view updates while alive.
* UIProcess/ios/WKContentView.mm:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView _commitPotentialTapFailed]):
(-[WKContentView _didNotHandleTapAsClick:]):
(-[WKContentView _didCompleteSyntheticClick]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
Create a InputViewUpdateDeferrer just before we become first responder
from a tap, and destroy it when we get a response (of any kind) or lose
first-responder status (or interaction is torn down).
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didCompleteSyntheticClick):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCompleteSyntheticClick):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completeSyntheticClick):
Plumb an indication that the synthetic click completed, regardless of
how it was handled.
2017-03-08 Zan Dobersek <zdobersek@igalia.com>
[WK2] Guard GLib-specific code in Module, Connection files with USE(GLIB)
https://bugs.webkit.org/show_bug.cgi?id=169349
Reviewed by Carlos Garcia Campos.
Use the USE(GLIB) build guards for GLib-specific code in Connection and
Module header files and the ConnectionUnix implementation file, instead
of the PLATFORM(GTK) guard.
* Platform/IPC/Connection.h:
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::platformInitialize):
(IPC::Connection::platformInvalidate):
(IPC::Connection::open):
(IPC::Connection::sendOutputMessage):
* Platform/Module.h:
2017-03-08 Tim Horton <timothy_horton@apple.com>
Remove unused WebPageIOS::zoomToRect and plumbing
https://bugs.webkit.org/show_bug.cgi?id=169344
Reviewed by Alex Christensen.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::zoomToRect): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::zoomToRect): Deleted.
2017-03-08 Brad Wright <bwright2@apple.com>
UIViewController with WKWebView presented modally causes the presented UIViewController to be dismissed.
https://bugs.webkit.org/show_bug.cgi?id=165225
Reviewed by Wenson Hsieh.
The problem happens on an iPhone with a WKWebView inside a view controller presented modally. If the user selects an HTML file input
tag button, a UIDocumentMenuViewController will appear. Anything the user does next causes the entire modal view controller to get dismissed.
To fix this problem, I prevent the UIDocumentMenuViewController from being dismissed by not saving a pointer to it. The UIDocumentMenuViewController
always goes away by itself on any user interaction. Trying to dismiss the UIDocumentMenuViewController when it is already dismissed causes the modal view controller
to be dismissed.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _cancel]):
(-[WKFileUploadPanel dismiss]):
(-[WKFileUploadPanel _showDocumentPickerMenu]):
(-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
(-[WKFileUploadPanel _presentForCurrentInterfaceIdiom:]): Deleted.
2017-03-08 Alexey Proskuryakov <ap@apple.com>
WebKit should not export dyld install name hints on watchOS and tvOS
https://bugs.webkit.org/show_bug.cgi?id=169342
Reviewed by Dan Bernstein.
* Shared/API/Cocoa/WebKit.m:
2017-03-07 Simon Fraser <simon.fraser@apple.com>
Have fixedPositionCreatesStackingContext be on by default everywhere
https://bugs.webkit.org/show_bug.cgi?id=169334
Reviewed by Zalan Bujtas.
It makes no sense to have web-exposed CSS functionality be different based on setting,
and other browser are now aligned with having position:fixed create stacking context.
So remove the fixedPositionCreatesStackingContext setting and have StyleResolver::adjustRenderStyle()
always force stacking context for position:fixed.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setUseFixedLayout):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
2017-03-07 Brent Fulgham <bfulgham@apple.com>
[Mac][WK2] Whitelist iokit-get-properties
https://bugs.webkit.org/show_bug.cgi?id=169331
<rdar://problem/16363632>
Reviewed by Alex Christensen.
Block access to all IOKit properties by default. Turn on only those properties
that are actually needed by our engine.
* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2017-03-07 Simon Fraser <simon.fraser@apple.com>
Enable SubpixelAntialiasedLayerTextEnabled by default on some versions of macOS
https://bugs.webkit.org/show_bug.cgi?id=169329
Reviewed by Tim Horton.
If the macOS version is > 101300, enable subpixelAntialiasedLayerTextEnabled.
* Shared/WebPreferencesDefinitions.h:
2017-03-07 Dean Jackson <dino@apple.com>
Some platforms won't be able to create a GPUDevice
https://bugs.webkit.org/show_bug.cgi?id=169314
<rdar://problems/30907521>
Reviewed by Jon Lee.
Disable WEB_GPU on the iOS Simulator.
* Configurations/FeatureDefines.xcconfig:
2017-03-07 Brent Fulgham <bfulgham@apple.com>
[Mac][iOS][WK2] Whitelist sysctl-read
https://bugs.webkit.org/show_bug.cgi?id=169306
<rdar://problem/16371458>
Reviewed by Alex Christensen.
Limit access to the 'sysctl' call to read-only cases of the very small
set of operations we actually use.
* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:
2017-03-07 Alex Christensen <achristensen@webkit.org>
[Content Extensions] Rename "Domain" to "Condition" where appropriate
https://bugs.webkit.org/show_bug.cgi?id=169297
Reviewed by Brady Eidson.
* Shared/WebCompiledContentExtension.cpp:
(WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecode):
(WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecodeLength):
(WebKit::WebCompiledContentExtension::filtersWithConditionsBytecode):
(WebKit::WebCompiledContentExtension::filtersWithConditionsBytecodeLength):
(WebKit::WebCompiledContentExtension::conditionedFiltersBytecode):
(WebKit::WebCompiledContentExtension::conditionedFiltersBytecodeLength):
(WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecode): Deleted.
(WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecodeLength): Deleted.
(WebKit::WebCompiledContentExtension::filtersWithDomainsBytecode): Deleted.
(WebKit::WebCompiledContentExtension::filtersWithDomainsBytecodeLength): Deleted.
(WebKit::WebCompiledContentExtension::domainFiltersBytecode): Deleted.
(WebKit::WebCompiledContentExtension::domainFiltersBytecodeLength): Deleted.
* Shared/WebCompiledContentExtension.h:
* Shared/WebCompiledContentExtensionData.cpp:
(WebKit::WebCompiledContentExtensionData::encode):
(WebKit::WebCompiledContentExtensionData::decode):
* Shared/WebCompiledContentExtensionData.h:
(WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
* UIProcess/API/APIUserContentExtensionStore.cpp:
(API::ContentExtensionMetaData::fileSize):
(API::encodeContentExtensionMetaData):
(API::decodeContentExtensionMetaData):
(API::compiledToFile):
(API::createExtension):
(API::UserContentExtensionStore::lookupContentExtension):
(API::UserContentExtensionStore::compileContentExtension):
(API::UserContentExtensionStore::removeContentExtension):
* UIProcess/API/APIUserContentExtensionStore.h:
2017-03-07 Brent Fulgham <bfulgham@apple.com>
[Mac][WK2] Expand sandbox to support access to audio component registrar
https://bugs.webkit.org/show_bug.cgi?id=169283
<rdar://problem/30793512>
Reviewed by Alexey Proskuryakov.
* WebProcess/com.apple.WebProcess.sb.in:
2017-03-07 Chris Dumez <cdumez@apple.com>
Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
https://bugs.webkit.org/show_bug.cgi?id=169236
Reviewed by Simon Fraser.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::updateHiddenPageThrottlingAutoIncreaseLimit):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::setHiddenPageDOMTimerThrottlingIncreaseLimit):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2017-03-06 Aakash Jain <aakash_jain@apple.com>
Enable SUPPORTS_TEXT_BASED_API in WebKit2 for iOS
https://bugs.webkit.org/show_bug.cgi?id=169233
Reviewed by Alexey Proskuryakov.
* Configurations/Base.xcconfig: Enable SUPPORTS_TEXT_BASED_API.
* Configurations/WebKit.xcconfig: Pass information to TAPI about reexporting WebKitLegacy and few extra headers.
* WebKit2.xcodeproj/project.pbxproj: Run scripts which are run for installhdrs phase for installapi phase as well.
2017-03-06 Dan Bernstein <mitz@apple.com>
[Cocoa] Expose API::InjectedBundle::EditorClient::didChange via the Objective-C bundle SPI
https://bugs.webkit.org/show_bug.cgi?id=169223
Reviewed by Tim Horton.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Declared new
delegate method -_webProcessPlugInBrowserContextControllerDidChangeByEditing:.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Added an override
of API::InjectedBundle::EditorClient::didChange that calls the new delegate method.
2017-03-06 Michael Saboff <msaboff@apple.com>
Unreviewed build fix after r213492.
* Configurations/Base.xcconfig:
2017-03-06 Aakash Jain <aakash_jain@apple.com>
Add WK_CLASS_AVAILABLE to _WKLinkIconParameters and _WKWebViewPrintFormatter
https://bugs.webkit.org/show_bug.cgi?id=169225
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/_WKLinkIconParameters.h:
* UIProcess/_WKWebViewPrintFormatter.h:
2017-03-06 Michael Saboff <msaboff@apple.com>
Unreviewed build fix after r213483.
* Configurations/Base.xcconfig:
2017-03-06 Brent Fulgham <bfulgham@apple.com>
[Mac][WK2] Support new CoreMedia routing features
https://bugs.webkit.org/show_bug.cgi?id=169241
<rdar://problem/30077969>
Reviewed by Alexey Proskuryakov.
* WebProcess/com.apple.WebProcess.sb.in:
2017-03-06 Michael Saboff <msaboff@apple.com>
Take advantage of fast permissions switching of JIT memory for devices that support it
https://bugs.webkit.org/show_bug.cgi?id=169155
Reviewed by Saam Barati.
Updated the Xcode config files to match what is in the JavaScriptCore ones.
* Configurations/FeatureDefines.xcconfig:
2017-03-06 Aakash Jain <aakash_jain@apple.com>
Make WKMenuItemIdentifiersPrivate.h private header
https://bugs.webkit.org/show_bug.cgi?id=168981
Reviewed by Tim Horton.
* WebKit2.xcodeproj/project.pbxproj: Made WKMenuItemIdentifiersPrivate.h private.
2017-03-06 Alexey Proskuryakov <ap@apple.com>
Replace -sub_umbrella linker flag with a build setting
https://bugs.webkit.org/show_bug.cgi?id=169146
Reviewed by Tim Horton.
* Configurations/WebKit.xcconfig:
2017-03-03 Matt Rajca <mrajca@apple.com>
Media: notify clients when the user never plays a media element that was prevented from auto-playing
https://bugs.webkit.org/show_bug.cgi?id=169150
Reviewed by Alex Christensen.
* UIProcess/API/C/WKPageUIClient.h:
2017-03-06 Myles C. Maxfield <mmaxfield@apple.com>
Expand font-weight and font-stretch to take any number
https://bugs.webkit.org/show_bug.cgi?id=168889
Reviewed by Simon Fraser.
Migrate off old enum types.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState):
2017-03-06 Andreas Kling <akling@apple.com>
[iOS] Report domains crashing under memory pressure via enhanced privacy logging.
<https://webkit.org/b/169133>
<rdar://problem/29964017>
Reviewed by Antti Koivisto.
Notify the UI process when the memory pressure status changes.
If a web process crashes while under memory pressure, log the domain of the last open page
using enhanced privacy logging.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidCrash):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::memoryPressureStatusChanged):
(WebKit::WebProcessProxy::isUnderMemoryPressure):
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
2017-03-05 Brady Eidson <beidson@apple.com>
Remove new files accidentally added in r213441
Unreviewed.
* UIProcess/WebLoadingProviderProxy.cpp: Removed.
* UIProcess/WebLoadingProviderProxy.h: Removed.
* UIProcess/WebLoadingProviderProxy.messages.in: Removed.
2017-03-05 Brady Eidson <beidson@apple.com>
Rename CustomProtocolFoo to LegacyCustomProtocolFoo.
https://bugs.webkit.org/show_bug.cgi?id=169188
Reviewed by Andy Estes.
* CMakeLists.txt:
* DerivedSources.make:
* NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm.
(+[WKCustomProtocol canInitWithRequest:]):
(+[WKCustomProtocol canonicalRequestForRequest:]):
(+[WKCustomProtocol requestIsCacheEquivalent:toRequest:]):
(-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
(-[WKCustomProtocol initializationRunLoop]):
(-[WKCustomProtocol startLoading]):
(-[WKCustomProtocol stopLoading]):
(WebKit::LegacyCustomProtocolManager::registerProtocolClass):
(WebKit::LegacyCustomProtocolManager::registerScheme):
(WebKit::LegacyCustomProtocolManager::unregisterScheme):
(WebKit::LegacyCustomProtocolManager::supportsScheme):
(WebKit::dispatchOnInitializationRunLoop):
(WebKit::LegacyCustomProtocolManager::didFailWithError):
(WebKit::LegacyCustomProtocolManager::didLoadData):
(WebKit::LegacyCustomProtocolManager::didReceiveResponse):
(WebKit::LegacyCustomProtocolManager::didFinishLoading):
(WebKit::LegacyCustomProtocolManager::wasRedirectedToRequest):
(WebKit::LegacyCustomProtocolManager::protocolForID):
* NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.cpp.
(WebKit::generateCustomProtocolID):
(WebKit::LegacyCustomProtocolManager::supplementName):
(WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
(WebKit::LegacyCustomProtocolManager::initialize):
(WebKit::LegacyCustomProtocolManager::addCustomProtocol):
(WebKit::LegacyCustomProtocolManager::removeCustomProtocol):
(WebKit::LegacyCustomProtocolManager::startLoading):
(WebKit::LegacyCustomProtocolManager::stopLoading):
* NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.h.
* NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.messages.in: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.messages.in.
* NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp.
(WebKit::CustomProtocolManager::WebSoupRequestAsyncData::WebSoupRequestAsyncData):
(WebKit::CustomProtocolManager::WebSoupRequestAsyncData::~WebSoupRequestAsyncData):
(WebKit::CustomProtocolManager::registerProtocolClass):
(WebKit::CustomProtocolManager::registerScheme):
(WebKit::CustomProtocolManager::unregisterScheme):
(WebKit::CustomProtocolManager::supportsScheme):
(WebKit::CustomProtocolManager::didFailWithError):
(WebKit::CustomProtocolManager::didLoadData):
(WebKit::CustomProtocolManager::didReceiveResponse):
(WebKit::CustomProtocolManager::didFinishLoading):
(WebKit::CustomProtocolManager::wasRedirectedToRequest):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::create):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::globalLegacyCustomProtocolManager):
(WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager):
(WebKit::NetworkSessionCocoa::create):
(WebKit::NetworkSessionCocoa::defaultSession):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
(WebKit::globalCustomProtocolManager): Deleted.
(WebKit::NetworkSessionCocoa::setCustomProtocolManager): Deleted.
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* UIProcess/API/APICustomProtocolManagerClient.h:
(API::LegacyCustomProtocolManagerClient::~LegacyCustomProtocolManagerClient):
(API::LegacyCustomProtocolManagerClient::startLoading):
(API::LegacyCustomProtocolManagerClient::stopLoading):
(API::LegacyCustomProtocolManagerClient::invalidate):
(API::CustomProtocolManagerClient::~CustomProtocolManagerClient): Deleted.
(API::CustomProtocolManagerClient::startLoading): Deleted.
(API::CustomProtocolManagerClient::stopLoading): Deleted.
(API::CustomProtocolManagerClient::invalidate): Deleted.
* UIProcess/Cocoa/LegacyCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/Cocoa/CustomProtocolManagerClient.h.
* UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm: Renamed from Source/WebKit2/UIProcess/Cocoa/CustomProtocolManagerClient.mm.
(-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
(-[WKCustomProtocolLoader dealloc]):
(-[WKCustomProtocolLoader customProtocolManagerProxyDestroyed]):
(-[WKCustomProtocolLoader connection:didFailWithError:]):
(-[WKCustomProtocolLoader connection:willCacheResponse:]):
(-[WKCustomProtocolLoader connection:didReceiveResponse:]):
(-[WKCustomProtocolLoader connection:didReceiveData:]):
(-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
(-[WKCustomProtocolLoader connectionDidFinishLoading:]):
(WebKit::LegacyCustomProtocolManagerClient::startLoading):
(WebKit::LegacyCustomProtocolManagerClient::stopLoading):
(WebKit::LegacyCustomProtocolManagerClient::invalidate):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize):
* UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Removed.
* UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp: Added.
(WebKit::LegacyCustomProtocolManagerProxy::LegacyCustomProtocolManagerProxy):
(WebKit::LegacyCustomProtocolManagerProxy::~LegacyCustomProtocolManagerProxy):
(WebKit::LegacyCustomProtocolManagerProxy::startLoading):
(WebKit::LegacyCustomProtocolManagerProxy::stopLoading):
(WebKit::LegacyCustomProtocolManagerProxy::processDidClose):
(WebKit::LegacyCustomProtocolManagerProxy::wasRedirectedToRequest):
(WebKit::LegacyCustomProtocolManagerProxy::didReceiveResponse):
(WebKit::LegacyCustomProtocolManagerProxy::didLoadData):
(WebKit::LegacyCustomProtocolManagerProxy::didFailWithError):
(WebKit::LegacyCustomProtocolManagerProxy::didFinishLoading):
* UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h: Renamed from Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h.
* UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.messages.in: Renamed from Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.messages.in.
* UIProcess/Network/NetworkProcessProxy.cpp:
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
(WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
(WebKit::WebProcessPool::registerSchemeForCustomProtocol):
(WebKit::WebProcessPool::unregisterSchemeForCustomProtocol):
(WebKit::WebProcessPool::setCustomProtocolManagerClient): Deleted.
* UIProcess/WebProcessPool.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/cocoa/WebProcessCocoa.mm:
2017-03-04 Eric Carlson <eric.carlson@apple.com>
[iOS] The web process should inherit application state from UI process
https://bugs.webkit.org/show_bug.cgi?id=169156
<rdar://problem/30845473>
Reviewed by Alexey Proskuryakov.
* Platform/spi/ios/CelestialSPI.h: Added.
* WebKit2.xcodeproj/project.pbxproj: Include CelestialSPI.h.
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Add entitlement.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformInitialize): Set up PID proxying.
2017-03-04 Aakash Jain <aakash_jain@apple.com>
Add symbols required by TAPI from Shared/API/Cocoa/WebKit.m in a header file
https://bugs.webkit.org/show_bug.cgi?id=169162
Reviewed by Alexey Proskuryakov.
The symbols from binary and headers should match precisely, otherwise TAPI would
complain. There are few symbols which are not actually needed in header file, but
we still need to add them in a header file to make TAPI happy.
* Platform/ExtraPublicSymbolsForTAPI.h: Added.
* WebKit2.xcodeproj/project.pbxproj: Added ExtraPublicSymbolsForTAPI.h
2017-03-04 Aakash Jain <aakash_jain@apple.com>
Add symbols required by TAPI in a header file
https://bugs.webkit.org/show_bug.cgi?id=169113
<rdar://problem/30772033>
Reviewed by Alexey Proskuryakov.
The symbols from binary and headers should match precisely, otherwise TAPI would
complain. There are few symbols which are not actually needed in header file, but
we still need to add them in a header file to make TAPI happy.
* Platform/ExtraPrivateSymbolsForTAPI.h: Added.
* WebKit2.xcodeproj/project.pbxproj: Added Platform/ExtraPrivateSymbolsForTAPI.h
2017-03-04 Joseph Pecoraro <pecoraro@apple.com>
Remove duplicate initialization guard in WebKit2 logging initialization
https://bugs.webkit.org/show_bug.cgi?id=169164
Reviewed by Dan Bernstein.
* Platform/Logging.cpp:
(WebKit::initializeLogChannelsIfNecessary):
2017-03-03 Youenn Fablet <youenn@apple.com>
[WebRTC] Update libwebrtc source code
https://bugs.webkit.org/show_bug.cgi?id=168599
Reviewed by Alex Christensen.
* WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
2017-03-03 Dean Jackson <dino@apple.com>
Add WebGPU compile flag and experimental feature flag
https://bugs.webkit.org/show_bug.cgi?id=169161
<rdar://problem/30846689>
Reviewed by Tim Horton.
Add ENABLE_WEBGPU, an experimental feature flag, a RuntimeEnabledFeature,
and an InternalSetting.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2017-03-03 Dean Jackson <dino@apple.com>
Move Input Events and Gamepad from experimental features into main preferences
https://bugs.webkit.org/show_bug.cgi?id=169157
<rdar://problems/30845587>
Reviewed by Myles C. Maxfield.
These are no longer experimental on trunk.
* Shared/WebPreferencesDefinitions.h:
2017-03-03 Brent Fulgham <bfulgham@apple.com>
[MediaStream iOS] REGRESSION(r212883): Missing function definition breaks sandbox
https://bugs.webkit.org/show_bug.cgi?id=169148
<rdar://problem/30825728>
Reviewed by Alex Christensen.
The changes in r212883 added a call to 'shared-preferences-read', which is not defined
for iOS. In fact, it's not needed since 'user-preference-read' does everything we need on iOS.
Switch to the correct preference rule.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add missing function
2017-03-03 Aakash Jain <aakash_jain@apple.com>
Move declaration of _WKSetCrashReportApplicationSpecificInformation to header file
https://bugs.webkit.org/show_bug.cgi?id=169043
Reviewed by Alex Christensen.
* WebKit2.xcodeproj/project.pbxproj: Added WebProcessCocoa.h
* WebProcess/cocoa/WebProcessCocoa.h: Added.
* WebProcess/cocoa/WebProcessCocoa.mm: Imported WebProcessCocoa.h
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: Ditto.
2017-03-03 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Ensure WebKitWebView always have a user content manager
https://bugs.webkit.org/show_bug.cgi?id=169130
Reviewed by Michael Catanzaro.
User content manager is a construct only property, so if not set by the user the web view doesn't have any. We
can create a default one, like we do for settings, when user didn't provide one.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewConstructed):
2017-03-02 Sam Weinig <sam@webkit.org>
Rename htmlediting.h/cpp to Editing.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=169103
Reviewed by Alex Christensen.
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/ios/WebPageIOS.mm:
* WebProcess/WebPage/mac/WebPageMac.mm:
2017-03-02 Joseph Pecoraro <pecoraro@apple.com>
[Mac] Set the NSURLSessionTask priority to match the request's priority
https://bugs.webkit.org/show_bug.cgi?id=169115
<rdar://problem/28881392>
Reviewed by Alex Christensen.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::toNSURLSessionTaskPriority):
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
Set the priority on the task based on the ResourceRequest's priority.
This is used for HTTP/2 request prioritization.
2017-03-02 Mark Lam <mark.lam@apple.com>
Add WebKit2 hooks to notify the VM that the user has requested a debugger break.
https://bugs.webkit.org/show_bug.cgi?id=169089
Reviewed by Tim Horton and Joseph Pecoraro.
* CMakeLists.txt:
* DerivedSources.make:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::connect):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp: Added.
(WebKit::WebInspectorInterruptDispatcher::create):
(WebKit::WebInspectorInterruptDispatcher::WebInspectorInterruptDispatcher):
(WebKit::WebInspectorInterruptDispatcher::~WebInspectorInterruptDispatcher):
(WebKit::WebInspectorInterruptDispatcher::initializeConnection):
(WebKit::WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak):
* WebProcess/WebPage/WebInspectorInterruptDispatcher.h: Added.
* WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in: Added.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeConnection):
* WebProcess/WebProcess.h:
2017-03-02 Brady Eidson <beidson@apple.com>
Update WKWebsiteDatastoreConfiguration SPI.
https://bugs.webkit.org/show_bug.cgi?id=169102
Reviewed by Tim Horton.
Make these strings URLs, and throw exceptions if you try to use non-file URLs.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(checkURLArgument):
(-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
2017-03-02 Youenn Fablet <youenn@apple.com>
Move part of NetworkRTCProvider::close implementation in NetworkRTCProvider destructor
https://bugs.webkit.org/show_bug.cgi?id=169104
Reviewed by Alex Christensen.
Improving NetworkRTCProvider clean-up by moving some member field cleaning to the destructor.
The remaining cleaning is still kept in NetworkRTCProvider::close as we need to go to the rtc network thread and
for that, we take a ref of NetworkRTCProvider.
Stopping any resolver before freeing them.
* NetworkProcess/webrtc/NetworkRTCMonitor.h:
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::~NetworkRTCProvider):
(WebKit::NetworkRTCProvider::close):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
2017-03-02 Youenn Fablet <youenn@apple.com>
[iOS] Replicate NetworkProcess Mac sandboxing in iOS to allow TCP/UDP
https://bugs.webkit.org/show_bug.cgi?id=169105
Reviewed by Alex Christensen.
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Adding sandbox extension support for TCP/UDP networking.
2017-03-02 Aakash Jain <aakash_jain@apple.com>
Move stringMatchesWildcardString from WebKit2 to WebCore
https://bugs.webkit.org/show_bug.cgi?id=169065
Reviewed by Alexey Proskuryakov.
* Platform/mac/StringUtilities.h: Moved stringMatchesWildcardString to WebCore.
* WebKit2.xcodeproj/project.pbxproj: Make StringUtilities.h a project header.
* Platform/mac/StringUtilities.mm:
(WebKit::wildcardRegexPatternString): Moved to WebCore.
(WebKit::stringMatchesWildcardString): Ditto.
* WebProcess/Plugins/WebPluginInfoProvider.cpp: Using stringMatchesWildcardString from WebCore.
2017-03-02 Aakash Jain <aakash_jain@apple.com>
IsSmartPtr<WKRetainPtr<T>>::value should not be exported
https://bugs.webkit.org/show_bug.cgi?id=169047
Reviewed by Alexey Proskuryakov.
* UIProcess/API/cpp/WKRetainPtr.h:
2017-03-02 Youenn Fablet <youenn@apple.com>
Activate some new webrtc tests
https://bugs.webkit.org/show_bug.cgi?id=168850
Reviewed by Alex Christensen.
* Shared/WebPreferencesDefinitions.h: Activating peer connection by default when libwebrtc is on.
This allows ensuring the network process will have its sandbox extension.
2017-03-02 Brian Burg <bburg@apple.com>
Web Automation: _WKAutomationSessionDelegate should work with WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=169091
<rdar://problem/30810538>
Reviewed by Tim Horton.
As a first step towards fixing the mistake of using WKPageRef in an Objective-C SPI,
add the correct delegate methods that take WKWebView so that Objective-C clients can
use this functionality.
In a future patch, we'll remove the WKPageRef delegate methods when they are no longer
being used by clients. Clients should switch to using WKWebView, or wait for a C SPI
with equivalent functionality (something like WKAutomationSessionClient) to be ported.
While I'm fixing this mess, make API::AutomationSessionClient use references instead
of pointers. We null-check all WebPageProxy parameters before calling its methods.
* UIProcess/API/APIAutomationSessionClient.h:
(API::AutomationSessionClient::didDisconnectFromRemote):
(API::AutomationSessionClient::didRequestNewWindow):
(API::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
(API::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage):
(API::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage):
(API::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
(API::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
Change pointer to reference.
* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
Add duplicate delegate methods that take/return WKWebView instead of WKPageRef.
Adjust the delegate method names to reflect parameter type and avoid conflicts with the
WKPageRef-using methods that we need to remove eventually.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::terminate):
(WebKit::WebAutomationSession::createBrowsingContext):
(WebKit::WebAutomationSession::isShowingJavaScriptDialog):
(WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
(WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
(WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
(WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
Dereference `this` and `webPageProxy` when calling API::AutomationSessionClient methods.
* UIProcess/Cocoa/AutomationSessionClient.h:
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::AutomationSessionClient):
(WebKit::AutomationSessionClient::didDisconnectFromRemote):
(WebKit::AutomationSessionClient::didRequestNewWindow):
(WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
(WebKit::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage):
(WebKit::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage):
(WebKit::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
(WebKit::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
Now there are two possible delegate methods for most of these, so try to use the
WKWebView-based delegate method first and fall back to the WKPageRef delegate method.
2017-03-02 Alex Christensen <achristensen@webkit.org>
Continue enabling WebRTC
https://bugs.webkit.org/show_bug.cgi?id=169056
Reviewed by Jon Lee.
* Configurations/FeatureDefines.xcconfig:
2017-03-01 Megan Gardner <megan_gardner@apple.com>
Data interaction support for WK1
https://bugs.webkit.org/show_bug.cgi?id=169062
Reviewed by Wenson Hsieh.
Allow for separate additions files in WK1 and WK2
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2017-03-02 Youenn Fablet <youenn@apple.com>
[WebRTC] Activate ICE candidate privacy policy
https://bugs.webkit.org/show_bug.cgi?id=168975
Reviewed by Alex Christensen.
Disabling network enumeration by default.
Enabling ICE candidate filtering by default.
Chaning ICE candidate filtering according userMediaAccess policy:
- If access is denied, filtering is on.
- If access is granted, filtering is off.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetICECandidateFilteringEnabled):
(WKPreferencesGetICECandidateFilteringEnabled):
(WKPreferencesSetEnumeratingAllNetworkInterfacesEnabled):
(WKPreferencesGetEnumeratingAllNetworkInterfacesEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::toWebCore):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::endedCaptureSession):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/WebPage.cpp:
2017-03-02 Tomas Popela <tpopela@redhat.com>
[WK2] Keyboard menu key should show context menu
https://bugs.webkit.org/show_bug.cgi?id=72099
Reviewed by Carlos Garcia Campos.
Show the context menu when the GtkWidget::popup-menu signal is
emitted. This signal is triggered by pressing a key (usually
the Menu key or the Shift + F10 shortcut) or it could be emitted on
WebKitWebView.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_class_init):
(webkit_web_view_class_init): Update the documentation for the
context-menu signal
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBasePopupMenu): Connect to the popup-menu signal and
save the event that was used to trigger the signal. If there is no
such event create a new GdkEvent with GDK_NOTHING type.
(webkitWebViewBasePopupMenu):
(webkit_web_view_base_class_init):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleContextMenuKeyEvent):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::contextMenuForKeyEvent):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2017-03-01 Wenson Hsieh <wenson_hsieh@apple.com>
Replace -[WKWebView adjustedDataInteractionItemProviders:] with a UI delegate method
https://bugs.webkit.org/show_bug.cgi?id=169013
Reviewed by Dan Bernstein.
Rather than introduce new SPI on WKWebView directly, we should follow convention and add the hook to the private
version of the UI delegate.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _adjustedDataInteractionItemProviders:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
2017-03-01 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r213259.
Broke an internal build
Reverted changeset:
"Continue enabling WebRTC"
https://bugs.webkit.org/show_bug.cgi?id=169056
http://trac.webkit.org/changeset/213259
2017-03-01 Alex Christensen <achristensen@webkit.org>
Continue enabling WebRTC
https://bugs.webkit.org/show_bug.cgi?id=169056
Reviewed by Jon Lee.
* Configurations/FeatureDefines.xcconfig:
2017-03-01 Chris Dumez <cdumez@apple.com>
[WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
https://bugs.webkit.org/show_bug.cgi?id=169060
<rdar://problem/30773140>
Reviewed by Darin Adler.
In the !NETWORK_SESSION code path, we were failing to use the suggested filename coming from the
network layer in the case where the download attribute is present but has no value. We were ending
up passing an empty string as suggested filename to Safari which is not handled properly.
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
2017-02-28 Matt Rajca <mrajca@apple.com>
Media: notify clients when autoplayed media is muted
https://bugs.webkit.org/show_bug.cgi?id=168987
Reviewed by Alex Christensen.
* UIProcess/API/C/WKPageUIClient.h:
2017-03-01 Brady Eidson <beidson@apple.com>
Add SPI to create WebsiteDataStore objects pointing to custom paths.
https://bugs.webkit.org/show_bug.cgi?id=169044
Reviewed by Tim Horton.
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h.
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebKit2.xcodeproj/project.pbxproj:
2017-03-01 Jon Lee <jonlee@apple.com>
Update peer connection preference
https://bugs.webkit.org/show_bug.cgi?id=169016
rdar://problem/30773889
Reviewed by Eric Carlson.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::setEnabledForFeature):
(WebKit::WebPreferences::setPeerConnectionAndMediaStreamEnabled): Deleted.
* UIProcess/WebPreferences.h:
2017-03-01 Tomas Popela <tpopela@redhat.com>
[GTK] Fix problems found by Coverity scan in WebPrintOperationGtk.cpp
https://bugs.webkit.org/show_bug.cgi?id=169027
Reviewed by Carlos Garcia Campos.
Initialize the lastPagePosition variable and remove an unused one
- totalToPrint.
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
(WebKit::PrintPagesData::PrintPagesData):
2017-03-01 Andreas Kling <akling@apple.com>
Move MemoryPressureHandler to WTF
<https://webkit.org/b/168908>
Reviewed by Sam Weinig.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/mac/NetworkProcessMac.mm:
* PluginProcess/PluginProcess.cpp:
* Shared/linux/WebMemorySamplerLinux.cpp:
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
* WebProcess/WebPage/ios/WebPageIOS.mm:
2017-03-01 Joseph Pecoraro <pecoraro@apple.com>
[WebRTC] Install libwebrtc.dylib inside of WebCore.framework
https://bugs.webkit.org/show_bug.cgi?id=168859
Reviewed by Dan Bernstein.
* Configurations/BaseTarget.xcconfig:
* Configurations/WebKit.xcconfig:
Set library search path to find the libwebrtc.dylib inside of WebCore's Frameworks
or in the WK_OVERRIDE_FRAMEWORKS_DIR.
2017-02-28 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkProcess aborts in WebKit::NetworkLoad::didCompleteWithError at Source/WebKit2/NetworkProcess/NetworkLoad.cpp:423
https://bugs.webkit.org/show_bug.cgi?id=168963
Reviewed by Antti Koivisto.
This is trying to call SpeculativeLoad::didFailLoading() after SpeculativeLoad has already been
completed. SpeculativeLoad::didComplete() call its completion handler that removes the load from
m_pendingPreloads. When the completion handler returns the SpeculativeLoad is deleted. So, we should always
ensure that SpeculativeLoad is not used after didComplete() call. In SpeculativeLoad::willSendRedirectedRequest(),
the call to NetworkLoad::continueWillSendRequest() causes SpeculativeLoad::didFailLoading() to be called. We
don't really need to call continueWillSendRequest() though, since the network load is going to be deleted anyway
by didComplete(), and the willSendRequest completion handler does nothing when the request is null.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
2017-02-28 Alexey Proskuryakov <ap@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=168899
Re-add deprecated functions to WKPageGroup.h
Reviewed by Tim Horton.
* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKPageGroupRemoveUserContentFilter):
(WKPageGroupRemoveAllUserContentFilters): Deleted. Unlike the other three, this
function isn't used by any clients.
* UIProcess/API/C/WKPageGroup.h:
2017-02-28 Alexey Proskuryakov <ap@apple.com>
Expose _WKVisitedLinkProvider in a header
https://bugs.webkit.org/show_bug.cgi?id=168955
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
* UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
The class needs to be visible in a header, as it is exported SPI.
2017-02-28 Brady Eidson <beidson@apple.com>
Move resolving symlinks of some WebsiteDataStore paths from WebProcessPool to... WebsiteDataStore!.
https://bugs.webkit.org/show_bug.cgi?id=168696.
Reviewed by Alex Christensen.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory):
(WebKit::WebsiteDataStore::resolvedMediaCacheDirectory):
(WebKit::WebsiteDataStore::resolvedMediaKeysDirectory):
(WebKit::WebsiteDataStore::resolvedDatabaseDirectory):
2017-02-28 Alex Christensen <achristensen@webkit.org>
LibWebRTCProvider should check existence of libwebrtc.dylib
https://bugs.webkit.org/show_bug.cgi?id=168986
Reviewed by Youenn Fablet.
* Shared/WebPreferencesDefinitions.h:
* Shared/WebPreferencesStore.cpp:
* UIProcess/WebPreferences.cpp:
(WebKit::checkWebRTCAvailability): Deleted.
2017-02-28 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, build fix after r213176.
* Platform/spi/ios/UIKitSPI.h:
2017-02-28 Tim Horton <timothy_horton@apple.com>
[iOS] Getting QLPreviewProtocol slows down first navigation in Web process
https://bugs.webkit.org/show_bug.cgi?id=168940
<rdar://problem/29468999>
Reviewed by Simon Fraser.
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
Make use of isQuickLookPreviewURL.
2017-02-28 Brady Eidson <beidson@apple.com>
Fix API test regression(s):
REGRESSION (r213168): API test WKUserContentController.ScriptMessageHandlerMultipleHandlerRemoval crashing
https://bugs.webkit.org/show_bug.cgi?id=168991
Unreviewed.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
2017-02-28 Wenson Hsieh <wenson_hsieh@apple.com>
Data interaction should support attachment elements
https://bugs.webkit.org/show_bug.cgi?id=168916
<rdar://problem/30664519>
Reviewed by Ryosuke Niwa.
Teaches WKContentView to recognize attachment elements as data interactive content, and add an internal hook to
adjust the list of item providers before initiating data interaction.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _adjustedDataInteractionItemProviders:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView pointIsInDataInteractionContent:]):
2017-02-28 Yongjun Zhang <yongjun_zhang@apple.com>
Add delegate method to handle images with alternate data.
https://bugs.webkit.org/show_bug.cgi?id=168785
<rdar://problem/28776219>
Add delegate methods to WKUIDelegatePrivate so that a WebKit client can provide alternate URL or data for an image
before long-press or preview. When an image has alternate URL or data, we can change the actions accordingly.
Reviewed by Enrica Casucci.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add two delegate methods _webView:getAlternateURLFromImage:completionHandler:
and _webView:alternateURLFromImage:userInfo;
* UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Add an readonly property userInfo so that alternate data can be
carried by _WKActivatedElementInfo and be processed by WebKit client.
* UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
(-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:]):
(-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:userInfo:]): A new initializer that also takes userInfo.
(-[_WKActivatedElementInfo userInfo]):
* UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: A new delegate method for WKActionSheetAssistantDelegate to fetch
alternate data before showing image sheet.
* UIProcess/ios/WKActionSheetAssistant.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showImageSheet]): Before showing the image sheet, if the image doesn't have linked URL (i.e. not a image
link), try to fetch its alternate URL and data.
(-[WKActionSheetAssistant defaultActionsForImageSheet:]): Drive-by fix. We always use positionInformation's URL to populate the
actions, however, we should use elementInfo's URL since the two URLs could mismatch.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView actionSheetAssistant:getAlternateURLForImage:completion:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]): Before previewing an image, synchronously get alternate
data for the image and update the actions accordingly.
2017-02-28 Brady Eidson <beidson@apple.com>
Refactor WebViewImpl creation in preparation for supporting multiple WebsiteDataStores.
https://bugs.webkit.org/show_bug.cgi?id=168676
Reviewed by Alex Christensen and Sam Weinig.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::warmInitialProcess):
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
(WebKit::WebProcessPool::createWebPage):
* UIProcess/WebProcessPool.h:
2017-02-28 Youenn Fablet <youenn@apple.com>
[WebRTC] Limit libwebrtc logging in Debug build
https://bugs.webkit.org/show_bug.cgi?id=168974
Reviewed by Alex Christensen.
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::NetworkRTCProvider):
* Platform/Logging.h:
2017-02-28 Youenn Fablet <youenn@apple.com>
[WebRTC] NetworkRTCProvider should stop the network thread from the main thread
https://bugs.webkit.org/show_bug.cgi?id=168972
Reviewed by Alex Christensen.
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::close): Ensuring to stop the network thread from the main thread when provider is
getting closed.
2017-02-24 Matt Rajca <mrajca@apple.com>
Media: notify clients when autoplayed media ends without being paused
https://bugs.webkit.org/show_bug.cgi?id=168852
Reviewed by Alex Christensen.
* UIProcess/API/C/WKPageUIClient.h:
2017-02-28 Csaba Osztrogonác <ossy@webkit.org>
Remove EFL leftover from WebPageProxy.messages.in
https://bugs.webkit.org/show_bug.cgi?id=168828
Reviewed by Gyuyoung Kim.
* UIProcess/WebPageProxy.messages.in:
2017-02-28 Alex Christensen <achristensen@webkit.org>
Main resource requests need cachePartition
https://bugs.webkit.org/show_bug.cgi?id=168806
Reviewed by Brady Eidson.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRequest):
2017-02-27 Alex Christensen <achristensen@webkit.org>
Begin enabling WebRTC on 64-bit
https://bugs.webkit.org/show_bug.cgi?id=168915
Reviewed by Eric Carlson.
* Configurations/FeatureDefines.xcconfig:
2017-02-27 Alexey Proskuryakov <ap@apple.com>
Remove _WKWebsiteDataRecord.h
https://bugs.webkit.org/show_bug.cgi?id=168954
Reviewed by Dan Bernstein.
This doesn't seem to have ever been used, so better to remove it than to add an
implementation.
* UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: Removed.
* WebKit2.xcodeproj/project.pbxproj:
2017-02-27 Alexey Proskuryakov <ap@apple.com>
WKPageIsPlayingVideoInEnhancedFullscreen availability mismatch
https://bugs.webkit.org/show_bug.cgi?id=168952
Reviewed by Dan Bernstein.
* UIProcess/API/C/mac/WKPagePrivateMac.h: TARGET_OS_MAC is not the right thing to
check, as it's true on both macOS and iOS.
2017-02-27 Alexey Proskuryakov <ap@apple.com>
Export WKPluginInformationBundleShortVersionKey
https://bugs.webkit.org/show_bug.cgi?id=168951
Reviewed by Dan Bernstein.
* Shared/API/c/WKPluginInformation.h: It was accidentally not exported when added.
2017-02-27 Youenn Fablet <youenn@apple.com>
[WebRTC] Add support for libwebrtc TCP incoming connections
https://bugs.webkit.org/show_bug.cgi?id=168748
Reviewed by Alex Christensen.
Covered by added layout tests.
When a libwebrtc server socket is signalling a new connnection through SignalNewConnection, we do:
- Wrap the incoming socket into a LibWebRTCSocketClient
- Store it into a pending socket map with an identifier
- Send a message to the web process of a new connection with the server socket identifier and new connection socket identifier.
The Web process then creates a WebRTCSocket wrapper around it by sendinig a WrapNewTCPConnection message.
It then propagates the SignalNewConnection to libwebrtc code path.
* NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
(WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
(WebKit::LibWebRTCSocketClient::signalReadPacket):
(WebKit::LibWebRTCSocketClient::signalSentPacket):
(WebKit::LibWebRTCSocketClient::signalNewConnection):
(WebKit::LibWebRTCSocketClient::signalAddressReady):
(WebKit::LibWebRTCSocketClient::signalConnect):
(WebKit::LibWebRTCSocketClient::signalClose):
* NetworkProcess/webrtc/LibWebRTCSocketClient.h:
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::wrapNewTCPConnection):
(WebKit::NetworkRTCProvider::newConnection):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
* NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::LibWebRTCSocket::signalNewConnection):
* WebProcess/Network/webrtc/LibWebRTCSocket.h:
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
* WebProcess/Network/webrtc/WebRTCSocket.cpp:
(WebKit::WebRTCSocket::signalNewConnection):
* WebProcess/Network/webrtc/WebRTCSocket.h:
* WebProcess/Network/webrtc/WebRTCSocket.messages.in:
2017-02-27 Brent Fulgham <bfulgham@apple.com>
[Mac] Don't use undefined sandbox rule on macOS 10.11 or earlier
https://bugs.webkit.org/show_bug.cgi?id=168942
<rdar://problem/30743376>
Reviewed by Ryosuke Niwa.
* WebProcess/com.apple.WebProcess.sb.in:
2017-02-27 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, roll out r213065.
* UIProcess/ios/WKContentViewInteraction.h:
2017-02-27 Alexey Proskuryakov <ap@apple.com>
Remove some deprecated WKPage plug-in information functions
https://bugs.webkit.org/show_bug.cgi?id=168897
Reviewed by Tim Horton.
* UIProcess/API/C/WKPage.cpp:
(WKPageGetProcessIdentifier):
(WKPageGetPluginInformationBundleIdentifierKey): Deleted.
(WKPageGetPluginInformationBundleVersionKey): Deleted.
(WKPageGetPluginInformationDisplayNameKey): Deleted.
(WKPageGetPluginInformationFrameURLKey): Deleted.
(WKPageGetPluginInformationMIMETypeKey): Deleted.
(WKPageGetPluginInformationPageURLKey): Deleted.
(WKPageGetPluginInformationPluginspageAttributeURLKey): Deleted.
(WKPageGetPluginInformationPluginURLKey): Deleted.
* UIProcess/API/C/WKPage.h:
2017-02-27 Alexey Proskuryakov <ap@apple.com>
Stop exporting C++ member variables from class extensions in WKDOMInternals.h
https://bugs.webkit.org/show_bug.cgi?id=168886
Reviewed by Tim Horton.
* WebProcess/InjectedBundle/API/mac/WKDOMInternals.h: These are @package variables.
2017-02-27 Alex Christensen <achristensen@webkit.org>
Optimize checkWebRTCAvailability
https://bugs.webkit.org/show_bug.cgi?id=168913
Reviewed by Darin Adler.
We can optimize startup time by using RTLD_LAZY instead of RTLD_NOW because we don't need to load all the symbols.
We just need to check whether libwebrtc.dylib can be found and is a valid dylib for the current architecture.
Also, initialize a static bool so it only needs to be checked once. Right now it's only used when initializing settings,
but if we use it for other things in the future there will be no need to reopen the dylib.
* UIProcess/WebPreferences.cpp:
(WebKit::checkWebRTCAvailability):
2017-02-26 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, revert all temporary build fixes for data interaction
Rolls out r212990, r212988 and r212984.
* UIProcess/ios/WKContentViewInteraction.h:
2017-02-27 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Rendering artifacts when resizing the window in X11 with AC mode enabled
https://bugs.webkit.org/show_bug.cgi?id=168728
Reviewed by Žan Doberšek.
This happens because the pixmap we create from the redirected window is uninitialized until the threaded
compositor renders into it. We should always initialize the pixmap right after it's created.
* WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
(WebKit::defaultVisual): Helper static method to get the default GdkVisual.
(WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11): Use createPixmap().
(WebKit::AcceleratedSurfaceX11::createPixmap): Create and initialize the pixmap.
(WebKit::AcceleratedSurfaceX11::resize): Use createPixmap().
* WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
2017-02-27 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Flickering when leaving accelerated compositing mode
https://bugs.webkit.org/show_bug.cgi?id=168911
Reviewed by Žan Doberšek.
It doesn't always happen, and it's too fast, more noticeable in websites with a dark background, because we are
drawing a single white frame. This happens when we leave AC mode during the layer flush that schedules an update
on the compositor, which at that point only clears the area and renders nothing. However,
CoordinatedGraphicsScene::paintToCurrentGLContext() always renders a white background when no web view color has
been set. And that's the white frame we get. We could prevent that last update from happening by checking if we
still have a graphics root layer after syncDisplayState() in the layer flush, the same way we check the layer
tree host is still valid.
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
2017-02-27 Alex Christensen <achristensen@webkit.org>
[libwebrtc] Enable WebRTC in some Production Builds
https://bugs.webkit.org/show_bug.cgi?id=168858
* Configurations/FeatureDefines.xcconfig:
2017-02-27 Andy Estes <aestes@apple.com>
Links cannot be activated when running Mobile Safari with external SDK build of WebKit for iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=141906
Reviewed by Tim Horton.
Even if Touch Events are disabled, we still need to register a
UIWebTouchEventsGestureRecognizer to record the layer tree transaction ID when a touch
begins. Click events are only generated for touches that occur after the current frame's
load has committed, and we use the transaction ID from when the touch began to implement
this check.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleTouchEventSynchronously):
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h: Declared _layerTreeTransactionIdAtLastTouchStart.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]): Register a UIWebTouchEventsGestureRecognizer even if
Touch Events are disabled.
(-[WKContentView cleanupInteraction]): Reset _layerTreeTransactionIdAtLastTouchStart to 0.
(-[WKContentView _webTouchEventsRecognized:]): Update _layerTreeTransactionIdAtLastTouchStart
when a touch begins, even if Touch Events are disabled.
(-[WKContentView _singleTapCommited:]): Passed _layerTreeTransactionIdAtLastTouchStart to
WebPageProxy::commitPotentialTap().
(-[WKContentView _attemptClickAtLocation:]): Ditto for WebPageProxy::handleTap().
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::handleTap):
2017-02-26 Zan Dobersek <zdobersek@igalia.com>
[CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
https://bugs.webkit.org/show_bug.cgi?id=168903
Reviewed by Carlos Garcia Campos.
Remove the CoordinatedGraphicsScene::paintToGraphicsContext() method as it
is not used anywhere. Also enables removing the GraphicsContext pointer
member from the TextureMapper class.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::paintToGraphicsContext): Deleted.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2017-02-26 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Hangs when showing Google search results
https://bugs.webkit.org/show_bug.cgi?id=168699
Reviewed by Žan Doberšek.
Connection::sendOutgoingMessage() can poll forever if sendmsg fails with EAGAIN or EWOULDBLOCK. For example if
socket read buffers are full, poll will be blocked until we read the pending data, but we can't read because
the thread is blocked in the poll. In case of EAGAIN/EWOULDBLOCK we should poll using the run loop, to allow
reads to happen in thread while we wait for the socket to be writable again. In the GTK+ port we use
GSocketMonitor to poll socket file descriptor without blocking, using the run loop. This patch renames the
socket monitor as readSocketMonitor and adds another one for polling output. When sendmsg fails with
EAGAIN/EWOULDBLOCK, the pending message is saved and the write monitor starts polling. Once the socket is
writable again we send the pending message. Helper class MessageInfo and a new one UnixMessage have been moved
to its own header file to be able to use std::unique_ptr member to save the pending message.
* Platform/IPC/Connection.cpp: Include UnixMessage.h as required by std::unique_ptr.
* Platform/IPC/Connection.h: Add write socket monitor and also keep the GSocket as a member to reuse it.
* Platform/IPC/glib/GSocketMonitor.cpp: Use Function instead of std::function.
(IPC::GSocketMonitor::start):
* Platform/IPC/glib/GSocketMonitor.h:
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::platformInitialize): Initialize the GSocket here since we rely on it to take the ownership of
the descriptor. We were leaking it if the connection was invalidated without being opened.
(IPC::Connection::platformInvalidate): Destroy the GSocket even when not connected. Also stop the write monitor.
(IPC::Connection::processMessage):
(IPC::Connection::open):
(IPC::Connection::platformCanSendOutgoingMessages): Return false if we have a pending message to ensure
Connection doesn't try to send more messages until the pending message is dispatched. We don't need to check
m_isConnected because the caller already checks that.
(IPC::Connection::sendOutgoingMessage): Split it in two. This creates and prepares a UnixMessage and then calls
sendOutputMessage() to do the rest.
(IPC::Connection::sendOutputMessage): Send the message, or save it if sendmsg fails with EAGAIN or EWOULDBLOCK
to be sent later when the socket is writable.
* Platform/IPC/unix/UnixMessage.h: Added.
(IPC::MessageInfo::MessageInfo):
(IPC::MessageInfo::setMessageBodyIsOutOfLine):
(IPC::MessageInfo::isMessageBodyIsOutOfLine):
(IPC::MessageInfo::bodySize):
(IPC::MessageInfo::attachmentCount):
(IPC::UnixMessage::UnixMessage):
(IPC::UnixMessage::~UnixMessage):
(IPC::UnixMessage::attachments):
(IPC::UnixMessage::messageInfo):
(IPC::UnixMessage::body):
(IPC::UnixMessage::bodySize):
(IPC::UnixMessage::appendAttachment):
* PlatformGTK.cmake:
2017-02-26 Devin Rousso <dcrousso+webkit@gmail.com>
Web Inspector: RTL: Docking Left doesn't constrain the page width
https://bugs.webkit.org/show_bug.cgi?id=168862
Reviewed by Brian Burg.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
Calculate the inspectedViewFrame to be the remaining space after WebInspector is opened
instead of using the original page size.
2017-02-26 Alexey Proskuryakov <ap@apple.com>
Stop exporting C++ member variables from WKDOMTextIterator
https://bugs.webkit.org/show_bug.cgi?id=168885
Reviewed by Dan Bernstein.
* WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
2017-02-26 Alexey Proskuryakov <ap@apple.com>
Add preprocessor guards to Mac specific files that are exposed as private headers on iOS
https://bugs.webkit.org/show_bug.cgi?id=168878
Reviewed by Dan Bernstein.
* UIProcess/API/C/WKInspector.h:
* WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.h:
2017-02-26 Alexey Proskuryakov <ap@apple.com>
Remove spurious C++ include from _WKTestingDelegate.h
https://bugs.webkit.org/show_bug.cgi?id=168877
Reviewed by Dan Bernstein.
* UIProcess/API/Cocoa/_WKTestingDelegate.h:
2017-02-26 Alexey Proskuryakov <ap@apple.com>
Remove unimplemented WKResourceLoadStatisticsManagerSetReducedTimestampResolution
https://bugs.webkit.org/show_bug.cgi?id=168880
Reviewed by Dan Bernstein.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
2017-02-26 Alexey Proskuryakov <ap@apple.com>
Remove leftover WebKit2 C API function declarations
https://bugs.webkit.org/show_bug.cgi?id=168879
Reviewed by Tim Horton.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
2017-02-26 Alexey Proskuryakov <ap@apple.com>
Remove some old WKSecurityOrigin binary compatibility stubs
https://bugs.webkit.org/show_bug.cgi?id=168881
Reviewed by Dan Bernstein.
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginGetHost): Deleted.
(WKSecurityOriginGetProtocol): Deleted.
2017-02-26 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r211312): Double-clicking a word selects it along with the space that follows it
https://bugs.webkit.org/show_bug.cgi?id=168821
<rdar://problem/30690431>
Reviewed by Tim Horton.
Actually encode and decode smartInsertDeleteEnabled when sending WebPageCreationParameters over XPC.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
2017-02-26 Chris Dumez <cdumez@apple.com>
HitTestResult's linkSuggestedFilename should sanitize download attribute
https://bugs.webkit.org/show_bug.cgi?id=168856
<rdar://problem/30683109>
Reviewed by Antti Koivisto.
HitTestResult's linkSuggestedFilename should sanitize download attribute.
This is used by the context menu's "Download Linked File" & "Download Linked
File As..." actions.
* Shared/WebHitTestResultData.cpp:
(WebKit::WebHitTestResultData::WebHitTestResultData):
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
(WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
2017-02-25 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Unreviewed, document deficiency in webkit_website_data_manager_clear() API
Document that this function cannot currently delete cookie data for a particular period of
time.
* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
2017-02-24 Joseph Pecoraro <pecoraro@apple.com>
[Resource Timing] Gather timing information with reliable responseEnd time
https://bugs.webkit.org/show_bug.cgi?id=168351
Reviewed by Alex Christensen.
Change from an unused `double finishTime` to a complete WebCore::NetworkLoadMetrics
object in the didFinishLoad ResourceLoader path. We may also extend this in the
didFail path later on. This allows the NetworkProcess to give complete timing
information, and more final metrics about the load, to WebCore.
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTaskClient::didCompleteWithError):
Give the NetworkDataTaskClient a basic didCompleteWithError for a completion
without metrics. For loads that complete with an error, or haven't populated
any metrics, this will pass empty metrics onward.
* NetworkProcess/Downloads/BlobDownloadClient.cpp:
(WebKit::BlobDownloadClient::didFinishLoading):
* NetworkProcess/Downloads/BlobDownloadClient.h:
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/PingLoad.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::didFail):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::continueWillSendRequest):
(WebKit::NetworkLoad::didCompleteWithError):
(WebKit::NetworkLoad::didFinishLoading):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didFinishResourceLoad):
(WebKit::WebResourceLoader::didReceiveResource):
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.messages.in:
Change didFinishLoad paths to take a NetworkLoadMetrics object instead of finishTime.
Change didCompleteWithError pathes to include a NetworkLoadMetrics object instead of finishTime.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::didCompleteWithError):
Own a NetworkLoadTiming that will be populated with the load.
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
Populate NetworkLoadMetrics in the didFinishCollectingMetrics NSURLSessionTaskDelegate method.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::timeoutFired):
(WebKit::NetworkDataTaskSoup::didSendRequest):
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
(WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
(WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
(WebKit::NetworkDataTaskSoup::didFinishRead):
(WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
(WebKit::NetworkDataTaskSoup::didFailDownload):
(WebKit::NetworkDataTaskSoup::didFail):
(WebKit::NetworkDataTaskSoup::networkEvent):
(WebKit::NetworkDataTaskSoup::didStartRequest):
(WebKit::NetworkDataTaskSoup::didRestart):
* NetworkProcess/soup/NetworkDataTaskSoup.h:
Instead of populating the NetworkLoadMetrics on the ResourceResponse, populate
a member variable during the entire load and dispatch didFinishCollectingMetrics
right before didCompleteLoadWithError.
2017-02-24 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r212944.
Caused a lot of failures on the debug bots
Reverted changeset:
"[Resource Timing] Gather timing information with reliable
responseEnd time"
https://bugs.webkit.org/show_bug.cgi?id=168351
http://trac.webkit.org/changeset/212944
2017-02-24 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the internal build
* UIProcess/ios/WKContentViewInteraction.h:
2017-02-24 Matt Rajca <mrajca@apple.com>
Media: notify clients when autoplay is denied
https://bugs.webkit.org/show_bug.cgi?id=168840
Reviewed by Alex Christensen.
* UIProcess/API/APIUIClient.h:
(API::UIClient::handleAutoplayEvent):
(API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleAutoplayEvent):
(WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::handleAutoplayEvent):
(WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:
2017-02-20 Wenson Hsieh <wenson_hsieh@apple.com>
Refactor data interaction to use new WKDataInteraction SPI
https://bugs.webkit.org/show_bug.cgi?id=168602
Work towards <rdar://problem/30313681>
Reviewed by Tim Horton.
Adjust testing SPI to match new data interaction interfaces.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _simulateDataInteractionEntered:]):
(-[WKWebView _simulateDataInteractionUpdated:]):
(-[WKWebView _simulateDataInteractionPerformOperation:]):
(-[WKWebView _simulateDataInteractionEnded:]):
(-[WKWebView _simulateDataInteractionSessionDidEnd:]):
(-[WKWebView _simulateWillBeginDataInteractionWithSession:]):
(-[WKWebView _simulatedItemsForSession:]):
(-[WKWebView _simulatePrepareForDataInteractionSession:completion:]):
(-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]): Deleted.
(-[WKWebView _simulateFailedDataInteractionWithIndex:]): Deleted.
(-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]): Deleted.
(-[WKWebView _simulatedItemsForDataInteractionWithIndex:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _positionInformationDidChange:]):
* UIProcess/ios/WKScrollView.h:
* UIProcess/ios/WKScrollView.mm:
2017-02-20 Wenson Hsieh <wenson_hsieh@apple.com>
Remove the data interaction gesture recognizer
https://bugs.webkit.org/show_bug.cgi?id=168600
<rdar://problem/30313681>
Reviewed by Anders Carlsson.
The data interaction gesture recognizer will no longer be needed moving forward.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _simulateDataInteractionGestureRecognized]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView _dataInteractionGestureRecognizer]): Deleted.
2017-02-24 Chris Dumez <cdumez@apple.com>
[iOS][WK2] Disable network cache speculative revalidation / loading in low power mode
https://bugs.webkit.org/show_bug.cgi?id=168832
<rdar://problem/30697911>
Reviewed by Antti Koivisto.
Disable network cache speculative revalidation / loading in low power mode on iOS to
save battery.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::initialize):
* NetworkProcess/cache/NetworkCache.h:
2017-02-24 John Wilander <wilander@apple.com>
Resource Load Statistics: Add alternate classification method
https://bugs.webkit.org/show_bug.cgi?id=168347
<rdar://problem/30352793>
<rdar://problem/30646710>
<rdar://problem/30660708>
Reviewed by Alex Christensen.
This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
also adds functions to support layout tests of the feature.
* Platform/Logging.h:
Added channel ResourceLoadStatistics.
* Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
(WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
* Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
(WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
Shared classifier logic.
(WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
Fallback classifier for when we don't have CorePrediction.
* Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
(WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
(WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
* Platform/classifier/cocoa/CorePredictionSoftLink.h: Added.
Soft links to CorePrediction and the two functions we use from it.
* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
(WebKit::ResourceLoadStatisticsClassifier::classify):
(WebKit::ResourceLoadStatisticsClassifier::storagePath):
(WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePredictionAndHaveModelLoaded):
(WebKit::ResourceLoadStatisticsClassifier::singletonPredictionModel):
The new classifier for Cocoa platforms.
* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
* PlatformGTK.cmake:
Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
* PlatformMac.cmake:
Added Platform/classifier and Platform/classifier/cocoa directories, and
source files ResourceLoadStatisticsClassifierBase.cpp and
ResourceLoadStatisticsClassifierCocoa.cpp
* Resources/ResourceLoadStatistics/corePrediction_model: Added.
Model file to load into CorePrediction.
* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
Test infrastructure.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
Test infrastructure.
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::classifyResource):
Now calls the classifier through its ResourceLoadStatisticsClassifier
member variable.
(WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:
* WebKit2.xcodeproj/project.pbxproj:
Added the new classifier source files under Platform/classifier and the
corePrediction_model file under Resources/ResourceLoadStatistics.
2017-02-23 Joseph Pecoraro <pecoraro@apple.com>
[Resource Timing] Add Experimental Feature Flag
https://bugs.webkit.org/show_bug.cgi?id=167147
Reviewed by Ryosuke Niwa.
* Shared/WebPreferencesDefinitions.h:
Move ResourceTiming to experimental section.
Disable it for El Capitan due to known issues.
2017-02-23 Joseph Pecoraro <pecoraro@apple.com>
[Resource Timing] Gather timing information with reliable responseEnd time
https://bugs.webkit.org/show_bug.cgi?id=168351
Reviewed by Alex Christensen.
Change from an unused `double finishTime` to a complete WebCore::NetworkLoadMetrics
object in the didFinishLoad ResourceLoader path. We may also extend this in the
didFail path later on. This allows the NetworkProcess to give complete timing
information, and more final metrics about the load, to WebCore.
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTaskClient::didCompleteWithError):
Give the NetworkDataTaskClient a basic didCompleteWithError for a completion
without metrics. For loads that complete with an error, or haven't populated
any metrics, this will pass empty metrics onward.
* NetworkProcess/Downloads/BlobDownloadClient.cpp:
(WebKit::BlobDownloadClient::didFinishLoading):
* NetworkProcess/Downloads/BlobDownloadClient.h:
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/PingLoad.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::didFail):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::continueWillSendRequest):
(WebKit::NetworkLoad::didCompleteWithError):
(WebKit::NetworkLoad::didFinishLoading):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didFinishResourceLoad):
(WebKit::WebResourceLoader::didReceiveResource):
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.messages.in:
Change didFinishLoad paths to take a NetworkLoadMetrics object instead of finishTime.
Change didCompleteWithError pathes to include a NetworkLoadMetrics object instead of finishTime.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::didCompleteWithError):
Own a NetworkLoadTiming that will be populated with the load.
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
Populate NetworkLoadMetrics in the didFinishCollectingMetrics NSURLSessionTaskDelegate method.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::timeoutFired):
(WebKit::NetworkDataTaskSoup::didSendRequest):
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
(WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
(WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
(WebKit::NetworkDataTaskSoup::didFinishRead):
(WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
(WebKit::NetworkDataTaskSoup::didFailDownload):
(WebKit::NetworkDataTaskSoup::didFail):
(WebKit::NetworkDataTaskSoup::networkEvent):
(WebKit::NetworkDataTaskSoup::didStartRequest):
(WebKit::NetworkDataTaskSoup::didRestart):
* NetworkProcess/soup/NetworkDataTaskSoup.h:
Instead of populating the NetworkLoadMetrics on the ResourceResponse, populate
a member variable during the entire load and dispatch didFinishCollectingMetrics
right before didCompleteLoadWithError.
2017-02-23 Beth Dakin <bdakin@apple.com> + Dan Saunders <dasau@microsoft.com>
No reliable way to get a snapshot of WKWebView
https://bugs.webkit.org/show_bug.cgi?id=161450
-and corresponding-
<rdar://problem/23846039>
Reviewed by Tim Horton.
This patch adds a new API to WKWebView to snapshot a rect:
takeSnapshotWithConfiguration:completionHandler:
It also adds a new API object WKSnapshotConfiguration.
* UIProcess/API/Cocoa/WKSnapshotConfiguration.h: Added.
* UIProcess/API/Cocoa/WKSnapshotConfiguration.mm: Added.
(-[WKSnapshotConfiguration copyWithZone:]):
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
* WebKit2.xcodeproj/project.pbxproj:
2017-02-23 Jer Noble <jer.noble@apple.com>
ASSERT in RTCNetwork::IPAddress::decode()
https://bugs.webkit.org/show_bug.cgi?id=168792
Reviewed by Tim Horton.
An ASSERT added to RTCNetwork::IPAddress::decode in r212781 was hit due to a bad encode of SocketAddress; an
extra boolean value was added to the encoder unnecessarily, leading to garbage data being decoded in the following
IPAddress.
Drive-by-fix: allow the IPAddress encoder/decoder to pass through a value of AF_UNSPEC for an IPAddress to support
passing through an "empty" IPAddress value.
* Shared/RTCNetwork.cpp:
(WebKit::RTCNetwork::IPAddress::decode):
(WebKit::RTCNetwork::IPAddress::encode):
(WebKit::RTCNetwork::SocketAddress::encode):
2017-02-23 Eric Carlson <eric.carlson@apple.com>
[WebRTC][Mac][WebKit2] WebRTC requires media capture
https://bugs.webkit.org/show_bug.cgi?id=168782
<rdar://problem/30675242>
Reviewed by Youenn Fablet.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess): Extend the sanbox to allow microphone access
if media stream OR WebRTC is enabled.
2017-02-23 Brent Fulgham <bfulgham@apple.com>
[Mac] Remove unneeded sandbox exceptions for media elements
https://bugs.webkit.org/show_bug.cgi?id=168767
Reviewed by Alex Christensen.
Remove several sandbox exceptions that have not been needed for the past four
or five macOS releases.
* WebProcess/com.apple.WebProcess.sb.in:
2017-02-23 Brent Fulgham <bfulgham@apple.com>
[Mac] Remove com.apple.audio.VDCAssistant from sandboxes
https://bugs.webkit.org/show_bug.cgi?id=168764
<rdar://problem/16736919>
Reviewed by Alex Christensen.
Remove unneeded sandbox class.
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2017-02-22 Wenson Hsieh <wenson_hsieh@apple.com>
Data interaction causes selection to fall out of sync between web/UI processes
https://bugs.webkit.org/show_bug.cgi?id=168735
<rdar://problem/30657817>
Reviewed by Tim Horton.
Fixes a bug with data interaction causing selection state to fall out of sync between the UI and web processes,
and also introduces testing infrastructure and tests for grabbing UI-side selection view rects in TestWebKitAPI.
While performing a data interaction operation, we now lift restrictions for assisting the focused node.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
2017-02-23 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Crash attempting to load Flash plugin in Wayland
https://bugs.webkit.org/show_bug.cgi?id=163159
Reviewed by Michael Catanzaro.
The problem is that we check if the current diplay is X11 or Wayland also in the plugin process, but with GTK2
plugins the display is always X11. We should early reject plugins requiring GTK2 in the UI process when the
current display is Wayland.
* UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
(WebKit::PluginInfoStore::getPluginInfo):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::scanPlugin):
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::createPluginContainer): Add an assert to ensure this message is never received on a
non-X11 display.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::createPluginContainer): Never send CreatePluginContainer message to the UI process if the
display is not X11.
2017-02-23 Eric Carlson <eric.carlson@apple.com>
[MediaStream iOS] Allow web process sandbox to be extended for media capture
https://bugs.webkit.org/show_bug.cgi?id=168756
Reviewed by Brent Fulgham.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add rules to dynamically
extend the sandbox to allow access to the camera and/or microphone.
2017-02-23 Tomas Popela <tpopela@redhat.com>
[GTK] Drag and drop is always moving the content even if copy is requested
https://bugs.webkit.org/show_bug.cgi?id=168424
Reviewed by Carlos Garcia Campos.
Drag and drop is always moving the content around even if the copy is
requested (i.e. by pressing the Control key).
* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::drop):
2017-02-22 Carlos Garcia Campos <cgarcia@igalia.com>
Better handle Thread and RunLoop initialization
https://bugs.webkit.org/show_bug.cgi?id=167828
Reviewed by Yusuke Suzuki.
Remove unnecessary call to WTF::initializeMainThread().
* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):
2017-02-22 Chris Dumez <cdumez@apple.com>
Unreviewed, drop console logging landed by mistake as part of r212832.
* UIProcess/BackgroundProcessResponsivenessTimer.cpp:
(WebKit::BackgroundProcessResponsivenessTimer::timerFired):
2017-02-22 Brent Fulgham <bfulgham@apple.com>
[Mac] Tighten sandbox to deny process-info* access
https://bugs.webkit.org/show_bug.cgi?id=168704
<rdar://problem/16371441>
Reviewed by Alex Christensen.
Tighten the various WebKit sandboxes by denying access to process-info.
Add back specific features needed to run WebKit tests and to do browsing
of websites (including plugins).
* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2017-02-22 Anders Carlsson <andersca@apple.com>
Crash if there's a mismatch between the WebKit used by the UI process and child processes respectively
https://bugs.webkit.org/show_bug.cgi?id=168739
Part of rdar://problem/30631411.
Reviewed by Geoffrey Garen.
If the UI process and web process for some reason end up using different versions of the WebKit framework, weird things happen
because the message format is different between versions. To avoid this, send along the WebKit bundle version from the UI process
in the XPC bootstrap message, check that it matches inside the XPC main functions. If there's a mismatch, crash.
* Shared/Cocoa/ChildProcessCocoa.mm:
(WebKit::ChildProcess::didReceiveInvalidMessage):
Fix parameters.
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(main):
Check for the bundle version and crash if it's not what we expect.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
Initialize the bundle version.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::_WKSetCrashReportApplicationSpecificInformation):
Export this so we can call it from the XPC services without having to link WKSI.
2017-02-22 Chris Dumez <cdumez@apple.com>
[WK2] Call processDidBecomeUnresponsive delegate when a background process is unresponsive
https://bugs.webkit.org/show_bug.cgi?id=168683
<rdar://problem/30558745>
Reviewed by Dan Bernstein.
Call processDidBecomeUnresponsive delegate when a background process is unresponsive
instead of killing it on WebKit side. This gives the client the choice about what it
wants to do about this process.
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/BackgroundProcessResponsivenessTimer.cpp: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp.
(WebKit::BackgroundProcessResponsivenessTimer::BackgroundProcessResponsivenessTimer):
(WebKit::BackgroundProcessResponsivenessTimer::updateState):
(WebKit::BackgroundProcessResponsivenessTimer::timerFired):
* UIProcess/BackgroundProcessResponsivenessTimer.h: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::terminateProcess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::m_backgroundResponsivenessTimer):
* UIProcess/WebProcessProxy.h:
* WebKit2.xcodeproj/project.pbxproj:
2017-02-22 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkProcess: Stop disabling buffering when NETWORK_CACHE is disabled in build
https://bugs.webkit.org/show_bug.cgi?id=168637
Reviewed by Alex Christensen.
It was added in r193752 as part of bug #137692 to fix an infinite loop in network process that happened in EFL
because they didn't enable the network cache at that time. I think that was actually a workaround, and it was
added without any comment so it has stayed there even when EFL enabled disk cache, and now that is gone. Looking
at current code I see no reason why buffering can't work with the disk cache disabled, so I think it's time to
remove that workaround.
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::maximumBufferingTime):
2017-02-21 Youenn Fablet <youenn@apple.com>
[WebRTC][Mac] Activate libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167293
<rdar://problem/30401864>
Reviewed by Alex Christensen.
Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.
* Configurations/WebKit.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/WebPreferences.cpp:
(WebKit::checkWebRTCAvailability):
2017-02-21 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r212786.
https://bugs.webkit.org/show_bug.cgi?id=168710
It broke GTK+ port when using single shared process model
(Requested by KaL on #webkit).
Reverted changeset:
"Refactor WebViewImpl creation in preparation for supporting
multiple WebsiteDataStores."
https://bugs.webkit.org/show_bug.cgi?id=168676
http://trac.webkit.org/changeset/212786
2017-02-21 Brady Eidson <beidson@apple.com>
Refactor WebViewImpl creation in preparation for supporting multiple WebsiteDataStores.
https://bugs.webkit.org/show_bug.cgi?id=168676
Reviewed by Alex Christensen.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Allow for WebViewImpl creation to fail.
* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:processPool:configuration:]): Ditto.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::maybeCreate):
(WebKit::WebViewImpl::WebViewImpl):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess): New WebProcess creation might fail. Handle it.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::warmInitialProcess):
(WebKit::WebProcessPool::maybeCreateNewWebProcessRespectingProcessCountLimit): This can now fail
if the process will have a non-default WebsiteDataStore but we've already reached the process cap.
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): Deleted.
* UIProcess/WebProcessPool.h:
2017-02-21 Youenn Fablet <youenn@apple.com>
[WebRTC] WebKit2 should assert that libwebrtc transmitted IP addresses family is IP4 or IP6
https://bugs.webkit.org/show_bug.cgi?id=168691
Reviewed by Alex Christensen.
Adding some asserts that family is IPv4 or IPv6.
* Shared/RTCNetwork.cpp:
(WebKit::RTCNetwork::IPAddress::decode):
(WebKit::RTCNetwork::IPAddress::encode):
2017-02-20 Simon Fraser <simon.fraser@apple.com>
Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch
https://bugs.webkit.org/show_bug.cgi?id=168620
<rdar://problem/30617772>
Reviewed by Tim Horton.
Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and
PlatformCALayer, where it ultimately affects the layer contents format.
This is not supported with UI-side compositing.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetSubpixelAntialiasedLayerTextEnabled):
(WKPreferencesGetSubpixelAntialiasedLayerTextEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _subpixelAntialiasedLayerTextEnabled]):
(-[WKPreferences _setSubpixelAntialiasedLayerTextEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::supportsSubpixelAntialiasedText):
(WebKit::PlatformCALayerRemote::setSupportsSubpixelAntialiasedText):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
(WebKit::PlatformCALayerRemoteTiledBacking::supportsSubpixelAntialiasedText):
(WebKit::PlatformCALayerRemoteTiledBacking::setSupportsSubpixelAntialiasedText):
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
2017-02-21 John Wilander <wilander@apple.com>
Resource Load Statistics: Only scan website data store once per session ID + reinstate removal counting
https://bugs.webkit.org/show_bug.cgi?id=168541
Reviewed by Alex Christensen.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores):
The CallbackAggregator now merges a list of domains for which we
have removed data records and eventually reports this back to the
caller.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
Now reports back to its WebCore::ResourceLoadStatisticsStore
which domains have had data records removed.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains):
The completion handler now handles data record removal counting.
(WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains):
The completion handler now handles data record removal counting.
* UIProcess/WebsiteData/WebsiteDataStore.h:
2017-02-21 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
2017-02-21 Youenn Fablet <youenn@apple.com>
[WebRTC][Mac] Network process sandbox does not allow WebRTC networking
https://bugs.webkit.org/show_bug.cgi?id=168594
Reviewed by Brent Fulgham.
UIProcess was passing a boolean to know whether WebRTC networking is allowed or not to the network process.
This boolean was known to late for the sandbox to be relaxed.
A sandbox extension is now used instead to relax the sandbox.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::NetworkProcess::initializeSandbox):
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
2017-02-21 Youenn Fablet <youenn@apple.com>
[WebRTC] ICE candidates should be filtered according a policy
https://bugs.webkit.org/show_bug.cgi?id=168348
Reviewed by Alex Christensen.
Adding the possibility for the UI process to control the ICE candidate filtering and whether libwebrtc can
enumerate all interfaces or not.
Disabling ICE candidate filtering for the moment.
Enabling to enumerate all interfaces for the moment.
In the future, ICE candidate filtering should be tied to getUserMedia.
Interface enumeration should be disabled with the default configuration.
We should do that once we have sufficient testing in various network infrastructures.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::disableICECandidateFiltering):
(WebKit::WebPage::enableICECandidateFiltering):
(WebKit::WebPage::disableEnumeratingAllNetworkInterfaces):
(WebKit::WebPage::enableEnumeratingAllNetworkInterfaces):
* WebProcess/WebPage/WebPage.messages.in:
2017-02-21 Youenn Fablet <youenn@apple.com>
[WebRTC] NetworkRTCMonitor should ensure clearing its manager only once
https://bugs.webkit.org/show_bug.cgi?id=168661
Reviewed by Alex Christensen.
Making sure NetworkRTCMonitor manager is cleared only once.
ALso ensuring that manager does not get destroyed as part of NetworkRTCMonitor destructor.
The manager needs to be destroyed in the RTC network thread.
* NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
(WebKit::NetworkRTCMonitor::~NetworkRTCMonitor):
(WebKit::NetworkRTCMonitor::stopUpdating):
* NetworkProcess/webrtc/NetworkRTCMonitor.h:
2017-02-21 Brent Fulgham <bfulgham@apple.com>
[WebRTC][Mac][WebKit2] Revise sandbox to limit connections to UDP and TCP
https://bugs.webkit.org/show_bug.cgi?id=168664
<rdar://problem/30600587>
Reviewed by Youenn Fablet.
Add filters to the WebRTC rule to limit network traffic to UDP and TCP.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2017-02-21 Maureen Daum <mdaum@apple.com>
Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
https://bugs.webkit.org/show_bug.cgi?id=168659
rdar://problem/22781730
Reviewed by Brady Eidson.
Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
It is possible that another process has caused information to be added to LocalStorage
after we created this LocalStorageDatabaseTracker instance, so we should update our
internal state by checking the contents of StorageTracker.db and the other local
storage files so we know what databases actually exist. By calling importOriginIdentifiers()
at the start of deleteDatabasesModifiedSince(), m_origins will now have the up-to-date
list of origins LocalStorage contains data for.
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
2017-02-21 Carlos Garcia Campos <cgarcia@igalia.com>
Reduce platform ifdefs in WebKit2 custom protocols implementation
https://bugs.webkit.org/show_bug.cgi?id=165028
Reviewed by Darin Adler.
Make mac implementation use the APICustomProtocolManagerClient to share more code with the soup based ports.
* CMakeLists.txt: Add CustomProtocolManagerProxy.cpp.
* PlatformEfl.cmake: Remove CustomProtocolManagerProxySoup.cpp.
* PlatformGTK.cmake: Ditto.
* PlatformMac.cmake: Remove CustomProtocolManagerProxyMac.mm.
* UIProcess/API/APICustomProtocolManagerClient.h:
(API::CustomProtocolManagerClient::startLoading): Make it void, since we were always returning true and the
returned value was ignored.
* UIProcess/API/efl/ewk_url_scheme_request.cpp:
(EwkUrlSchemeRequest::finish): Update to new CustomProtocolManagerProxy API.
* UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestReadCallback): Ditto.
* UIProcess/Cocoa/CustomProtocolManagerClient.h: Added.
* UIProcess/Cocoa/CustomProtocolManagerClient.mm: Added.
(-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:]):
(-[WKCustomProtocolLoader dealloc]):
(-[WKCustomProtocolLoader connection:didFailWithError:]):
(-[WKCustomProtocolLoader connection:didReceiveResponse:]):
(-[WKCustomProtocolLoader connection:didReceiveData:]):
(-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
(-[WKCustomProtocolLoader connectionDidFinishLoading:]):
(WebKit::CustomProtocolManagerClient::startLoading):
(WebKit::CustomProtocolManagerClient::stopLoading):
(WebKit::CustomProtocolManagerClient::invalidate):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize): Set the CustomProtocolManagerClient.
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
* UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Added.
(WebKit::CustomProtocolManagerProxy::startLoading):
(WebKit::CustomProtocolManagerProxy::processDidClose):
(WebKit::CustomProtocolManagerProxy::wasRedirectedToRequest):
(WebKit::CustomProtocolManagerProxy::didReceiveResponse):
* UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::globalURLSchemesWithCustomProtocolHandlers): Just moved here to use it from ensureNetworkProcess().
(WebKit::WebProcessPool::WebProcessPool): Remove soup ifdefs.
(WebKit::WebProcessPool::setCustomProtocolManagerClient): Moved from the soup implementation.
(WebKit::WebProcessPool::ensureNetworkProcess): Initialize custom protocols parameters.
(WebKit::WebProcessPool::registerSchemeForCustomProtocol): Register the protocol if not already registered globally.
(WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Remove soup ifdefs.
* UIProcess/WebProcessPool.h: Remove soup ifdefs.
* UIProcess/efl/RequestManagerClientEfl.cpp:
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
* WebKit2.xcodeproj/project.pbxproj:
2017-02-21 Daewoong Jang <daewoong.jang@navercorp.com>
Remove unused files.
https://bugs.webkit.org/show_bug.cgi?id=168656.
Reviewed by Csaba Osztrogonác.
Remove files which became unused after removal of EFL port.
* UIProcess/CoordinatedGraphics/PageViewportController.cpp: Removed.
* UIProcess/CoordinatedGraphics/PageViewportController.h: Removed.
* UIProcess/PageViewportControllerClient.h: Removed.
2017-02-21 Youenn Fablet <youenn@apple.com>
[WebRTC] LibWebRTCSocket::SendTo message should have a correct SocketAddress
https://bugs.webkit.org/show_bug.cgi?id=168636
Reviewed by Eric Carlson.
* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::LibWebRTCSocket::SendTo): Ensuring address remains valid during SendTo message lifetime.
2017-02-21 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r212699.
Internal build not ready
Reverted changeset:
"[WebRTC][Mac] Activate libwebrtc"
https://bugs.webkit.org/show_bug.cgi?id=167293
http://trac.webkit.org/changeset/212699
2017-02-20 Carlos Garcia Campos <cgarcia@igalia.com>
Remove ENABLE_THREADED_COMPOSITOR build option
https://bugs.webkit.org/show_bug.cgi?id=168606
Reviewed by Michael Catanzaro.
Now that we have AC mode on demand with the threaded compositor there's no reason to keep the old AC code.
* PlatformGTK.cmake:
* WebProcess/WebPage/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::create):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: Removed.
* WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Removed.
2017-02-20 Youenn Fablet <youenn@apple.com>
[WebRTC][Mac] Activate libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167293
<rdar://problem/30401864>
Reviewed by Alex Christensen.
Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.
* Configurations/WebKit.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/WebPreferences.cpp:
(WebKit::checkWebRTCAvailability):
2017-02-20 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r212685.
This change broke the 32-bit Sierra build.
Reverted changeset:
"Resource Load Statistics: Add alternate classification
method"
https://bugs.webkit.org/show_bug.cgi?id=168347
http://trac.webkit.org/changeset/212685
2017-02-20 John Wilander <wilander@apple.com>
Resource Load Statistics: Add alternate classification method
https://bugs.webkit.org/show_bug.cgi?id=168347
<rdar://problem/30352793>
Reviewed by Alex Christensen.
This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
also adds functions to support layout tests of the feature.
* Configurations/BaseTarget.xcconfig:
* Configurations/WebKit.xcconfig:
Added dependency on CorePrediction.
* Platform/classifier: Added.
* Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
(WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
* Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
(WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
Shared classifier logic.
(WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
Fallback classifier for when we don't have CorePrediction.
* Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
(WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
(WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
* Platform/classifier/cocoa: Added.
* Platform/classifier/cocoa/CorePredictionSPI.h: Added.
Includes CorePrediction if available, otherwise declares needed symbols.
Always redeclares the functions so we'll get a build error if
CorePrediction changes.
* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
(WebKit::ResourceLoadStatisticsClassifier::classify):
(WebKit::ResourceLoadStatisticsClassifier::storagePath):
(WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePrediction):
The new classifier for Cocoa platforms.
* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
(WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
* PlatformGTK.cmake:
Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
* PlatformMac.cmake:
Added Platform/classifier and Platform/classifier/cocoa directories, and
source files ResourceLoadStatisticsClassifierBase.cpp and
ResourceLoadStatisticsClassifierCocoa.cpp
* Resources/ResourceLoadStatistics: Added.
* Resources/ResourceLoadStatistics/corePrediction_model: Added.
Model file to load into CorePrediction.
* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
Test infrastructure.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
Test infrastructure.
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::classifyResource):
Now calls the classifier through its ResourceLoadStatisticsClassifier
member variable.
(WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:
* WebKit2.xcodeproj/project.pbxproj:
Added the new classifier source files under Platform/classifier and the
corePrediction_model file under Resources/ResourceLoadStatistics.
2017-02-20 Wenson Hsieh <wenson_hsieh@apple.com>
Add plumbing to the UI process for TextIndicatorData when computing the drag image
https://bugs.webkit.org/show_bug.cgi?id=168583
Work towards <rdar://problem/30313681>
Reviewed by Tim Horton.
Changes the SetDragImage IPC message to send TextIndicatorData over to the UI process. Also changes the boolean
isLink parameter to be a DragSourceAction instead, leaving it up to the receiving end (in the UI process) to
special case links.
Additionally, renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose.
These changes are only infrastructural should not alter any behaviors.
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _simulateDataInteractionGestureRecognized]):
(-[WKWebView _simulateDataInteractionEntered:]):
(-[WKWebView _simulateDataInteractionUpdated:]):
(-[WKWebView _simulateDataInteractionPerformOperation:]):
(-[WKWebView _simulateDataInteractionEnded:]):
(-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]):
(-[WKWebView _simulateFailedDataInteractionWithIndex:]):
(-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]):
(-[WKWebView _simulatedItemsForDataInteractionWithIndex:]):
* UIProcess/API/Cocoa/_WKTestingDelegate.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setDragImage):
(WebKit::PageClientImpl::startDataInteractionWithImage):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsInDataInteractionContent:]):
(-[WKContentView _dataInteractionGestureRecognizer]):
(-[WKContentView pointIsInAssistedNode:]):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setDragImage):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setDragImage):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
2017-02-20 David Quesada <david_quesada@apple.com>
Don’t set NSURLSessionConfiguration’s _sourceApplicationAuditTokenData if _sourceApplicationBundleIdentifier is also set.
https://bugs.webkit.org/show_bug.cgi?id=168607
rdar://problem/30239618
Reviewed by Geoffrey Garen.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
If the process pool configuration sets a source application bundle identifier, don't give the NSURLSession configuration
the audit token from the UI process, as it may be associated with an application with a conflicting bundle identifier.
2017-02-20 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r212632.
This change appears to have caused API test failures.
Reverted changeset:
"Reduce platform ifdefs in WebKit2 custom protocols
implementation"
https://bugs.webkit.org/show_bug.cgi?id=165028
http://trac.webkit.org/changeset/212632
2017-02-20 Youenn Fablet <youenn@apple.com>
[WebRTC] Fix some memory leaks in libwebrtc binding code
https://bugs.webkit.org/show_bug.cgi?id=168596
Reviewed by Eric Carlson.
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::OnMessage):
2017-02-20 Carlos Garcia Campos <cgarcia@igalia.com>
Remove code under USE(GRAPHICS_SURFACE)
https://bugs.webkit.org/show_bug.cgi?id=168592
Reviewed by Michael Catanzaro.
This was only used by EFL port.
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
(IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::syncPlatformLayerIfNeeded):
(WebKit::CoordinatedGraphicsScene::deleteLayer):
(WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer):
(WebKit::CoordinatedGraphicsScene::purgeGLResources):
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
(WebKit::WebCoordinatedSurface::Handle::encode):
(WebKit::WebCoordinatedSurface::Handle::decode):
(WebKit::WebCoordinatedSurface::create):
(WebKit::WebCoordinatedSurface::createGraphicsContext):
(WebKit::WebCoordinatedSurface::createHandle):
(WebKit::WebCoordinatedSurface::copyToTexture):
* Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
2017-02-20 Carlos Garcia Campos <cgarcia@igalia.com>
Reduce platform ifdefs in WebKit2 custom protocols implementation
https://bugs.webkit.org/show_bug.cgi?id=165028
Reviewed by Darin Adler.
Make mac implementation use the APICustomProtocolManagerClient to share more code with the soup based ports.
* CMakeLists.txt: Add CustomProtocolManagerProxy.cpp.
* PlatformEfl.cmake: Remove CustomProtocolManagerProxySoup.cpp.
* PlatformGTK.cmake: Ditto.
* PlatformMac.cmake: Remove CustomProtocolManagerProxyMac.mm.
* UIProcess/API/APICustomProtocolManagerClient.h:
(API::CustomProtocolManagerClient::startLoading): Make it void, since we were always returning true and the
returned value was ignored.
* UIProcess/API/efl/ewk_url_scheme_request.cpp:
(EwkUrlSchemeRequest::finish): Update to new CustomProtocolManagerProxy API.
* UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestReadCallback): Ditto.
* UIProcess/Cocoa/CustomProtocolManagerClient.h: Added.
* UIProcess/Cocoa/CustomProtocolManagerClient.mm: Added.
(-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:]):
(-[WKCustomProtocolLoader dealloc]):
(-[WKCustomProtocolLoader connection:didFailWithError:]):
(-[WKCustomProtocolLoader connection:didReceiveResponse:]):
(-[WKCustomProtocolLoader connection:didReceiveData:]):
(-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
(-[WKCustomProtocolLoader connectionDidFinishLoading:]):
(WebKit::CustomProtocolManagerClient::startLoading):
(WebKit::CustomProtocolManagerClient::stopLoading):
(WebKit::CustomProtocolManagerClient::invalidate):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize): Set the CustomProtocolManagerClient.
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
* UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Added.
(WebKit::CustomProtocolManagerProxy::startLoading):
(WebKit::CustomProtocolManagerProxy::processDidClose):
(WebKit::CustomProtocolManagerProxy::wasRedirectedToRequest):
(WebKit::CustomProtocolManagerProxy::didReceiveResponse):
* UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::globalURLSchemesWithCustomProtocolHandlers): Just moved here to use it from ensureNetworkProcess().
(WebKit::WebProcessPool::WebProcessPool): Remove soup ifdefs.
(WebKit::WebProcessPool::setCustomProtocolManagerClient): Moved from the soup implementation.
(WebKit::WebProcessPool::ensureNetworkProcess): Initialize custom protocols parameters.
(WebKit::WebProcessPool::registerSchemeForCustomProtocol): Register the protocol if not already registered globally.
(WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Remove soup ifdefs.
* UIProcess/WebProcessPool.h: Remove soup ifdefs.
* UIProcess/efl/RequestManagerClientEfl.cpp:
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
* WebKit2.xcodeproj/project.pbxproj:
2017-02-20 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
https://bugs.webkit.org/show_bug.cgi?id=167693
Reviewed by Sergio Villar Senin.
* Configurations/FeatureDefines.xcconfig:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2017-02-20 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
https://bugs.webkit.org/show_bug.cgi?id=168375
Reviewed by Alex Christensen.
Simplify the cookies change notification. The current approach of the UI process telling the network process
when to start and stop observing cookie changes is quite fragile and error prone. In the GTK+ port we always
observe cookies, so our cookie manager always calls start in the constructor and stop in the destructor.
Everything would be a lot simpler if the network process always monitored cookies.
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup): Set cookies observer handler for the session.
(WebKit::NetworkSessionSoup::~NetworkSessionSoup): Remove the cookies observer handler.
* UIProcess/API/gtk/WebKitCookieManager.cpp:
(_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate): Remove the cookies observer callback.
(webkit_cookie_manager_class_init): Remove dispose implementation that is no longer needed.
(webkitCookieManagerCreate): Set the cookies observer callback.
(webkit_cookie_manager_set_persistent_storage): Remove code to start/stop observing cookies when the jar
changes, the network process deals with that now.
(webkitCookieManagerDispose): Deleted.
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::startObservingCookieChanges): Remove the optional callback method in favor of an
explicit method to the set the callback that doesn't send the StartObservingCookieChanges message to the network
process.
(WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Do not change the callback map here.
(WebKit::WebCookieManagerProxy::setCookieObserverCallback): Add the callback to the map or remove the session if
nullptr is given.
* UIProcess/WebCookieManagerProxy.h:
* WebProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::notifyCookiesDidChange): Send CookiesDidChange message to the UI process.
(WebKit::WebCookieManager::startObservingCookieChanges): Use notifyCookiesDidChange().
* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Set the policy on all sessions. Code moved from
WebFrameNetworkingContext since it doesn't belong there.
(WebKit::WebCookieManager::setCookiePersistentStorage): Use new method to set the cookie storage in the
NetworkStorageSession.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
2017-02-19 Chris Dumez <cdumez@apple.com>
[WK2] Support termination of unresponsive WebContent processes that are in the background
https://bugs.webkit.org/show_bug.cgi?id=168479
<rdar://problem/30558745>
Reviewed by Antti Koivisto.
Support termination of unresponsive WebContent processes that are in the background.
This protects us against cases where a background tab is unresponsive and has high CPU
usage, thus draining the battery without the user knowing about it (e.g.
<rdar://problem/29808005>).
The feature works as follows:
- If a WebProcessProxy has pages but none of them are visible, then it will check
regularly if its associated WebContent process is still responsive.
- Every time we find that the WebContent process is responsive, we exponentially
back off the timer to avoid waking up the process too often. The timer initially
uses a 20 seconds interval and can back off up to 8 hours.
- If the WebContent process is unresponsive, then we terminate it. No notification
is shown to the user and the termination is not immediately observable since the
tab is not visible and its title remains. The tab is not immediately reloaded
so as to avoid getting back into a bad state in the background (and have a
yo-yo effect).
- If the user switches to a tab that was previously killed for being unresponsive
while in the background, we will then reload the tab in a fresh WebContent
process. The crash banner will only be shown if the tab has ever been visible.
If it wasn't ever visible (e.g. session restore case), then it will look as if
the tab loads for the first time when the user switches to it.
The functionality is disabled by default and can be enabled by the client via the new
WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled() private API.
* CMakeLists.txt:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/UnresponsiveWebProcessTerminator.cpp: Added.
(WebKit::UnresponsiveWebProcessTerminator::UnresponsiveWebProcessTerminator):
(WebKit::UnresponsiveWebProcessTerminator::updateState):
(WebKit::pagesCopy):
(WebKit::UnresponsiveWebProcessTerminator::timerFired):
* UIProcess/UnresponsiveWebProcessTerminator.h: Added.
(WebKit::UnresponsiveWebProcessTerminator::shouldBeActive):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::reloadAfterBeingKilledInBackground):
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::terminateProcess):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::m_backgroundResponsivenessTimer):
(WebKit::WebProcessProxy::createWebPage):
(WebKit::WebProcessProxy::addExistingWebPage):
(WebKit::WebProcessProxy::removeWebPage):
(WebKit::WebProcessProxy::updateBackgroundResponsivenessTimer):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::visiblePageCount):
* WebKit2.xcodeproj/project.pbxproj:
2017-02-18 Michael Catanzaro <mcatanzaro@igalia.com>
Remove COORDINATED_GRAPHICS_MULTIPROCESS
https://bugs.webkit.org/show_bug.cgi?id=168514
Reviewed by Darin Adler.
* Shared/DrawingAreaInfo.h:
* UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
(WKViewFindZoomableAreaForRect):
* UIProcess/AcceleratedDrawingAreaProxy.cpp:
(WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
* UIProcess/AcceleratedDrawingAreaProxy.h:
(WebKit::AcceleratedDrawingAreaProxy::coordinatedLayerTreeHostProxy): Deleted.
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp: Removed.
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h: Removed.
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in: Removed.
* UIProcess/CoordinatedGraphics/PageViewportController.cpp:
(WebKit::PageViewportController::pageTransitionViewportReady):
* UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp: Removed.
* UIProcess/DrawingAreaProxy.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::pageDidRequestScroll): Deleted.
(WebKit::WebPageProxy::pageTransitionViewportReady): Deleted.
(WebKit::WebPageProxy::didRenderFrame): Deleted.
(WebKit::WebPageProxy::commitPageTransitionViewport): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
(WebKit::AcceleratedDrawingArea::updateBackingStoreState):
(WebKit::AcceleratedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage): Deleted.
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
(WebKit::CoordinatedLayerTreeHost::commitSceneState):
(WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: Removed.
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create):
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::create):
* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::~WebPage):
(WebKit::WebPage::pageDidRequestScroll):
(WebKit::WebPage::didCompletePageTransition):
(WebKit::WebPage::didReceiveMessage):
(WebKit::WebPage::commitPageTransitionViewport): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2017-02-18 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Cannot paste primary selection into web view in Wayland
https://bugs.webkit.org/show_bug.cgi?id=166949
Reviewed by Carlos Garcia Campos.
Once upon a time, primary selection (middle-click paste) was not supported in Wayland. At
the time, I changed this function to report that primary selection was unsupported. But
nowadays, primary selection works fine in all GTK+ applications except WebKit. All we have
to do to make it work in WebKit is change this return value.
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::supportsGlobalSelection):
2017-02-17 Brian Burg <bburg@apple.com>
Web Inspector: RTL: Inspector window should dock to the left when using RTL layout direction
https://bugs.webkit.org/show_bug.cgi?id=168273
<rdar://problem/29949325>
Reviewed by Matt Baker.
Add the ability to dock Web Inspector to the left of the inspected view.
The frontend decides whether the Dock to Side button docks left or right
based on the current layout direction.
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::attachLeft):
(WebKit::WebInspectorProxy::attach):
(WebKit::WebInspectorProxy::createInspectorPage):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
Add plumbing for new dock configuration.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
(WebKit::WebInspectorProxy::platformAttach):
Adapt existing sizing logic to work for docking to left.
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::requestSetDockSide):
(WebKit::WebInspectorUI::setDockSide):
* WebProcess/WebPage/WebInspectorUI.h:
(WebKit::WebInspectorUI::attachedLeft):
* WebProcess/WebPage/WebInspectorUI.messages.in:
Add plumbing for new dock configuration.
2017-02-16 Simon Fraser <simon.fraser@apple.com>
Allow PlatformCALayers to specify that they want deep color backing store
https://bugs.webkit.org/show_bug.cgi?id=168495
Reviewed by Tim Horton.
Currently capable iOS devices get deep color backing store by virtue of a supports
check in PlatformCALayerCocoa::PlatformCALayerCocoa(), and LegacyTileGridTile.
Future work will make layer contents format selection more complex, so express the need
for deep color on PlatformCALayer, and have the creators of PlatformCALayer (mainly the
flavors of GraphicsLayerCA) choose for them to support deep color. A bit of special-casing
is needed to propagte the state to TileControllers.
The deep-colorness now propagates from PlatformCALayerRemote to RemoteLayerBackingStore,
instead of RemoteLayerBackingStore looking at the properties of the screen directly.
Remove PlatformCALayer::LayerTypeWebTiledLayer which was only used for the old CATiledLayers
that we no longer use.
* Shared/mac/RemoteLayerBackingStore.h:
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::ensureBackingStore):
(WebKit::RemoteLayerBackingStore::bytesPerPixel):
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
(WebKit::RemoteLayerBackingStore::drawInContext):
(WebKit::RemoteLayerBackingStore::surfaceBufferFormat):
(WebKit::bufferFormat): Deleted.
* WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::createPlatformCALayer):
* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
(WebKit::PlatformCALayerRemote::updateBackingStore):
(WebKit::PlatformCALayerRemote::wantsDeepColorBackingStore):
(WebKit::PlatformCALayerRemote::setWantsDeepColorBackingStore):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
(WebKit::PlatformCALayerRemoteTiledBacking::wantsDeepColorBackingStore):
(WebKit::PlatformCALayerRemoteTiledBacking::setWantsDeepColorBackingStore):
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
2017-02-17 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Action sheet should not dismiss when a DDAction with user interface is being presented
https://bugs.webkit.org/show_bug.cgi?id=168528
<rdar://problem/30515324>
Reviewed by Beth Dakin.
After r211643, -[WKActionSheet doneWithSheet] now dismisses the presenting view controller. This is called when
interaction with the sheet is finished and is a reasonable thing to do in most cases. However, when using data
detectors, we don't want to dismiss the presenting view controller, since DataDetector handles dismissing on its
own and expects that its completion handler will be invoked.
To fix this, we add a parameter to doneWithSheet: to indicate whether or not we should additionally dismiss the
presenting view controller, and pass in NO in the case where we are handing control over to DataDetector.
* UIProcess/ios/WKActionSheet.h:
* UIProcess/ios/WKActionSheet.mm:
(-[WKActionSheet doneWithSheet:]):
(-[WKActionSheet doneWithSheet]): Deleted.
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showDataDetectorsSheet]):
(-[WKActionSheetAssistant cleanupSheet]):
2017-02-17 Michael Catanzaro <mcatanzaro@igalia.com>
Remove EFL from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=168511
Reviewed by Alex Christensen.
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::platformInvalidate):
(IPC::Connection::open):
* Platform/Module.h:
* PlatformEfl.cmake: Removed.
* PluginProcess/unix/PluginProcessMainUnix.cpp:
* Shared/API/APIObject.h:
* Shared/API/c/WKBase.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
(WebKit::toImpl):
* Shared/NativeWebKeyboardEvent.h:
(WebKit::NativeWebKeyboardEvent::isFakeEventForComposition):
(WebKit::NativeWebKeyboardEvent::isFiltered): Deleted.
* Shared/NativeWebMouseEvent.h:
(WebKit::NativeWebMouseEvent::nativeEvent):
(WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Deleted.
* Shared/NativeWebTouchEvent.h:
(WebKit::NativeWebTouchEvent::nativeEvent):
* Shared/NativeWebWheelEvent.h:
(WebKit::NativeWebWheelEvent::nativeEvent):
* Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
(WebKit::NetscapePluginModule::determineQuirks):
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/APIWebsiteDataStore.cpp:
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKTextChecker.cpp:
* UIProcess/API/C/WKTextChecker.h:
* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::getLaunchOptions):
* UIProcess/CoordinatedGraphics/PageViewportController.cpp:
(WebKit::PageViewportController::pixelAlignedFloatPoint):
* UIProcess/InspectorServer/WebInspectorServer.h:
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
* UIProcess/PageClient.h:
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::scanPlugin):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
(WebKit::getPluginDisplay):
(WebKit::x11Screen):
(WebKit::displayDepth):
(WebKit::rootWindowID):
(WebKit::NetscapePluginX11::paint):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
(WebKit::WebChromeClient::pageExtendedBackgroundColorDidChange):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::shouldEraseMarkersAfterChangeSelection):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::saveViewStateToItem):
(WebKit::WebFrameLoaderClient::restoreViewState):
(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* config.h:
2017-02-15 Brady Eidson <beidson@apple.com>
Stop backing up localStorage databases to iCloud by default.
<rdar://problem/29045531> and https://bugs.webkit.org/show_bug.cgi?id=168388
Reviewed by Geoffrey Garen.
* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::databasePath):
* UIProcess/Storage/LocalStorageDatabaseTracker.h:
* UIProcess/Storage/ios/LocalStorageDatabaseTrackerIOS.mm: Copied from Source/WebKit2/UIProcess/Cocoa/VersionChecks.h.
(WebKit::LocalStorageDatabaseTracker::platformExcludeFromBackup):
* WebKit2.xcodeproj/project.pbxproj:
2017-02-16 Aakash Jain <aakash_jain@apple.com>
Remove unused methods WKPageGetDebugPaintFlags and WKPageSetDebugPaintFlags
https://bugs.webkit.org/show_bug.cgi?id=168464
Reviewed by Alexey Proskuryakov.
* UIProcess/API/C/WKPagePrivate.h:
2017-02-16 Youenn Fablet <youenn@apple.com>
[WebRTC] libwebrtc socket addresses should not be passed as strings
https://bugs.webkit.org/show_bug.cgi?id=168474
Reviewed by Alex Christensen.
Removing all seralization of socket addresses as strings.
Instead, a dedicated serialization is provided.
This allows proper handling of various cases like addresses with both hostnames and resolved IPs.
* NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
(WebKit::LibWebRTCSocketClient::signalReadPacket):
(WebKit::LibWebRTCSocketClient::signalSentPacket):
(WebKit::LibWebRTCSocketClient::signalAddressReady):
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createUDPSocket):
(WebKit::NetworkRTCProvider::createServerTCPSocket):
(WebKit::NetworkRTCProvider::createClientTCPSocket):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
* NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
* NetworkProcess/webrtc/NetworkRTCSocket.cpp:
(WebKit::NetworkRTCSocket::sendTo):
* NetworkProcess/webrtc/NetworkRTCSocket.h:
* NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
* Shared/RTCNetwork.cpp:
(WebKit::RTCNetwork::SocketAddress::decode):
(WebKit::RTCNetwork::SocketAddress::encode):
* Shared/RTCNetwork.h:
(WebKit::RTCNetwork::SocketAddress::SocketAddress):
* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::LibWebRTCSocket::signalAddressReady):
(WebKit::LibWebRTCSocket::SendTo):
* WebProcess/Network/webrtc/LibWebRTCSocket.h:
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
(WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
(WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
* WebProcess/Network/webrtc/WebRTCSocket.cpp:
(WebKit::WebRTCSocket::signalAddressReady):
* WebProcess/Network/webrtc/WebRTCSocket.h:
* WebProcess/Network/webrtc/WebRTCSocket.messages.in:
2017-02-16 Daniel Bates <dabates@apple.com>
Remove Chromium-specific code to call FrameLoaderClient::redirectDataToPlugin(nullptr)
https://bugs.webkit.org/show_bug.cgi?id=168417
<rdar://problem/30541748>
Reviewed by Brent Fulgham.
Update override of FrameLoaderClient::redirectDataToPlugin() to take a Widget& instead of a
Widget* as it is always called with a valid Widget.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::redirectDataToPlugin):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* mac/WebKit2.order: Remove symbol for WebFrameLoaderClient::redirectDataToPlugin() that took a Widget*
as it no longer exists. I am unclear if this file is still meaningful as it was last modified in
r180570 (2 years ago) though Xcode still references this ordering file (why?).
2017-02-16 Alex Christensen <achristensen@webkit.org>
Remove EFL-specific files in WebKit2.
Rubber-stamped by Anders Carlsson
* DatabaseProcess/efl: Removed.
* DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Removed.
* NetworkProcess/Downloads/efl: Removed.
* NetworkProcess/Downloads/efl/DownloadSoupErrorsEfl.cpp: Removed.
* NetworkProcess/efl: Removed.
* NetworkProcess/efl/NetworkProcessMainEfl.cpp: Removed.
* Platform/efl: Removed.
* Platform/efl/ModuleEfl.cpp: Removed.
* Shared/API/c/efl: Removed.
* Shared/API/c/efl/WKArrayEfl.cpp: Removed.
* Shared/API/c/efl/WKArrayEfl.h: Removed.
* Shared/API/c/efl/WKBaseEfl.h: Removed.
* Shared/efl: Removed.
* Shared/efl/NativeWebKeyboardEventEfl.cpp: Removed.
* Shared/efl/NativeWebTouchEventEfl.cpp: Removed.
* Shared/efl/NativeWebWheelEventEfl.cpp: Removed.
* Shared/efl/ProcessExecutablePathEfl.cpp: Removed.
* Shared/efl/WebEventFactory.cpp: Removed.
* Shared/efl/WebEventFactory.h: Removed.
* UIProcess/API/C/efl: Removed.
* UIProcess/API/C/efl/WKAPICastEfl.h: Removed.
* UIProcess/API/C/efl/WKColorPickerResultListener.cpp: Removed.
* UIProcess/API/C/efl/WKColorPickerResultListener.h: Removed.
* UIProcess/API/C/efl/WKEventEfl.cpp: Removed.
* UIProcess/API/C/efl/WKEventEfl.h: Removed.
* UIProcess/API/C/efl/WKViewEfl.cpp: Removed.
* UIProcess/API/C/efl/WKViewEfl.h: Removed.
* UIProcess/API/cpp/efl: Removed.
* UIProcess/API/cpp/efl/WKEinaSharedString.cpp: Removed.
* UIProcess/API/cpp/efl/WKEinaSharedString.h: Removed.
* UIProcess/API/efl: Removed.
* UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp: Removed.
* UIProcess/API/efl/EWebKit2.h.in: Removed.
* UIProcess/API/efl/EwkView.cpp: Removed.
* UIProcess/API/efl/EwkView.h: Removed.
* UIProcess/API/efl/EwkViewCallbacks.h: Removed.
* UIProcess/API/efl/GestureRecognizer.cpp: Removed.
* UIProcess/API/efl/GestureRecognizer.h: Removed.
* UIProcess/API/efl/SnapshotImageGL.cpp: Removed.
* UIProcess/API/efl/SnapshotImageGL.h: Removed.
* UIProcess/API/efl/WebAccessibility.cpp: Removed.
* UIProcess/API/efl/WebAccessibility.h: Removed.
* UIProcess/API/efl/ewk_application_cache_manager.cpp: Removed.
* UIProcess/API/efl/ewk_application_cache_manager.h: Removed.
* UIProcess/API/efl/ewk_application_cache_manager_private.h: Removed.
* UIProcess/API/efl/ewk_auth_request.cpp: Removed.
* UIProcess/API/efl/ewk_auth_request.h: Removed.
* UIProcess/API/efl/ewk_auth_request_private.h: Removed.
* UIProcess/API/efl/ewk_back_forward_list.cpp: Removed.
* UIProcess/API/efl/ewk_back_forward_list.h: Removed.
* UIProcess/API/efl/ewk_back_forward_list_item.cpp: Removed.
* UIProcess/API/efl/ewk_back_forward_list_item.h: Removed.
* UIProcess/API/efl/ewk_back_forward_list_item_private.h: Removed.
* UIProcess/API/efl/ewk_back_forward_list_private.h: Removed.
* UIProcess/API/efl/ewk_color_picker.cpp: Removed.
* UIProcess/API/efl/ewk_color_picker.h: Removed.
* UIProcess/API/efl/ewk_color_picker_private.h: Removed.
* UIProcess/API/efl/ewk_context.cpp: Removed.
* UIProcess/API/efl/ewk_context.h: Removed.
* UIProcess/API/efl/ewk_context_menu.cpp: Removed.
* UIProcess/API/efl/ewk_context_menu.h: Removed.
* UIProcess/API/efl/ewk_context_menu_item.cpp: Removed.
* UIProcess/API/efl/ewk_context_menu_item.h: Removed.
* UIProcess/API/efl/ewk_context_menu_item_private.h: Removed.
* UIProcess/API/efl/ewk_context_menu_private.h: Removed.
* UIProcess/API/efl/ewk_context_private.h: Removed.
* UIProcess/API/efl/ewk_cookie_manager.cpp: Removed.
* UIProcess/API/efl/ewk_cookie_manager.h: Removed.
* UIProcess/API/efl/ewk_cookie_manager_private.h: Removed.
* UIProcess/API/efl/ewk_database_manager.cpp: Removed.
* UIProcess/API/efl/ewk_database_manager.h: Removed.
* UIProcess/API/efl/ewk_database_manager_private.h: Removed.
* UIProcess/API/efl/ewk_download_job.cpp: Removed.
* UIProcess/API/efl/ewk_download_job.h: Removed.
* UIProcess/API/efl/ewk_download_job_private.h: Removed.
* UIProcess/API/efl/ewk_error.cpp: Removed.
* UIProcess/API/efl/ewk_error.h: Removed.
* UIProcess/API/efl/ewk_error_private.h: Removed.
* UIProcess/API/efl/ewk_favicon_database.cpp: Removed.
* UIProcess/API/efl/ewk_favicon_database.h: Removed.
* UIProcess/API/efl/ewk_favicon_database_private.h: Removed.
* UIProcess/API/efl/ewk_file_chooser_request.cpp: Removed.
* UIProcess/API/efl/ewk_file_chooser_request.h: Removed.
* UIProcess/API/efl/ewk_file_chooser_request_private.h: Removed.
* UIProcess/API/efl/ewk_form_submission_request.cpp: Removed.
* UIProcess/API/efl/ewk_form_submission_request.h: Removed.
* UIProcess/API/efl/ewk_form_submission_request_private.h: Removed.
* UIProcess/API/efl/ewk_intro.h: Removed.
* UIProcess/API/efl/ewk_main.cpp: Removed.
* UIProcess/API/efl/ewk_main.h: Removed.
* UIProcess/API/efl/ewk_main_private.h: Removed.
* UIProcess/API/efl/ewk_navigation_data.cpp: Removed.
* UIProcess/API/efl/ewk_navigation_data.h: Removed.
* UIProcess/API/efl/ewk_navigation_data_private.h: Removed.
* UIProcess/API/efl/ewk_navigation_policy_decision.cpp: Removed.
* UIProcess/API/efl/ewk_navigation_policy_decision.h: Removed.
* UIProcess/API/efl/ewk_navigation_policy_decision_private.h: Removed.
* UIProcess/API/efl/ewk_object.cpp: Removed.
* UIProcess/API/efl/ewk_object.h: Removed.
* UIProcess/API/efl/ewk_object_private.h: Removed.
* UIProcess/API/efl/ewk_page_group.cpp: Removed.
* UIProcess/API/efl/ewk_page_group.h: Removed.
* UIProcess/API/efl/ewk_page_group_private.h: Removed.
* UIProcess/API/efl/ewk_popup_menu.cpp: Removed.
* UIProcess/API/efl/ewk_popup_menu.h: Removed.
* UIProcess/API/efl/ewk_popup_menu_item.cpp: Removed.
* UIProcess/API/efl/ewk_popup_menu_item.h: Removed.
* UIProcess/API/efl/ewk_popup_menu_item_private.h: Removed.
* UIProcess/API/efl/ewk_popup_menu_private.h: Removed.
* UIProcess/API/efl/ewk_security_origin.cpp: Removed.
* UIProcess/API/efl/ewk_security_origin.h: Removed.
* UIProcess/API/efl/ewk_security_origin_private.h: Removed.
* UIProcess/API/efl/ewk_settings.cpp: Removed.
* UIProcess/API/efl/ewk_settings.h: Removed.
* UIProcess/API/efl/ewk_settings_private.h: Removed.
* UIProcess/API/efl/ewk_storage_manager.cpp: Removed.
* UIProcess/API/efl/ewk_storage_manager.h: Removed.
* UIProcess/API/efl/ewk_storage_manager_private.h: Removed.
* UIProcess/API/efl/ewk_text_checker.cpp: Removed.
* UIProcess/API/efl/ewk_text_checker.h: Removed.
* UIProcess/API/efl/ewk_text_checker_private.h: Removed.
* UIProcess/API/efl/ewk_touch.h: Removed.
* UIProcess/API/efl/ewk_url_request.cpp: Removed.
* UIProcess/API/efl/ewk_url_request.h: Removed.
* UIProcess/API/efl/ewk_url_request_private.h: Removed.
* UIProcess/API/efl/ewk_url_response.cpp: Removed.
* UIProcess/API/efl/ewk_url_response.h: Removed.
* UIProcess/API/efl/ewk_url_response_private.h: Removed.
* UIProcess/API/efl/ewk_url_scheme_request.cpp: Removed.
* UIProcess/API/efl/ewk_url_scheme_request.h: Removed.
* UIProcess/API/efl/ewk_url_scheme_request_private.h: Removed.
* UIProcess/API/efl/ewk_view.cpp: Removed.
* UIProcess/API/efl/ewk_view.h: Removed.
* UIProcess/API/efl/ewk_view_configuration.cpp: Removed.
* UIProcess/API/efl/ewk_view_configuration.h: Removed.
* UIProcess/API/efl/ewk_view_configuration_private.h: Removed.
* UIProcess/API/efl/ewk_view_private.h: Removed.
* UIProcess/API/efl/ewk_window_features.cpp: Removed.
* UIProcess/API/efl/ewk_window_features.h: Removed.
* UIProcess/API/efl/ewk_window_features_private.h: Removed.
* UIProcess/API/efl/tests: Removed.
* UIProcess/API/efl/tests/UnitTestUtils: Removed.
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: Removed.
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h: Removed.
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp: Removed.
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h: Removed.
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestMain.cpp: Removed.
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestServer.cpp: Removed.
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestServer.h: Removed.
* UIProcess/API/efl/tests/extensions: Removed.
* UIProcess/API/efl/tests/extensions/extension_sample.cpp: Removed.
* UIProcess/API/efl/tests/resources: Removed.
* UIProcess/API/efl/tests/resources/Page1.html: Removed.
* UIProcess/API/efl/tests/resources/Page2.html: Removed.
* UIProcess/API/efl/tests/resources/Page3.html: Removed.
* UIProcess/API/efl/tests/resources/blank.ico: Removed.
* UIProcess/API/efl/tests/resources/default_test_page.html: Removed.
* UIProcess/API/efl/tests/resources/empty_theme.edj: Removed.
* UIProcess/API/efl/tests/resources/file_chooser.html: Removed.
* UIProcess/API/efl/tests/resources/frame_flattening_test.html: Removed.
* UIProcess/API/efl/tests/resources/frame_flattening_test_subframe.html: Removed.
* UIProcess/API/efl/tests/resources/local_file_access.html: Removed.
* UIProcess/API/efl/tests/resources/redirect_url_to_default.html: Removed.
* UIProcess/API/efl/tests/resources/resultMHTML.mht: Removed.
* UIProcess/API/efl/tests/resources/same_page_navigation.html: Removed.
* UIProcess/API/efl/tests/resources/spelling_selection_tests.html: Removed.
* UIProcess/API/efl/tests/resources/spelling_test.html: Removed.
* UIProcess/API/efl/tests/resources/test.pdf: Removed.
* UIProcess/API/efl/tests/resources/window_move_resize.html: Removed.
* UIProcess/API/efl/tests/test_ewk2_accessibility.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_auth_request.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_color_picker.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_context.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_context_history_callbacks.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_context_menu.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_database_manager.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_download_job.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_file_chooser_request.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_javascript_binding.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_object.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_page.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_page_group.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_popup_menu.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_settings.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_ssl.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_storage_manager.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_text_checker.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_view.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_view_configuration.cpp: Removed.
* UIProcess/API/efl/tests/test_ewk2_window_features.cpp: Removed.
* UIProcess/InspectorServer/efl: Removed.
* UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp: Removed.
* UIProcess/Launcher/efl: Removed.
* UIProcess/Launcher/efl/ProcessLauncherEfl.cpp: Removed.
* UIProcess/efl: Removed.
* UIProcess/efl/ContextHistoryClientEfl.cpp: Removed.
* UIProcess/efl/ContextHistoryClientEfl.h: Removed.
* UIProcess/efl/ContextMenuClientEfl.cpp: Removed.
* UIProcess/efl/ContextMenuClientEfl.h: Removed.
* UIProcess/efl/DownloadManagerEfl.cpp: Removed.
* UIProcess/efl/DownloadManagerEfl.h: Removed.
* UIProcess/efl/EasingCurves.cpp: Removed.
* UIProcess/efl/EasingCurves.h: Removed.
* UIProcess/efl/EwkDebug.h: Removed.
* UIProcess/efl/EwkTouchEvent.cpp: Removed.
* UIProcess/efl/EwkTouchEvent.h: Removed.
* UIProcess/efl/EwkTouchPoint.cpp: Removed.
* UIProcess/efl/EwkTouchPoint.h: Removed.
* UIProcess/efl/FindClientEfl.cpp: Removed.
* UIProcess/efl/FindClientEfl.h: Removed.
* UIProcess/efl/FormClientEfl.cpp: Removed.
* UIProcess/efl/FormClientEfl.h: Removed.
* UIProcess/efl/InputMethodContextEfl.cpp: Removed.
* UIProcess/efl/InputMethodContextEfl.h: Removed.
* UIProcess/efl/PageLoadClientEfl.cpp: Removed.
* UIProcess/efl/PageLoadClientEfl.h: Removed.
* UIProcess/efl/PagePolicyClientEfl.cpp: Removed.
* UIProcess/efl/PagePolicyClientEfl.h: Removed.
* UIProcess/efl/PageUIClientEfl.cpp: Removed.
* UIProcess/efl/PageUIClientEfl.h: Removed.
* UIProcess/efl/PageViewportControllerClientEfl.cpp: Removed.
* UIProcess/efl/PageViewportControllerClientEfl.h: Removed.
* UIProcess/efl/RequestManagerClientEfl.cpp: Removed.
* UIProcess/efl/RequestManagerClientEfl.h: Removed.
* UIProcess/efl/TextCheckerClientEfl.cpp: Removed.
* UIProcess/efl/TextCheckerClientEfl.h: Removed.
* UIProcess/efl/TextCheckerEfl.cpp: Removed.
* UIProcess/efl/VibrationClientEfl.cpp: Removed.
* UIProcess/efl/VibrationClientEfl.h: Removed.
* UIProcess/efl/ViewClientEfl.cpp: Removed.
* UIProcess/efl/ViewClientEfl.h: Removed.
* UIProcess/efl/WebColorPickerClient.cpp: Removed.
* UIProcess/efl/WebColorPickerClient.h: Removed.
* UIProcess/efl/WebColorPickerEfl.cpp: Removed.
* UIProcess/efl/WebColorPickerEfl.h: Removed.
* UIProcess/efl/WebColorPickerResultListenerProxy.cpp: Removed.
* UIProcess/efl/WebColorPickerResultListenerProxy.h: Removed.
* UIProcess/efl/WebContextMenuProxyEfl.cpp: Removed.
* UIProcess/efl/WebContextMenuProxyEfl.h: Removed.
* UIProcess/efl/WebInspectorProxyEfl.cpp: Removed.
* UIProcess/efl/WebPageProxyEfl.cpp: Removed.
* UIProcess/efl/WebPopupItemEfl.cpp: Removed.
* UIProcess/efl/WebPopupItemEfl.h: Removed.
* UIProcess/efl/WebPopupMenuProxyEfl.cpp: Removed.
* UIProcess/efl/WebPopupMenuProxyEfl.h: Removed.
* UIProcess/efl/WebPreferencesEfl.cpp: Removed.
* UIProcess/efl/WebProcessPoolEfl.cpp: Removed.
* UIProcess/efl/WebView.cpp: Removed.
* UIProcess/efl/WebView.h: Removed.
* UIProcess/efl/WebViewClient.cpp: Removed.
* UIProcess/efl/WebViewClient.h: Removed.
* WebProcess/InjectedBundle/API/efl: Removed.
* WebProcess/InjectedBundle/API/efl/EWebKit_Extension.h: Removed.
* WebProcess/InjectedBundle/API/efl/ewk_extension.cpp: Removed.
* WebProcess/InjectedBundle/API/efl/ewk_extension.h: Removed.
* WebProcess/InjectedBundle/API/efl/ewk_extension_private.h: Removed.
* WebProcess/InjectedBundle/API/efl/ewk_page.cpp: Removed.
* WebProcess/InjectedBundle/API/efl/ewk_page.h: Removed.
* WebProcess/InjectedBundle/API/efl/ewk_page_private.h: Removed.
* WebProcess/InjectedBundle/efl: Removed.
* WebProcess/InjectedBundle/efl/InjectedBundleEfl.cpp: Removed.
* WebProcess/WebCoreSupport/efl: Removed.
* WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp: Removed.
* WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp: Removed.
* WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp: Removed.
* WebProcess/WebCoreSupport/efl/WebPopupMenuEfl.cpp: Removed.
* WebProcess/WebPage/efl: Removed.
* WebProcess/WebPage/efl/WebInspectorUIEfl.cpp: Removed.
* WebProcess/WebPage/efl/WebPageEfl.cpp: Removed.
* WebProcess/efl: Removed.
* WebProcess/efl/ExtensionManagerEfl.cpp: Removed.
* WebProcess/efl/ExtensionManagerEfl.h: Removed.
* WebProcess/efl/WebInjectedBundleMainEfl.cpp: Removed.
* WebProcess/efl/WebProcessMainEfl.cpp: Removed.
* efl: Removed.
* efl/EWebKit2Config.cmake.in: Removed.
* efl/EWebKit2ConfigVersion.cmake.in: Removed.
* efl/ewebkit2-extension.pc.in: Removed.
* efl/ewebkit2.pc.in: Removed.
2017-02-16 Alex Christensen <achristensen@webkit.org>
Remove old URL parser
https://bugs.webkit.org/show_bug.cgi?id=168483
Reviewed by Tim Horton.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* Shared/Cocoa/WebKit2InitializeCocoa.mm: Removed.
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer):
* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):
* Shared/WebKit2Initialize.h:
(): Deleted.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/efl/WebKit2InitializeEFL.cpp: Removed.
* Shared/gtk/WebKit2InitializeGTK.cpp: Removed.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::createNewWebProcess):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
2017-02-16 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Add additional test infrastructure and unit tests for data interaction
https://bugs.webkit.org/show_bug.cgi?id=168439
<rdar://problem/30557942>
Reviewed by Tim Horton.
Adds two new _WKTestingDelegate protocol methods that are fired when a 'start data interaction' request has been
sent to the web process, and when a response has been received. See Tools/ChangeLog for more details.
* UIProcess/API/Cocoa/_WKTestingDelegate.h:
2017-02-16 Aakash Jain <aakash_jain@apple.com>
Remove unused method WKBundlePageCopyContextMenuItemTitle
https://bugs.webkit.org/show_bug.cgi?id=168456
Reviewed by Dan Bernstein.
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Removed WKBundlePageCopyContextMenuItemTitle.
2017-02-16 Aakash Jain <aakash_jain@apple.com>
Remove unused WKContextGetProcessSuppressionEnabled and WKContextSetProcessSuppressionEnabled
https://bugs.webkit.org/show_bug.cgi?id=168460
Reviewed by Dan Bernstein.
* UIProcess/API/C/mac/WKContextPrivateMac.h:
2017-02-16 Aakash Jain <aakash_jain@apple.com>
Removed unused method WKContextGetProcessModel
https://bugs.webkit.org/show_bug.cgi?id=168457
Reviewed by Dan Bernstein.
* UIProcess/API/C/WKContext.h: Removed WKContextGetProcessModel.
2017-02-16 Tim Horton <timothy_horton@apple.com>
WKWebView inside a UICollectionView flashes when items are inserted above it
https://bugs.webkit.org/show_bug.cgi?id=168376
<rdar://problem/29322051>
Reviewed by Simon Fraser.
Previously, we would immediately send visible content rect updates
whenever we scrolled, or our frame or bounds changed, or ... a whole
bunch of other things. This message would be immediately sent to the
Web Content process, and coalesced at the whims of the Web Content process
main thread. However, if we received multiple such updates within the
same runloop cycle in the UI process, the Web Content process could
send back layer tree commits for intermediate states that would
never make it to the screen.
In the UICollectionView case, UIKit would first scroll to the new location
(potentially putting the WKWebView totally off-screen), and then update
our frame (back on screen), and we would get two layer tree commits;
one, with less tile coverage than needed to cover the area, and another
with full coverage.
Instead, wait until just before we commit the UI-side layer tree (and
thus everyone is done moving things around) to push the new visible
rect info to the Web Content process.
So far, I have not found a way to test that reliably fails before
and reliably passes after without adding a ton of supporting code to WebKit.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _didFinishScrolling]):
(-[WKWebView scrollViewDidScroll:]):
(-[WKWebView scrollViewDidZoom:]):
(-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
(-[WKWebView _scrollViewDidInterruptDecelerating:]):
(-[WKWebView _didScroll]):
(-[WKWebView _enclosingScrollerScrollingEnded:]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _scheduleVisibleContentRectUpdate]):
(-[WKWebView _scrollViewIsInStableState:]):
(-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
(-[WKWebView _setObscuredInsets:]):
(-[WKWebView _endInteractiveObscuredInsetsChange]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _endAnimatedResize]):
(-[WKWebView _updateVisibleContentRects]): Deleted.
(-[WKWebView _updateVisibleContentRectAfterScrollInView:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _didCommitLayerTree:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
(-[WKContentView _stopAssistingNode]):
* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView setContentInset:]):
Have existing callers of _updateVisibleContentRect* instead call
_scheduleVisibleContentRectUpdate*.
In _scheduleVisibleContentRectUpdate, schedule a pre-commit callback
in which we will compute the new visible content rect information
and send it to the Web Content process.
Keep track of the stable state of the scroll view which most recently
scheduled an update, and use that to inform _updateVisibleContentRects.
This matches the previous behavior where the updates might get coalesced
in the Web Content process, and the most recent update wins.
Make a few callers of _updateVisibleContentRectAfterScrollInView
that passed in our scroll view just use _scheduleVisibleContentRectUpdate instead.
2017-02-16 Brent Fulgham <bfulgham@apple.com>
[WebRTC][Mac] Conditionally add sandbox extensions to the Network Process
https://bugs.webkit.org/show_bug.cgi?id=168010
<rdar://problem/30245503>
Reviewed by Youenn Fablet.
Conditionally add sandbox extensions to the Network Process when the WebRTC/Media Capture
features are enabled.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode): Serialize new process configuration flag.
(WebKit::NetworkProcessCreationParameters::decode): Ditto.
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcess): Remember state of WebRTC for when the
sandbox is established.
(WebKit::NetworkProcess::initializeSandbox): Add ENABLE_WEB_RTC parameter to sandbox launch state.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Add conditional sandbox expansion to allow
bidirectional network access when the ENABLE_LIBWEBRTC flag is present in the sandbox launch parameters.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess): Use proper compile guards and check media stream
preference, rather than the peer connection preference.
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Notify NetworkProcess at launch time whether the
user wants WebRTC support.
2017-02-16 Brent Fulgham <bfulgham@apple.com>
[WebRTC][Mac][WebKit2] Initial WebProcess does not support WebRTC
https://bugs.webkit.org/show_bug.cgi?id=168438
<rdar://problem/30401818>
Reviewed by Youenn Fablet.
The sandbox extension for microphone access does not take effect until the second WebProcess
is created, causing the initial browser tab to lack microphone support.
This patch checks the setting earlier in the boot process so that the initial WebProcess
instance gets the correct setting.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess): Move microphone sandbox extension here, so that the
initial WebProcess has the correct microphone access.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess): Move microphone sandbox extension from here to platform-specific file.
(WebKit::WebProcessPool::createWebPage): Remove unneeded preference checks.
2017-02-16 Eric Carlson <eric.carlson@apple.com>
Add WebRTC as an off-by-default experimental feature menu item.
https://bugs.webkit.org/show_bug.cgi?id=167972
<rdar://problem/30293429>
Reviewed by Alex Christensen.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::setPeerConnectionAndMediaStreamEnabled): We need to enable/disable
peer connection and media stream preferences at the same time, so special case them.
(WebKit::WebPreferences::setEnabledForFeature):
* UIProcess/WebPreferences.h:
2017-02-15 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r212394.
Fixed iOS WebInspector
Reverted changeset:
"Unreviewed, rolling out r212169."
https://bugs.webkit.org/show_bug.cgi?id=166681
http://trac.webkit.org/changeset/212394
2017-02-15 Eric Carlson <eric.carlson@apple.com>
[MediaStream] delete CaptureDeviceInfo struct
https://bugs.webkit.org/show_bug.cgi?id=168395
Reviewed by Sam Weinig.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<CaptureDevice>::encode):
(IPC::ArgumentCoder<CaptureDevice>::decode):
2017-02-15 Anders Carlsson <andersca@apple.com>
Try again.
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::WebDragClient::startDrag):
2017-02-15 Anders Carlsson <andersca@apple.com>
Attempt to fix the GTK+ build.
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::WebDragClient::startDrag):
2017-02-15 Simon Fraser <simon.fraser@apple.com>
Clean up WebProcessCreationParameters a little
https://bugs.webkit.org/show_bug.cgi?id=168349
Reviewed by Alex Christensen.
Initialize the data members better, and rearrange to group the types in a slightly more space-efficient manner.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
* Shared/WebProcessCreationParameters.h:
2017-02-15 Jer Noble <jer.noble@apple.com>
REGRESSION(r183937): Fullscreen Exit animation missing mask
https://bugs.webkit.org/show_bug.cgi?id=168360
Reviewed by Eric Carlson.
In r183937, the fullscreen window's clip layer has it's mask removed when the enter
fullscreen animation completes, allowing low-power video playback mode to be entered. But
this breaks the exit fullscreen animaiton, which assumes a mask is present. Abstract the
mask creation code out into a static helper method, and use it at the beginning of the exit
fullscreen animation to re-create the mask before adding animations to it.
* UIProcess/mac/WKFullScreenWindowController.mm:
(createMask):
(-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
(-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
2017-02-15 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r212169.
Broke iOS WebInspector
Reverted changeset:
"WebInspector: refactor RemoteInspector to move cocoa specific
code to their own files"
https://bugs.webkit.org/show_bug.cgi?id=166681
http://trac.webkit.org/changeset/212169
2017-02-15 Anders Carlsson <andersca@apple.com>
Modernize DragClient::startDrag somewhat
https://bugs.webkit.org/show_bug.cgi?id=168379
Reviewed by Tim Horton.
Update for WebCore changes.
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag):
2017-02-15 Aakash Jain <aakash_jain@apple.com>
Remove WebIOSEvent interface
https://bugs.webkit.org/show_bug.cgi?id=168368
Reviewed by Tim Horton.
* Shared/NativeWebKeyboardEvent.h: Using WebEvent from WebCore instead of WebIOSEvent.
* Shared/ios/NativeWebKeyboardEventIOS.mm: Ditto.
* Shared/ios/WebIOSEventFactory.h: Ditto.
* Shared/ios/WebIOSEventFactory.mm: Ditto.
* UIProcess/ios/WKContentViewInteraction.h: Ditto.
* UIProcess/ios/WKContentViewInteraction.mm: Ditto.
* UIProcess/API/C/WKPage.cpp: Using WebEvent from WebKit.
2017-02-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Update cookie manager API to properly work with ephemeral sessions
https://bugs.webkit.org/show_bug.cgi?id=168230
Reviewed by Michael Catanzaro.
WebKitCookieManager is associated to a particular WebKitWebContext and uses the default session ID
unconditionally. It should be associated to a WebKitWebsiteDataManager instead and use its session ID. This
patch also adds support for handling cookies with WebKitWebsiteDataManager and deprecates
webkit_cookie_manager_get_domains_with_cookies(), webkit_cookie_manager_delete_cookies_for_domain() and
webkit_cookie_manager_delete_all_cookies(). It also adds API to get the the WebKitWebsiteDataManager of a
WebKitWebView, since it's the only way to get the WebKitCookieManager associated to an ephemeral web view.
* UIProcess/API/gtk/WebKitCookieManager.cpp:
(webkitCookieManagerDispose): Stop observing cookie changes.
(webkit_cookie_manager_class_init): Add dispose implementation.
(webkitCookieManagerCreate): Create the WebKitCookieManager with a WebKitWebsiteDataManager.
(webkit_cookie_manager_set_persistent_storage): Work with all contexts having the session.
(webkit_cookie_manager_set_accept_policy): Ditto.
(webkit_cookie_manager_get_accept_policy): Use any context having the session.
(webkit_cookie_manager_get_domains_with_cookies): Deprecate and implement using WebKitWebsiteDataManager.
(webkit_cookie_manager_get_domains_with_cookies_finish): Ditto.
(webkit_cookie_manager_delete_cookies_for_domain): Ditto.
(webkit_cookie_manager_delete_all_cookies): Ditto.
* UIProcess/API/gtk/WebKitCookieManager.h:
* UIProcess/API/gtk/WebKitCookieManagerPrivate.h:
* UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
(attachCustomProtocolManagerClientToContext):
* UIProcess/API/gtk/WebKitDownloadClient.cpp:
(attachDownloadClientToContext):
* UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
(attachInjectedBundleClientToContext):
* UIProcess/API/gtk/WebKitSecurityManager.cpp:
(registerSecurityPolicyForURIScheme):
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed): Call webkitWebsiteDataManagerAddProcessPool.
(webkitWebContextDispose): Call webkitWebsiteDataManagerRemoveProcessPool.
(webkit_web_context_get_cookie_manager): Return the WebKitCookieManager of the WebKitWebsiteDataManager.
(webkitWebContextGetProcessPool): Make it return a reference.
* UIProcess/API/gtk/WebKitWebContextPrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewConstructed): Call webkitWebsiteDataManagerAddProcessPool when creating a ephemeral web view.
(webkitWebViewDispose): Call webkitWebsiteDataManagerRemoveProcessPool if needed.
(webkit_web_view_get_website_data_manager): Return the WebKitWebsiteDataManager or the context one.
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/WebKitWebsiteData.cpp: Add support for Cookies type.
(recordContainsSupportedDataTypes):
(toWebKitWebsiteDataTypes):
* UIProcess/API/gtk/WebKitWebsiteData.h:
* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
(_WebKitWebsiteDataManagerPrivate::~_WebKitWebsiteDataManagerPrivate): Ensure all contexts were unregistered.
(webkitWebsiteDataManagerAddProcessPool): Register the process pool in the session.
(webkitWebsiteDataManagerRemoveProcessPool): Unregister the process poll from the session.
(webkitWebsiteDataManagerGetProcessPools): Return the list of proces pools registered.
(webkit_website_data_manager_get_cookie_manager): Return the WebKitCookieManager.
(toWebsiteDataTypes): Add Cookies.
* UIProcess/API/gtk/WebKitWebsiteDataManager.h:
* UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
* UIProcess/WebsiteData/WebsiteDataRecord.cpp:
(WebKit::WebsiteDataRecord::displayNameForCookieHostName): Handle localhost as a special case here for backwards
compatibility.
2017-02-14 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Support data interaction on links
https://bugs.webkit.org/show_bug.cgi?id=168331
<rdar://problem/30200837>
Reviewed by Tim Horton.
Adds support for data interaction on links at the client layer for WebKit2. This involves several changes,
detailed in the per-method changes below:
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
Add adjustedPointForNodeRespondingToClickEvents (the request point, adjusted to take nodeRespondingToClickEvents
into account) to InteractionInformationAtPosition. The web process sends this adjusted point over to the UI
process so that the UI process will be able to begin a data interaction at the adjusted point rather than the
request point, which is necessary for small clickable (and data-interactive) elements such as links.
* UIProcess/ios/WKActionSheet.h:
* UIProcess/ios/WKActionSheet.mm:
(-[WKActionSheet presentSheet:]):
(-[WKActionSheet _presentationRectForStyle:]):
(-[WKActionSheet updateSheetPosition]):
* UIProcess/ios/WKActionSheetAssistant.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):
(-[WKActionSheetAssistant presentationRectForIndicatedElement]):
(-[WKActionSheetAssistant showImageSheet]):
(-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]):
(-[WKActionSheetAssistant needsLinkIndicator]):
(-[WKActionSheetAssistant showLinkSheet]):
(-[WKActionSheetAssistant cleanupSheet]):
(-[WKActionSheetAssistant _presentationStyleForImageAtElementRect:]): Deleted.
Add support for the WKActionSheetPresentAtClosestIndicatorRect style of presenting an action sheet. When
showing the action sheet for a link and there is space along the margins to show a popover in the first place,
we will now target the popover rect to the bounding rect of the set of adjacent (or nearly-adjacent) element
rects closest to the user's touch location. This covers cases where the link is split into multiple rects due to
a line break, when the link is on multiple lines with a jagged rect per line, and when both of the above are
true.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView pointIsInDataInteractionContent:]):
(-[WKContentView _positionInformationDidChange:]):
(-[WKContentView positionInformationForActionSheetAssistant:]):
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
Include link indicator data in the position information request if needed. As the FIXME suggests, this can be
improved by asynchronously presenting the action sheet assistant after the request returns, and is something we
should address in the future.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
2017-02-14 Jason Rinn <jrinn@apple.com>
Add new WKWebKit Cocoa API for getContentsAsString.
https://bugs.webkit.org/show_bug.cgi?id=168147
<rdar://problem/30502539>
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _getContentsAsStringWithCompletionHandler:]): New API for getContentsAsString.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
2017-02-14 Chris Dumez <cdumez@apple.com>
HTML Form Validation bubble should take minimum font size setting into consideration
https://bugs.webkit.org/show_bug.cgi?id=168271
<rdar://problem/29869869>
Reviewed by Simon Fraser.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _contentsOfUserInterfaceItem:]):
Return font size used in the validation bubble.
* UIProcess/PageClient.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createValidationBubble):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::showValidationMessage):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createValidationBubble):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::showValidationMessage):
Pass minimum font size setting when constructing the form validation bubble.
2017-02-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r211879.
https://bugs.webkit.org/show_bug.cgi?id=168330
Not ready for the menu yet (Requested by eric_car_ on
#webkit).
Reverted changeset:
"Add WebRTC as an off-by-default experimental feature menu
item."
https://bugs.webkit.org/show_bug.cgi?id=167972
http://trac.webkit.org/changeset/211879
2017-02-14 Simon Fraser <simon.fraser@apple.com>
Add logging and defensive fixes to try to detect problems causing blank tabs
https://bugs.webkit.org/show_bug.cgi?id=168270
rdar://problem/30505482
Reviewed by Jon Lee.
Add release logging when -[WKWebView _beginAnimatedResizeWithUpdates:] and -[WKWebView _endAnimatedResize]
are unbalanced across a commit, to detect cases where _endAnimatedResize wasn't called enough times.
Also log when RemoteLayerTreeHost::updateLayerTree() fails to find a root layer, which should never happen.
In WebPageProxy, clear m_firstLayerTreeTransactionIdAfterDidCommitLoad on a web process crash.
* Platform/Logging.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _endAnimatedResize]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::isAlwaysOnLoggingAllowed):
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
(WebKit::RemoteLayerTreeHost::clearLayers):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::WebFrame):
* WebProcess/WebPage/WebFrame.h:
2017-02-14 Carlos Garcia Campos <cgarcia@igalia.com>
Allow to use stored credentials also for downloads started by DownloadManager::startDownload
https://bugs.webkit.org/show_bug.cgi?id=167584
Reviewed by Michael Catanzaro.
Cliking on a link that triggers a download works on an already HTTP authenticated site works, but right clicking
and downloading from the context menu shows the HTTP auth dialog again. This is because PendingDownload uses
DoNotAllowStoredCredentials unconditionally. We want to allow using cached credentials at least for
non-ephemeral sessions.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
2017-02-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Make DragImageRef a RefPtr instead of a plain pointer
https://bugs.webkit.org/show_bug.cgi?id=168296
Reviewed by Sergio Villar Senin.
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::WebDragClient::startDrag):
2017-02-14 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Ensure a response MIME type when Content-Type is missing and sniffing not allowed
https://bugs.webkit.org/show_bug.cgi?id=168299
Reviewed by Sergio Villar Senin.
Sniffing is not allowed but we can try to guess the MIME using the response path, or at least fallback to
default MIME type instead of leaving an empty string. This matches what mac port does.
Fixes: http/tests/inspector/network/fetch-response-body.html
http/tests/inspector/network/xhr-response-body.html
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::didSendRequest):
2017-02-14 Carlos Garcia Campos <cgarcia@igalia.com>
CookieManager only works with the default session
https://bugs.webkit.org/show_bug.cgi?id=168229
Reviewed by Alex Christensen.
Make CookieManager session aware by adding a SessionID parameter to all its functions, and update all the callers
to pass the default session ID, preserving the current
behavior. WebCookieManagerProxy::startObservingCookieChanges() now also receives an optional callback to be
called on every change.
* UIProcess/API/C/WKCookieManager.cpp:
(WKCookieManagerGetHostnamesWithCookies):
(WKCookieManagerDeleteCookiesForHostname):
(WKCookieManagerDeleteAllCookies):
(WKCookieManagerDeleteAllCookiesModifiedAfterDate):
(WKCookieManagerStartObservingCookieChanges):
(WKCookieManagerStopObservingCookieChanges):
* UIProcess/API/gtk/WebKitCookieManager.cpp:
(_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate):
(webkitCookieManagerCreate):
(webkit_cookie_manager_set_persistent_storage):
(webkit_cookie_manager_get_domains_with_cookies):
(webkit_cookie_manager_delete_cookies_for_domain):
(webkit_cookie_manager_delete_all_cookies):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):
(WebKit::WebAutomationSession::deleteAllCookies):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
(WebKit::WebCookieManagerProxy::deleteCookiesForHostname):
(WebKit::WebCookieManagerProxy::deleteAllCookies):
(WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManagerProxy::addCookie):
(WebKit::WebCookieManagerProxy::startObservingCookieChanges):
(WebKit::WebCookieManagerProxy::stopObservingCookieChanges):
(WebKit::WebCookieManagerProxy::cookiesDidChange):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebCookieManagerProxy.messages.in:
* WebProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::WebCookieManager):
(WebKit::WebCookieManager::getHostnamesWithCookies):
(WebKit::WebCookieManager::deleteCookiesForHostname):
(WebKit::WebCookieManager::deleteAllCookies):
(WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManager::addCookie):
(WebKit::WebCookieManager::startObservingCookieChanges):
(WebKit::WebCookieManager::stopObservingCookieChanges):
* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/Cookies/WebCookieManager.messages.in:
2017-02-14 Tomas Popela <tpopela@redhat.com>
Unreviewed, fix documentation typo
* UIProcess/API/gtk/WebKitEditingCommands.h:
2017-02-12 Brian Burg <bburg@apple.com>
Web Inspector: expose system user interface layout direction through InspectorFrontendHost
https://bugs.webkit.org/show_bug.cgi?id=168209
<rdar://problem/11573736>
Reviewed by Joseph Pecoraro.
Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
properly set the UI directionality from system settings in PageClient, this will get inherited
automatically by the Inspector's WebPage instance.
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::userInterfaceLayoutDirection):
* WebProcess/WebPage/RemoteWebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::userInterfaceLayoutDirection):
* WebProcess/WebPage/WebInspectorUI.h:
2017-02-13 Youenn Fablet <youennf@gmail.com>
[WebRTC] Creating RTCPeerConnection with libwebrtc backend is crashing on rwt
https://bugs.webkit.org/show_bug.cgi?id=168250
Reviewed by Alex Christensen.
* WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
(WebKit::LibWebRTCProvider::createPeerConnection):
* WebProcess/Network/webrtc/LibWebRTCProvider.h:
* WebProcess/Network/webrtc/LibWebRTCSocket.h:
* WebProcess/Network/webrtc/WebRTCMonitor.cpp:
(WebKit::WebRTCMonitor::StartUpdating):
(WebKit::WebRTCMonitor::networksChanged):
* WebProcess/Network/webrtc/WebRTCMonitor.h:
* WebProcess/Network/webrtc/WebRTCResolver.cpp:
(WebKit::WebRTCResolver::setResolvedAddress):
(WebKit::WebRTCResolver::resolvedAddressError):
* WebProcess/Network/webrtc/WebRTCSocket.cpp:
(WebKit::WebRTCSocket::signalOnNetworkThread):
2017-02-13 Megan Gardner <megan_gardner@apple.com>
Implement Drag cancels
https://bugs.webkit.org/show_bug.cgi?id=168266
Reviewed by Wenson Hsieh.
Adds support for the UI Process to cancel already started drag events.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::cancelledDrag):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::cancelledDrag):
* WebProcess/WebPage/WebPage.messages.in:
2017-02-13 Simon Fraser <simon.fraser@apple.com>
Call WKDestroyRenderingResources() on iOS when tabs are backgrounded
https://bugs.webkit.org/show_bug.cgi?id=168261
rdar://problem/30481079
Reviewed by Tim Horton.
There's code to call CABackingStoreCollectBlocking() on a 10s timer that exists for Mac, but on iOS
the web processes are suspended before this timer fires. So call CABackingStoreCollectBlocking()
from WebProcess::actualPrepareToSuspend(), which is where we also trigger the markAllLayersVolatile()
code.
Also add CABackingStoreCollectBlocking() to QuartzCoreSPI.h so we can use it without using WKSI.
Release-log how long this takes, in case we get reports of bad performance. In my testing it could be up to 10ms.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::destroyRenderingResources):
2017-02-13 Brady Eidson <beidson@apple.com>
Followup to: Replace all WebKit Library Version checks in WK2 with SDK version checks.
https://bugs.webkit.org/show_bug.cgi?id=168124
Reviewed by Geoffrey Garen.
* UIProcess/Cocoa/VersionChecks.h:
2017-02-13 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Add test infrastructure and unit tests for data interaction
https://bugs.webkit.org/show_bug.cgi?id=168159
<rdar://problem/30477634>
Reviewed by Tim Horton.
Adds support at the WebKit2 layer for testing data interaction. Introduces the _WKTestingDelegate, which a
protocol which can specified for a WKWebView and used to install mock objects and simulate the state of the
platform. By default, this delegate is nil, which results in normal behavior. For data interaction, we are able
to specify a mock data interaction gesture recognizer for use by the WKContentView to simulate firing a long
press and subsequent movement. This gesture recognizer is used in place of the regular data interaction gesture
recognizer, and allows for TestWebKitAPI to drive interaction without actually sending events through the
UIApplication. The _WKTestingDelegate also contains optional method hooks which are invoked at key points in
time when performing a data interaction gesture.
Since all methods of the testing delegate are optional, the testing delegate can be easily extended to support
testing for other features -- the idea is that leaving all but the relevant methods in the protocol
unimplemented will result in default behavior for everything other than those methods, so a client need only
implement and add WebKit2 hooks for a few methods to support testing for a new feature.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _testingDelegate]):
(-[WKWebView _setTestingDelegate:]):
Specify the testing delegate to use for this WKWebView (see above for more details).
(-[WKWebView _simulateDataInteractionGestureRecognized]):
(-[WKWebView _simulateDataInteractionEntered:]):
(-[WKWebView _simulateDataInteractionUpdated:]):
(-[WKWebView _simulateDataInteractionPerformOperation:]):
(-[WKWebView _simulateDataInteractionEnded:]):
(-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]):
(-[WKWebView _simulateFailedDataInteractionWithIndex:]):
(-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]):
(-[WKWebView _simulatedItemsForDataInteractionWithIndex:]):
Used by TestWebKitAPI to drive data interaction tests. See DataInteractionTests.mm.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKTestingDelegate.h: Added.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _dataInteractionGestureRecognizer]):
* WebKit2.xcodeproj/project.pbxproj:
2017-02-13 Eric Carlson <eric.carlson@apple.com>
[MediaStream Mac] Video capture needs access to /Library/CoreMediaIO/Plug-Ins/DAL/
https://bugs.webkit.org/show_bug.cgi?id=168244
<rdar://problem/30461158>
Reviewed by Brady Eidson.
* WebProcess/com.apple.WebProcess.sb.in: Grant read-access to the video capture
plug-in directory when enabling video capture.
2017-02-13 Antti Koivisto <antti@apple.com>
Disable mmap'd cache files if container is class A
https://bugs.webkit.org/show_bug.cgi?id=168241
<rdar://problem/23676252>
Reviewed by JF Bastien and Chris Dumez.
If the mmap'd cache file gets evicted and the device is locked,
then WebContent won't be able to bring the file back in under
class A, causing SIGBUS.
In those circumstances, don't use mmap'd files.
* NetworkProcess/cache/NetworkCache.h:
(WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData):
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
Don't initialize the shareable resource handle for the map if forbidden.
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::canUseSharedMemoryForPath):
Query the system for the protection status of the cache path.
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::Storage):
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::canUseSharedMemoryForBodyData):
2017-02-13 Youenn Fablet <youennf@gmail.com>
[WebRTC] libwebrtc socket factory is not assigning the right socket type
https://bugs.webkit.org/show_bug.cgi?id=168233
Reviewed by Brent Fulgham.
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
(WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
2017-02-13 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Unreviewed, add missing precondition check
* WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp:
(webkit_web_editor_get_page):
2017-02-13 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix another docs typo.
* UIProcess/API/gtk/WebKitEditingCommands.h:
2017-02-12 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Improve documentation of webkit_context_menu_set_user_data()
https://bugs.webkit.org/show_bug.cgi?id=168214
Reviewed by Carlos Garcia Campos.
* UIProcess/API/gtk/WebKitContextMenu.cpp:
2017-02-12 Dan Bernstein <mitz@apple.com>
Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::createShareMenuItem): Use non-deprecated method.
2017-02-12 Dan Bernstein <mitz@apple.com>
[Cocoa] Some -respondsToSelector: checks are unnecessary
https://bugs.webkit.org/show_bug.cgi?id=168183
Reviewed by Tim Horton.
* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::setColorMatchUntaggedContent): Removed unnecessary
-respondsToSelector: check.
(WebKit::LayerHostingContext::colorMatchUntaggedContent): Ditto.
* Platform/mac/MenuUtilities.mm:
(WebKit::menuItemTitleForTelephoneNumberGroup): Ditto.
* Platform/spi/ios/UIKitSPI.h: Moved declaration of
-[UIScrollView _isInterruptingDeceleration] from WKWebView.mm to the
!USE(APPLE_INTERNAL_SDK) section here.
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::setSharedHTTPCookieStorage): Removed unnecessary -respondsToSelector:
check.
* Shared/mac/WebEventFactory.mm:
(WebKit::typeForEvent): Ditto.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateVisibleContentRectAfterScrollInView:]): Ditto.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup): Ditto.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly): Ditto.
* UIProcess/WKImagePreviewViewController.mm:
(-[WKImagePreviewViewController previewActions]): Removed check whether _WKElementAction
responds to -runActionWithElementInfo:.
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showDataDetectorsSheet]): Ditto.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _lookup:]): Ditto.
(-[WKContentView _share:]): Ditto.
(-[WKContentView _addShortcut:]): Ditto.
(-[WKContentView _promptForReplace:]): Ditto.
(-[WKContentView _transliterateChinese:]): Ditto.
(-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Removed call to
-[UIKeyboardImpl didHandleWebKeyEvent], which is a no-op.
(-[WKContentView _interpretKeyEvent:isCharEvent:]): Removed unnecessary -respondsToSelector:
check.
(-[WKContentView _dataForPreviewItemController:atPosition:type:]): Ditto.
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::createFence): Ditto.
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _animationControllerForDataDetectedText]): Ditto.
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::createShareMenuItem): Ditto.
2017-02-12 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Unreviewed, minor documentation improvements
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_class_init):
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(webkit_web_page_class_init):
2017-02-12 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Downloads fail when the given destination is not a URI
https://bugs.webkit.org/show_bug.cgi?id=168187
Reviewed by Michael Catanzaro.
It always expects a uri, and fails if a local path is given.
Fixes: http/tests/download/anchor-download-no-extension.html
http/tests/download/area-download.html
http/tests/security/anchor-download-allow-data.html
http/tests/security/anchor-download-allow-sameorigin.html
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::download): Use g_file_new_for_path() if the pending destination is a path instead
of a URI.
2017-02-12 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Handle caps lock indicator in event modifiers
https://bugs.webkit.org/show_bug.cgi?id=168186
Reviewed by Michael Catanzaro.
Use PlatformKeyboardEvent::modifiersContainCapsLock() to check if modifiers contain the caps lock and add
Modifiers::CapsLockKey in that case.
* Shared/gtk/WebEventFactory.cpp:
(WebKit::modifiersForEvent):
* UIProcess/API/gtk/WebKitPrivate.cpp:
(wkEventModifiersToGdkModifiers):
(toGdkModifiers):
2017-02-12 Andy Estes <aestes@apple.com>
[iOS] PDF page number indicator can show "0 of n" on short pages
https://bugs.webkit.org/show_bug.cgi?id=168185
Reviewed by Tim Horton.
When viewing a PDF with a last page that is shorter than the frame height, it's possible
(thanks to rubber-banding) to scroll down until the page no longer intersects the rect we
use to determine the center page. When this happens, the page number indicator displays
"0 of n".
Fix this by handling cases where the first page starts below the center page rect or the
last page ends above it.
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _revalidateViews]):
2017-02-11 Alex Christensen <achristensen@webkit.org>
Fix crashes after [NSURLSession invalidateAndCancel]
https://bugs.webkit.org/show_bug.cgi?id=168181
<rdar://problem/29813868>
Reviewed by Brady Eidson.
When we call NetworkSessionCocoa::invalidateAndCancel, we intend for the session to immediately
become invalid and stop doing things. [NSURLSession invalidateAndCancel] asynchronously cancels
everything and then calls the delegate's didBecomeInvalidWithError, so before this change there
is a time when we have torn down the session with SessionTracker::destroySession but we can still
get a delegate callback which assumes the session and its NetworkStorageSession exists. If we
get any delegate callbacks after a NetworkSession has been invalidated, we will want to ignore them.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate sessionInvalidated]):
(-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]):
(-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
The pointer to the NetworkSessionCocoa can now be null. We need to check it.
(WebKit::NetworkSessionCocoa::invalidateAndCancel):
Synchronously remove the connection between the delegates and the NetworkSessionCocoa.
2017-02-10 John Wilander <wilander@apple.com>
Updates to Resource Load Statistics: Get the right website data store and introduce timeout for user interaction
https://bugs.webkit.org/show_bug.cgi?id=167474
<rdar://problem/24681808>
<rdar://problem/24703286>
<rdar://problem/30290270>
This patch does the following:
1. Gets the right website data store. API::WebsiteDataStore::defaultDataStore()
does not provide the right data store.
2. Introduces timeout for user interaction. A domain needs interaction every 30
days to stay in that category.
3. Adds grandfathered to the statistics model in preparation for grandfathering of
existing data records.
4. Adds test infrastructure to allow testing of the various rules in place for
data records removal.
5. Fixes various smaller bugs that were found as part of setting up the tests.
6. Regresses the data records removal counting. We need to come up with a thread
safe way of gathering removal statistics from more than one data store now
that we potentially interact with multiple stores.
7. Adds a first set of layout tests for resource load statistics.
Reviewed by Andy Estes.
* PlatformEfl.cmake:
Added UIProcess/WebResourceLoadStatisticsManager.cpp and
UIProcess/API/C/WKResourceLoadStatisticsManager.cpp.
* PlatformGTK.cmake:
Added UIProcess/WebResourceLoadStatisticsManager.cpp and
UIProcess/API/C/WKResourceLoadStatisticsManager.cpp.
* PlatformMac.cmake:
Added UIProcess/WebResourceLoadStatisticsManager.cpp and
UIProcess/API/C/WKResourceLoadStatisticsManager.cpp.
* Shared/API/APIObject.h:
Adds WebResourceLoadStatisticsManager to the Type enum.
* Shared/API/c/WKBase.h:
Typedef of WKResourceLoadStatisticsManagerRef.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
Adds support for statistics mostRecentUserInteraction, grandfathered, and
dataRecordsRemoved.
* UIProcess/API/C/WKAPICast.h:
Adds API mapping between WKResourceLoadStatisticsManagerRef and
WebResourceLoadStatisticsManager.
* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: Added.
(WKResourceLoadStatisticsManagerGetTypeID):
(WKResourceLoadStatisticsManagerSetPrevalentResource):
(WKResourceLoadStatisticsManagerIsPrevalentResource):
(WKResourceLoadStatisticsManagerSetHasHadUserInteraction):
(WKResourceLoadStatisticsManagerIsHasHadUserInteraction):
(WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction):
(WKResourceLoadStatisticsManagerFireDataModificationHandler):
(WKResourceLoadStatisticsManagerSetNotifyPagesWhenDataRecordsWereScanned):
(WKResourceLoadStatisticsManagerSetShouldClassifyResourcesBeforeDataRecordsRemoval):
(WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval):
(WKResourceLoadStatisticsManagerResetToConsistentState):
API level bridge to WebResourceLoadStatisticsManager functions.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h: Added.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores):
A way to delete website data in persistent store(s) configured by the
embedding client. API::WebsiteDataStore::defaultDataStore() does not
do this which caused us to skip session storage.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp: Added.
(WebKit::WebResourceLoadStatisticsManager::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsManager::isPrevalentResource):
(WebKit::WebResourceLoadStatisticsManager::setHasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction):
(WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler):
(WebKit::WebResourceLoadStatisticsManager::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebResourceLoadStatisticsManager::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
Static functions to manage the state and behavior of the UI process'
resource load statistics store.
* UIProcess/WebResourceLoadStatisticsManager.h: Added.
(WebKit::WebResourceLoadStatisticsManager::create):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
An effect of a member variable rename. See header file comment below.
(WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval):
Three static functions for controlling the behavior of the store.
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
Changes:
1. Covers all data record types.
2. Allows data removal when m_lastTimeDataRecordsWereRemoved is not set.
3. Moves the heavy lifting to WebsiteDataStore (see below).
4. No longer counts removed data regressions.
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
See next comment.
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() is
broken out of WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated
to allow for statistics processing without prior classification.
Tests need to set statistics and a run of the classifier may
reset the data.
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
Sets the notification callback which calls
WebResourceLoadStatisticsStore::processStatisticsAndDataRecords().
* UIProcess/WebResourceLoadStatisticsStore.h:
(WebKit::WebResourceLoadStatisticsStore::coreStore):
Renamed m_resourceStatisticsStore to m_resourceLoadStatisticsStore to
harmonize with other naming.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains):
This is now where matching is made between prevalent resources
and data records. This function is used by
WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains().
(WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains):
The function WebResourceLoadStatisticsStore::removeDataRecords()
calls to get data records removed in all persistent stores.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::m_resourceLoadStatisticsStore):
(WebKit::WebProcess::statisticsChangedTimerFired):
(WebKit::m_resourceLoadStatisticsStorage): Deleted.
Renamed m_resourceLoadStatisticsStorage to m_resourceLoadStatisticsStore
to harmonize with other naming.
* WebProcess/WebProcess.h:
2017-02-10 Simon Fraser <simon.fraser@apple.com>
Zero out some WKWebView state in the case of a web content crash
https://bugs.webkit.org/show_bug.cgi?id=168157
Reviewed by Tim Horton.
Reset some bits of state in WKWebView when the web content process crashes, in
to try to avoid states that might cause the web view to stay blank.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processDidExit]):
2017-02-10 Daniel Bates <dabates@apple.com>
Detach frame from document when entering page cache
https://bugs.webkit.org/show_bug.cgi?id=166774
<rdar://problem/29904368>
Reviewed by Chris Dumez.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetAllowsPageCacheWithWindowOpener): Deleted.
(WKPreferencesGetAllowsPageCacheWithWindowOpener): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2017-02-10 Carlos Garcia Campos <cgarcia@igalia.com>
WebInspector: refactor RemoteInspector to move cocoa specific code to their own files
https://bugs.webkit.org/show_bug.cgi?id=166681
Reviewed by Michael Catanzaro.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess): Add PLATFORM(COCOA) to the ifdef.
2017-02-10 Tim Horton <timothy_horton@apple.com>
Infinite UI process hang under ensurePositionInformationIsUpToDate
https://bugs.webkit.org/show_bug.cgi?id=168154
<rdar://problem/30428673>
Reviewed by Simon Fraser.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
If the web process crashes or we're being torn down for another reason,
assume that we aren't ever going to receive any pending async interaction
information update. Otherwise, ensurePositionInformationIsUpToDate can end
up waiting for it forever.
2017-02-10 Andrew Gold <agold@apple.com>
Add mediaStreamEnabled property to WKPreferences for Cocoa.
https://bugs.webkit.org/show_bug.cgi?id=168080
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Sets the pageConfiguration's mediaStreamEnabled preference value.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]): Copies the mediaStreamEnabled property.
(-[WKWebViewConfiguration _mediaStreamEnabled]): Gets the mediaStreamEnabled property.
(-[WKWebViewConfiguration _setMediaStreamEnabled:]): Sets the mediaStreamEnabled property.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2017-02-10 Olivier Blin <olivier.blin@softathome.com>
WebProcess: remove unused m_inDidClose
https://bugs.webkit.org/show_bug.cgi?id=168121
Reviewed by Alex Christensen.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didClose):
* WebProcess/WebProcess.h:
m_inDidClose has been unused since r83774
2017-02-10 Joseph Pecoraro <pecoraro@apple.com>
[Resource Timing] Enable Resource Timing by default in Tests
https://bugs.webkit.org/show_bug.cgi?id=168145
Reviewed by Ryosuke Niwa.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetResourceTimingEnabled):
(WKPreferencesGetResourceTimingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2017-02-10 Dan Bernstein <mitz@apple.com>
[Cocoa] Add shouldChangeSelectedRange to WKWebProcessPlugInEditingDelegate
https://bugs.webkit.org/show_bug.cgi?id=168097
Reviewed by Tim Horton.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
Declared new delegate method.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Dispatch new delegate
method.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture): Pass UserTriggered whan calling
WebCore::Frame::Selection::setSelectedRange, so that the delegate is consulted.
(WebKit::WebPage::changeBlockSelection): Ditto.
(WebKit::WebPage::updateSelectionWithTouches): Ditto.
(WebKit::WebPage::selectWithTwoTouches): Ditto.
(WebKit::WebPage::extendSelection): Ditto.
(WebKit::WebPage::selectWordBackward): Ditto,
(WebKit::WebPage::moveSelectionByOffset): Ditto.
(WebKit::WebPage::selectPositionAtPoint): Ditto.
(WebKit::WebPage::selectPositionAtBoundaryWithDirection): Ditto.
(WebKit::WebPage::moveSelectionAtBoundaryWithDirection): Ditto.
(WebKit::WebPage::selectTextWithGranularityAtPoint): Ditto.
(WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): Ditto.
(WebKit::WebPage::updateSelectionWithExtentPoint): Ditto.
2017-02-10 Brady Eidson <beidson@apple.com>
Replace all WebKit Library Version checks in WK2 with SDK version checks.
https://bugs.webkit.org/show_bug.cgi?id=168124
Reviewed by Geoffrey Garen.
This change gets rid of WebKit Library Version checks and replaces them with SDK version checks.
To allow our tools to still be able to test new behaviors even when built against older SDKs,
it also opts them into an SPI default to have "linkedOnOrAfter()" always return true.
* Shared/Cocoa/CompletionHandlerCallChecker.mm:
(WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
* UIProcess/Cocoa/VersionChecks.h:
(WebKit::linkedOnOrAfter): Deleted.
* UIProcess/Cocoa/VersionChecks.mm:
(WebKit::linkedOnOrAfter):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::isNetworkCacheEnabled):
2017-02-10 Brian Burg <bburg@apple.com>
[Cocoa] Web Inspector: generate an NS_ENUM containing platforms supported by the protocol code generator
https://bugs.webkit.org/show_bug.cgi?id=168019
<rdar://problem/28718990>
Reviewed by Joseph Pecoraro.
* UIProcess/Automation/Automation.json: Fix the platform values to be lowercase.
2017-02-10 Brian Burg <bburg@apple.com>
Web Automation: fail gracefully when a screenshot cannot be encoded as base64
https://bugs.webkit.org/show_bug.cgi?id=168095
<rdar://problem/30297427>
Reviewed by Joseph Pecoraro.
Convert platformGetBase64EncodedPNGData to return a std::optional<String>.
Return nullopt if we can't create a screenshot or convert it to base64.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::didTakeScreenshot):
(WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
2017-02-09 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK+ build with threaded compositor disabled.
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
2017-02-09 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r212040.
Broke build. I'm not surprised
Reverted changeset:
"[WebRTC][Mac] Activate libwebrtc"
https://bugs.webkit.org/show_bug.cgi?id=167293
http://trac.webkit.org/changeset/212040
2017-02-09 Chris Dumez <cdumez@apple.com>
[Mac][WK2] Use MIME type to add file extension to downloads' suggested filenames when missing
https://bugs.webkit.org/show_bug.cgi?id=168077
<rdar://problem/30412595>
Reviewed by Alex Christensen.
Use MIME type to add file extension to downloads' suggested filenames when missing:
- https://html.spec.whatwg.org/#as-a-download (step 19)
This new behavior matches Chrome.
* NetworkProcess/Downloads/BlobDownloadClient.cpp:
(WebKit::BlobDownloadClient::didReceiveResponseAsync):
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::didReceiveResponse):
(WebKit::Download::decideDestinationWithSuggestedFilename):
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::findPendingDownloadLocation):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::didStart):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxy.messages.in:
2017-02-09 Youenn Fablet <youenn@apple.com>
[WebRTC][Mac] Activate libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167293
Reviewed by Alex Christensen.
* Shared/WebPreferencesDefinitions.h:
2017-02-09 Alex Christensen <achristensen@webkit.org>
Fix libwebrtc build on case-sensitive file systems.
* WebProcess/Network/webrtc/WebRTCMonitor.cpp:
2017-02-09 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
2017-02-09 Brady Eidson <beidson@apple.com>
Transition "WebKit Library Version" checks to SDK version checks.
<rdar://problem/30313696> and https://bugs.webkit.org/show_bug.cgi?id=168056
Reviewed by Geoffrey Garen.
When doing linkedOnOrAfter checks, relying solely on the WebKit library version number is error prone,
since apps may not link against WebKit directly and therefore the linked WebKit is unknown.
We should first prefer a version check on the SDK that the app was built with.
If that check fails, we can fallback to the linked WebKit library version number if it exists.
* Shared/Cocoa/CompletionHandlerCallChecker.mm:
(WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
For each "linked-on-or-after" feature, include both the WebKit library version and SDK version:
* UIProcess/Cocoa/VersionChecks.h:
(WebKit::linkedOnOrAfter):
* UIProcess/Cocoa/VersionChecks.mm:
(WebKit::linkedOnOrAfter):
(WebKit::linkTimeVersion): Deleted.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::isNetworkCacheEnabled):
2017-02-09 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r211980 and r211987.
https://bugs.webkit.org/show_bug.cgi?id=168072
Caused API test WebKit2.DuplicateCompletionHandlerCalls to
fail (Requested by ryanhaddad on #webkit).
Reverted changesets:
"Transition "WebKit Library Version" checks to SDK version
checks."
https://bugs.webkit.org/show_bug.cgi?id=168056
http://trac.webkit.org/changeset/211980
"Build fix for APPLE_INTERNAL_SDK builds after r211980."
http://trac.webkit.org/changeset/211987
2017-02-09 Brady Eidson <beidson@apple.com>
Transition "WebKit Library Version" checks to SDK version checks.
<rdar://problem/30313696> and https://bugs.webkit.org/show_bug.cgi?id=168056
Reviewed by Geoffrey Garen.
Library version linkedOnOrAfter checks are error prone since apps may not link directly to WebKit.
We always know what version of the SDK an app was built with, so we should use SDK version checks
whenever possible.
* Shared/Cocoa/CompletionHandlerCallChecker.mm:
(WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
Add SDKVersion form of the linkedOnOrAfter check, and transition over the current Library Version checks:
* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/Cocoa/VersionChecks.mm:
(WebKit::linkedOnOrAfter):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::isNetworkCacheEnabled):
2017-02-09 Antti Koivisto <antti@apple.com>
Use all cacheable speculatively loaded responses
https://bugs.webkit.org/show_bug.cgi?id=168052
Reviewed by Andreas Kling.
We currently only allow 200 responses. There is no reason not to use speculative responses
that have other cacheable status codes. This is helpful for 204s and 404s.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeStoreDecision):
(WebKit::NetworkCache::isStatusCodeCacheableByDefault): Deleted.
(WebKit::NetworkCache::isStatusCodePotentiallyCacheable): Deleted.
Move to CacheValidation.h/cpp
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
Allow all cacheable-by-default responses.
2017-02-09 Tomas Popela <tpopela@redhat.com>
Unreviewed. Fix gtk-doc warning
html/WebKitSettings.html:4435: warning: no link for: 'api-index-2.3' -> (2.3).
* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_class_init):
2017-02-09 Antti Koivisto <antti@apple.com>
Remove most cases of #if ENABLE(CACHE_PARTITIONING)
https://bugs.webkit.org/show_bug.cgi?id=167990
Reviewed by Sam Weinig.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::makeCacheKey):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::constructRevalidationRequest):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceRequest>::encode):
(IPC::ArgumentCoder<ResourceRequest>::decode):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextRegisterURLSchemeAsCachePartitioned):
* UIProcess/WebProcessPool.cpp:
(WebKit::m_hiddenPageThrottlingTimer):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::registerURLSchemeAsCachePartitioned):
* UIProcess/WebProcessPool.h:
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::registerURLSchemeAsCachePartitioned):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2017-02-08 Simon Fraser <simon.fraser@apple.com>
Put names on more UIViews for ease of debugging
https://bugs.webkit.org/show_bug.cgi?id=168035
Reviewed by Tim Horton.
Put names on the various bare UIViews that we create.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::showPaintRect):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2017-02-08 Andy Estes <aestes@apple.com>
Custom protocols should not continue loading after a network process crash
https://bugs.webkit.org/show_bug.cgi?id=168028
<rdar://problem/27607520>
Reviewed by Brady Eidson.
WKCustomProtocolLoaders are meant to be owned by CustomProtocolManagerProxy and have their
loads cancelled when CustomProtocolManagerProxy is destroyed. However, WKCustomProtocolLoader
creates a NSURLConnection for which it is the client, so NSURLConnection retains it for the
duration of the load.
These loaders should be explicitly cancelled when their CustomProtocolManagerProxy is destroyed.
New API test: WebKit2CustomProtocolsTest.CloseDuringCustomProtocolLoad
* UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
(-[WKCustomProtocolLoader customProtocolManagerProxyDestroyed]): Added. Cancels the
_urlConnection and sets _customProtocolManagerProxy to nullptr.
(WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy):
Called -customProtocolManagerProxyDestroyed on every loader in m_loaderMap.
2017-02-08 Dan Bernstein <mitz@apple.com>
[Cocoa] WKRemoteObjectCoder doesn’t handle CGSize
https://bugs.webkit.org/show_bug.cgi?id=168031
Reviewed by Tim Horton.
* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(encodeInvocationArguments): Encode CGSize by encoding two NSNumbers. Somewhat sadly,
+[NSValue valueWithCGSize:] is not available in macOS.
(decodeInvocationArguments): Decode wrapped numbers.
2017-02-08 Dan Bernstein <mitz@apple.com>
Tried to fix the build after r211897.
* UIProcess/ios/WKContentViewInteraction.h:
2017-02-08 Dan Bernstein <mitz@apple.com>
[iOS] WKWebView doesn’t have implementations of UIResponderStandardEditActions that can be overridden
https://bugs.webkit.org/show_bug.cgi?id=167974
Reviewed by Tim Horton.
* UIProcess/API/Cocoa/WKWebView.mm:
Gave each of the actions in FOR_EACH_WKCONTENTVIEW_ACTION an implementation that sends it
to the WKContentView if we’re using one.
(-[WKWebView canPerformAction:withSender:]): Override and for each of the actions in
FOR_EACH_WKCONTENTVIEW_ACTION, forward to
-[WKContentView canPerformActionForWebView:withSender:] if we’re using a WKContentView,
otherwise returning NO.
* UIProcess/ios/WKContentViewInteraction.h: Declared -canPerformActionForWebView:withSender:
and several internal methods we override.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformAction:withSender:]): Now returns NO so that the target for any
action is the WKWebView.
(-[WKContentView canPerformActionForWebView:withSender:]): Moved the logic previously in
-canPerformAction:withSender: to here.
2017-02-08 Antti Koivisto <antti@apple.com>
Allow speculative redirects
https://bugs.webkit.org/show_bug.cgi?id=167982
Reviewed by Andreas Kling.
If speculative loader hits a redirect it will drop it on the floor. We should use it instead.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRequest):
(WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
Reset m_isWaitingContinueWillSendRequestForCachedRedirect bit immediately.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::makeRedirectEntry):
Factor to a function.
(WebKit::NetworkCache::Cache::storeRedirect):
* NetworkProcess/cache/NetworkCache.h:
(WebKit::NetworkCache::Cache::speculativeLoadManager):
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::Entry):
Use std::optional instead std::unique_ptr for the redirect request.
(WebKit::NetworkCache::Entry::decodeStorageRecord):
* NetworkProcess/cache/NetworkCacheEntry.h:
(WebKit::NetworkCache::Entry::redirectRequest):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
Make a cache entry for speculative redirect.
Redirect is not actually performed, the target resource will have a separate
speculative entry.
(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
(WebKit::NetworkCache::SpeculativeLoad::didFailLoading):
(WebKit::NetworkCache::SpeculativeLoad::didComplete):
Protect against multiple completions.
(WebKit::NetworkCache::SpeculativeLoad::abort): Deleted.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
Make successful retrieves asynchronous to avoid re-entrancy problems.
2017-02-08 Jer Noble <jer.noble@apple.com>
Unreviewed build fix; FullscreenClient only avaialble on 32-bit builds.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):
2017-02-08 Jer Noble <jer.noble@apple.com>
Move FullscreenClient creation into WebViewImpl, for use in (deprecated) WKView.
https://bugs.webkit.org/show_bug.cgi?id=168007
Reviewed by Alex Christensen.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
* UIProcess/Cocoa/FullscreenClient.h:
* UIProcess/Cocoa/FullscreenClient.mm:
(WebKit::FullscreenClient::FullscreenClient):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):
2017-02-08 Youenn Fablet <youenn@apple.com>
GUM is crashing in Debug mode when access is granted/denied for a page that is gone
https://bugs.webkit.org/show_bug.cgi?id=168003
Reviewed by Eric Carlson.
Removing the assertion since manager can be null and case is coevered by the if statement behind it.
* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::UserMediaPermissionRequestProxy::deny):
2017-02-08 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r211869.
This change caused assertion failures on macOS WK2.
Reverted changeset:
"Allow speculative redirects"
https://bugs.webkit.org/show_bug.cgi?id=167982
http://trac.webkit.org/changeset/211869
2017-02-08 Eric Carlson <eric.carlson@apple.com>
Add WebRTC as an off-by-default experimental feature menu item.
https://bugs.webkit.org/show_bug.cgi?id=167972
<rdar://problem/30293429>
Reviewed by Jon Lee.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::setPeerConnectionAndMediaStreamEnabled): We need to enable/disable
peer connection and media stream preferences at the same time, so special case them.
(WebKit::WebPreferences::setEnabledForFeature):
* UIProcess/WebPreferences.h:
2017-02-08 Chris Dumez <cdumez@apple.com>
Add support for enhanced privacy diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=167948
<rdar://problem/30385112>
Reviewed by Antti Koivisto.
Implement new DiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy()
virtual method on WebKit2 and expose it to the client via the WKPageDiagnosticLogging
delegate.
* UIProcess/API/APIDiagnosticLoggingClient.h:
(API::DiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy):
* UIProcess/API/C/WKPageDiagnosticLoggingClient.h:
* UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
* UIProcess/Cocoa/DiagnosticLoggingClient.h:
* UIProcess/Cocoa/DiagnosticLoggingClient.mm:
(WebKit::DiagnosticLoggingClient::setDelegate):
(WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy):
* UIProcess/WebPageDiagnosticLoggingClient.cpp:
(WebKit::WebPageDiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy):
* UIProcess/WebPageDiagnosticLoggingClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy):
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
2017-02-08 Antti Koivisto <antti@apple.com>
Allow speculative redirects
https://bugs.webkit.org/show_bug.cgi?id=167982
Reviewed by Andreas Kling.
If speculative loader hits a redirect it will drop it on the floor. We should use it.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRequest):
(WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
Reset the m_isWaitingContinueWillSendRequestForCachedRedirect bit immediately.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::makeRedirectEntry):
Factor to a function.
(WebKit::NetworkCache::Cache::storeRedirect):
* NetworkProcess/cache/NetworkCache.h:
(WebKit::NetworkCache::Cache::speculativeLoadManager):
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::Entry):
Use std::optional instead std::unique_ptr for the redirect request.
(WebKit::NetworkCache::Entry::decodeStorageRecord):
* NetworkProcess/cache/NetworkCacheEntry.h:
(WebKit::NetworkCache::Entry::redirectRequest):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
Make cache entry for speculative redirect.
The redirect is not actually performed, the target resource will have separate
a speculative entry.
(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
(WebKit::NetworkCache::SpeculativeLoad::didFailLoading):
(WebKit::NetworkCache::SpeculativeLoad::didComplete):
Protect against multiple completions.
(WebKit::NetworkCache::SpeculativeLoad::abort): Deleted.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
Make successful retrieves asynchronous to avoid re-entrancy problems.
2017-02-07 Brent Fulgham <bfulgham@apple.com>
Correct initialization of Resource Load Statistics for use in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=167960
Reviewed by Andy Estes.
WebKit2 starts up with different process configuration settings depending on the type of
WebView and client application. This led to two problems:
1. Registering the shared resource load observer did not start at UIProcess launch. Instead, it
was lazily initialized as messages from the various WebProcess started getting received. This
is too slow for WebKitTestRunner, which needs this object to be initialized right at launch
time.
A new 'registerSharedResourceLoadObserver' method was needed, so that the WebProcess can ask
the WebsiteDataStore to register a resource load observer during platform initialization.
2. Some WebView uses do not enable WebsiteDataStore, and should not activate a resource load
statistics observer.
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::registerSharedResourceLoadObserver): Added.
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize): If the web process is using a WebsiteDataStore,
register a resource load observer.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Added.
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::registerSharedResourceLoadObserver): Added.
* UIProcess/WebsiteData/WebsiteDataStore.h:
2017-02-07 Anders Carlsson <andersca@apple.com>
REGRESSION (r211819): [ios-simulator] API tests Coding.WKWebView and Coding.WKWebView_SameConfiguration crashing
https://bugs.webkit.org/show_bug.cgi?id=167947
Reviewed by Tim Horton.
* Platform/spi/ios/UIKitSPI.h:
Add SPI declaration.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
Make sure to call setDrawsBackground here.
(-[WKWebView _populateArchivedSubviews:]):
We don't want to archive the scroll view and the fixed overlay view.
(-[WKWebView setOpaque:]):
Return early if this is called before we have a page (like from -[UIView initWithCoder:]).
2017-02-07 Alex Christensen <achristensen@webkit.org>
Revert r166597
https://bugs.webkit.org/show_bug.cgi?id=167951
Reviewed by Andreas Kling.
CFURLConnectionInvalidateConnectionCache is not commonly called and is likely causing
CFNetwork to be in a strange state when using NSURLSession and invalidating the connection
cache during authentication, especially server trust evaluation. Right now we only call
it when handling memory pressure, and it isn't worth getting into such a strange state
in a poorly tested situation. See rdar://problem/27439617
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::lowMemoryHandler):
(WebKit::NetworkProcess::initializeSandbox):
(WebKit::NetworkProcess::platformLowMemoryHandler): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformLowMemoryHandler): Deleted.
2017-02-07 Brian Burg <bburg@apple.com>
[Mac] Web Automation: NSEventType not initialized in WebAutomationSession::platformSimulateMouseInteraction
https://bugs.webkit.org/show_bug.cgi?id=167902
Reviewed by Joseph Pecoraro.
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
Initialize these to 0, which is not a valid NSEventType. Assert that
each NSEventType has a valid value before attempting to use it.
2017-02-07 Youenn Fablet <youennf@gmail.com>
[WebRTC] LibWebRTC WK2 network stack is not providing correct ports for ICE candidates
https://bugs.webkit.org/show_bug.cgi?id=167939
Reviewed by Sam Weinig.
AddressReady signalling was done by the WebProcess for UDP and ServerTCP as real async sockets in those case do
not send it. But the WebProcess does not have information on the port, as it is assigned by the socket factory
which is in the network process.
Fixed that bug by signalling AddressReady in the network process for UDP, ServerTCP and ClientTCP.
* NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
(WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
(WebKit::LibWebRTCSocketClient::signalAddressReady):
* NetworkProcess/webrtc/LibWebRTCSocketClient.h:
* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createUDPSocket):
(WebKit::NetworkRTCProvider::createServerTCPSocket):
(WebKit::NetworkRTCProvider::createClientTCPSocket):
* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::LibWebRTCSocket::LibWebRTCSocket):
(WebKit::LibWebRTCSocket::signalAddressReady):
2017-02-07 Sam Weinig <sam@webkit.org>
Try to fix the EFL build.
* WebProcess/InjectedBundle/InjectedBundle.cpp:
2017-02-07 Anders Carlsson <andersca@apple.com>
-[WKWebView encodeWithCoder:] needs to call super
https://bugs.webkit.org/show_bug.cgi?id=167945
rdar://problem/29777668
Reviewed by Geoffrey Garen.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView encodeWithCoder:]):
Call super.
2017-02-07 Carlos Garcia Campos <cgarcia@igalia.com>
[Soup] WebKitSoupRequestInputStream can still leave requests unfinished after r211773
https://bugs.webkit.org/show_bug.cgi?id=167929
Reviewed by Michael Catanzaro.
The while loop to process the pending data requests was not a good idea, because having a new pending request
doesn't mean we have more data available, but that more data was requested.
* WebProcess/soup/WebKitSoupRequestInputStream.cpp:
(webkitSoupRequestInputStreamPendingReadAsyncComplete): Process only one request if needed.
2017-02-06 Carlos Garcia Campos <cgarcia@igalia.com>
[Soup] Long resources loaded by custom protocols sometimes never finish loading
https://bugs.webkit.org/show_bug.cgi?id=167890
Reviewed by Michael Catanzaro.
It's another bug that has appeared in WebKitSoupRequestInputStream after moving the custom protocols handling to
the main thread. The problem is that webkitSoupRequestInputStreamPendingReadAsyncComplete invalidates
pendingAsyncRead after calling webkitSoupRequestInputStreamReadAsyncResultComplete, but in some cases
webkitSoupRequestInputStreamReadAsyncResultComplete completes the task in the same run loop iteration. In that
case webkitSoupRequestInputStreamReadAsync is called again creating a new AsyncReadData that is destroyed right
after webkitSoupRequestInputStreamReadAsyncResultComplete returns.
* WebProcess/soup/WebKitSoupRequestInputStream.cpp:
(AsyncReadData::AsyncReadData): Use an rvalue reference for the task.
(webkitSoupRequestInputStreamPendingReadAsyncComplete): Use WTFMove to ensure pendingAsyncRead is cleared before
webkitSoupRequestInputStreamReadAsyncResultComplete is called, and continue processing pending requests if there
are new ones after webkitSoupRequestInputStreamReadAsyncResultComplete.
(webkitSoupRequestInputStreamReadAsync): Use WTFMove to transfer the task to AsyncReadData.
(webkitSoupRequestInputStreamDidFailWithError): Use WTFMove to ensure pendingAsyncRead is cleared.
2017-02-06 Dan Bernstein <mitz@apple.com>
[iOS] -[WKWebView becomeFirstResponder] and -[WKWebView resignFirstResponder] don’t get called when non-programmatic first responder changes happen
https://bugs.webkit.org/show_bug.cgi?id=167898
Reviewed by Tim Horton.
Made WKContentView’s -becomeFirstResponder and -resignFirstResponder forward to the
WKWebView, giving subclasses an opportunity to override these methods. Changed the WKWebView
implementations to call back into WKContentView methods that actually do the work.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView becomeFirstResponder]): If the current content view is a WKContentView, call
-becomeFirstResponderForWebView. Added a check that the content view has a superview to
get the right behavior when this is called during the transition from not having to having
a custom content view.
(-[WKWebView canBecomeFirstResponder]): If the current content view is a WKContentView, call
-canBecomeFirstResponderForWebView.
(-[WKWebView resignFirstResponder]): If the current content view is a WKContentView, call
-resignFirstResponderForWebView.
(-[WKWebView _setHasCustomContentView:loadedMIMEType:]): If the new content view is a
WKContentView, use -canBecomeFirstResponderForWebView.
* UIProcess/ios/WKContentViewInteraction.h: Added _becomingFirstResponder ivar.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canBecomeFirstResponder]): Return _becomingFirstResponder. Normally this is
NO, so code that hit-tests then walks up the view hierarchy to select a first responder
will continue to the WKWebView. But we need to return YES around the call to super’s
-becomeFirstResponder in -becomeFirstResponderForWebView.
(-[WKContentView canBecomeFirstResponderForWebView]): Moved the old
-becomeFirstResponderForWebView implementation here.
(-[WKContentView becomeFirstResponder]): Forward to the WKWebView.
(-[WKContentView becomeFirstResponderForWebView]): Moved the old -becomeFirstResponder
implementation here, setting _becomingFirstResponder to YES around the call to super.
(-[WKContentView resignFirstResponder]): Forward to the WKWebView.
(-[WKContentView resignFirstResponderForWebView]): Moved the old -resignFirstResponder
implementation here.
2017-02-06 Simon Fraser <simon.fraser@apple.com>
Remove assertion in WebViewImpl::performKeyEquivalent()
Reviewed by Wenson Hsieh.
The assertion ASSERT(event == [NSApp currentEvent]) fires when using certain key combinations
in MiniBrowser's location field (e.g. Option-Shift-Arrow to select). The assertion is not correct,
so remove it.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::performKeyEquivalent):
2017-02-06 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Keep the tiled scrolling indicator on-screen when pinching
https://bugs.webkit.org/show_bug.cgi?id=167915
Reviewed by Tim Horton.
Clamp the location to the larger of the location of .unobscuredContentRect() and 0,0.
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
2017-02-06 Simon Fraser <simon.fraser@apple.com>
Tiled scrolling indicator gets doubled up on navigation
https://bugs.webkit.org/show_bug.cgi?id=167909
Reviewed by Tim Horton.
TiledCoreAnimationDrawingArea::updateDebugInfoLayer() would parent a new m_debugInfoLayer
in m_hostingLayer without removing the old one, causing the old tiled scrolling indicator layer
hierarchy to get left in the layer tree.
Also a couple of nullptr/0 -> nil.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
(WebKit::TiledCoreAnimationDrawingArea::updateDebugInfoLayer):
2017-02-06 Alex Christensen <achristensen@webkit.org>
More build fixes after r211751
https://bugs.webkit.org/show_bug.cgi?id=166998
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::authenticate):
(WebKit::NetworkDataTaskSoup::continueAuthenticate):
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
Use the correct partition for credentials.
2017-02-06 Jer Noble <jer.noble@apple.com>
Update sandbox to allow CoreMedia to perform custom media loading.
https://bugs.webkit.org/show_bug.cgi?id=167700
Reviewed by Alexey Proskuryakov.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2017-02-06 Alex Christensen <achristensen@webkit.org>
credentials should be partitioned by main document domain
https://bugs.webkit.org/show_bug.cgi?id=166998
rdar://problem/22901123
Reviewed by Brady Eidson.
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::NetworkDataTask):
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::partition):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
* WebProcess/Network/WebSocketProvider.cpp:
(WebKit::WebSocketProvider::createSocketStreamHandle):
* WebProcess/Network/WebSocketProvider.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::getAuthenticationInfo):
2017-02-06 Anders Carlsson <andersca@apple.com>
Crash child processes if they receive an invalid message
https://bugs.webkit.org/show_bug.cgi?id=167900
Reviewed by Dan Bernstein.
Previously, some processes would try to gracefully exit, others would just drop messages leading to weird bugs.
Instead, set app-specific crash information to the message that failed to be decoded, and then crash.
* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::didReceiveInvalidMessage): Deleted.
* DatabaseProcess/DatabaseProcess.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didReceiveInvalidMessage): Deleted.
* NetworkProcess/NetworkProcess.h:
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::didReceiveInvalidMessage): Deleted.
* PluginProcess/PluginProcess.h:
* Shared/ChildProcess.h:
* Shared/Cocoa/ChildProcessCocoa.mm: Added.
(WebKit::ChildProcess::didReceiveInvalidMessage):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveInvalidMessage): Deleted.
* WebProcess/WebProcess.h:
2017-02-06 Chris Dumez <cdumez@apple.com>
[WK2] Drop legacy WKBundlePageDiagnosticLoggingClient API
https://bugs.webkit.org/show_bug.cgi?id=167883
<rdar://problem/30376695>
Reviewed by Sam Weinig.
Drop legacy WKBundlePageDiagnosticLoggingClient API as I am not aware of any remaining client.
All clients have now switched to the equivalent UIProcess-side API.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetDiagnosticLoggingClient): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h: Removed.
* WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp: Removed.
* WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h: Removed.
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
(WebKit::WebPage::initializeInjectedBundleDiagnosticLoggingClient): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::injectedBundleUIClient):
(WebKit::WebPage::injectedBundleDiagnosticLoggingClient): Deleted.
2017-02-06 Anders Carlsson <andersca@apple.com>
Null check the WebKit::RemoteObjectProxy object before calling it
https://bugs.webkit.org/show_bug.cgi?id=167891
rdar://problem/30229358
Reviewed by Tim Horton.
If a _WKRemoteObjectRegistry invocation reply block outlives its underlying WebKit::RemoteObjectProxy object,
we'll crash trying to send an unused reply to it. Work around this crash by adding a null check before calling
sendUnusedReply.
While this fixes the crash it will lead to leaks in the process that holds on to the reply block. A more long term fix
would be to manage the reply block checkers and call sendUnusedReply when invalidating the _WKRemoteObjectRegistry.
* Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
(-[_WKRemoteObjectRegistry _invokeMethod:]):
2017-02-06 Carlos Garcia Campos <cgarcia@igalia.com>
[Soup] Deadlock in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=167876
Reviewed by Michael Catanzaro.
WebKitSoupRequestInputStream uses a read lock. What is happening is that webkitSoupRequestInputStreamAddData
takes the lock, and it calls webkitSoupRequestInputStreamPendingReadAsyncComplete with the lock help. That
causes webkitSoupRequestInputStreamReadAsync to be called again to read the next chunk, but in the same run loop
operation. We don't really need the read lock because both webkitSoupRequestInputStreamAddData and
webkitSoupRequestInputStreamReadAsync shoudl always be called from the main thread.
* WebProcess/soup/WebKitSoupRequestInputStream.cpp:
(webkitSoupRequestInputStreamReadAsync): Remove the read lock and assert if called from a secondary thread.
(webkitSoupRequestInputStreamAddData): Ditto.
2017-02-03 Anders Carlsson <andersca@apple.com>
Guard and unguard ports in a much less intrusive way
https://bugs.webkit.org/show_bug.cgi?id=167813
Reviewed by Sam Weinig.
Instead of adopting mach_port_construct/mach_port_destruct, just guard and unguard the ports where appropriate.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInitialize):
(IPC::Connection::open):
2017-02-06 Miguel Gomez <magomez@igalia.com>
[GTK][EFL] Release unused UpdateAtlas when in memory pressure situation
https://bugs.webkit.org/show_bug.cgi?id=167872
Reviewed by Carlos Garcia Campos.
In a memory pressure situation, release all the unused UpdateAtlas as soon as possible, instead
of waiting 3 seconds before releasing them.
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired):
(WebKit::CompositingCoordinator::releaseAtlases):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2017-02-05 Simon Fraser <simon.fraser@apple.com>
Remove unparentsOffscreenTiles logic in TileController
https://bugs.webkit.org/show_bug.cgi?id=167823
Reviewed by Tim Horton.
Drive-by fix: make sure we put the tiled scrolling indicator's layer back when switching tabs.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
2017-02-04 Wenson Hsieh <wenson_hsieh@apple.com>
Data interaction on an image should make it stand out when presenting the action sheet
https://bugs.webkit.org/show_bug.cgi?id=167846
<rdar://problem/30363014>
Reviewed by Tim Horton.
Adds infrastructure to improve the behavior of data interaction for images. We make two changes to accomplish
this: first, add some plumbing to WebKit so the web process can tell the UI process when it is done handling a
request to start data interaction, so that the UI process is able to clean up UI-side state in the event that
the page prevented the default behavior.
Secondly, this patch tweaks the heuristic used to present action sheets as popovers. For image elements, if
there is sufficient space around the element, we will use the element rect as the target rect; otherwise, we
fall back to presenting the popover at the touch location.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didHandleStartDataInteractionRequest):
* UIProcess/ios/WKActionSheet.h:
* UIProcess/ios/WKActionSheet.mm:
(-[WKActionSheet presentSheet:]):
Added a presentation style parameter, used to specify whether or not WKActionSheet should present the popover
using the element rect as the target rect, or the touch location.
(-[WKActionSheet doneWithSheet]):
(-[WKActionSheet updateSheetPosition]):
(-[WKActionSheet presentSheet]): Deleted.
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant presentationRectForIndicatedElement]):
Returns the (inflated) bounds of the element that is currently being indicated.
(-[WKActionSheetAssistant showImageSheet]):
(-[WKActionSheetAssistant _presentationStyleForImageAtElementRect:]):
(-[WKActionSheetAssistant showLinkSheet]):
(-[WKActionSheetAssistant showDataDetectorsSheet]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didHandleStartDataInteractionRequest):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
Remove unnecessary function declarations and implementations.
(WebKit::PageClientImpl::didPerformDataInteractionControllerOperation): Deleted.
(WebKit::PageClientImpl::startDataInteractionWithImage): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestStartDataInteraction):
Notify the UI process that the web process is done handling a data interaction request, specifying whether or
not the request was granted.
2017-02-04 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the key shortcut to enable resource usage overlay in GTK+.
The condition to check for CTRL and Shift modifiers is wrong, causing the overlay to be shown on Shit+G and
making it impossible to write a 'G'.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseKeyPressEvent):
2017-02-03 Joseph Pecoraro <pecoraro@apple.com>
Unreviewed rollout of r211486, r211629.
Original change is not ideal and is causing issues.
* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):
2017-02-03 Daniel Bates <dabates@apple.com>
[Mac][WK2] Add SPI to override the Content Security Policy of a page
https://bugs.webkit.org/show_bug.cgi?id=167810
<rdar://problem/30102568>
Reviewed by Anders Carlsson.
Add SPI to WKWebViewConfiguration so that an embedding client can define a custom Content Security
Policy that overrides the Content Security Policy of any page loaded in the web view.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode): Encode instance variable overrideContentSecurityPolicy.
(WebKit::WebPageCreationParameters::decode): Decode instance variable overrideContentSecurityPolicy.
* Shared/WebPageCreationParameters.h:
* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::copy): Copy instance variable overrideContentSecurityPolicy.
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::overrideContentSecurityPolicy): Added.
(API::PageConfiguration::setOverrideContentSecurityPolicy): Added.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Copy overrideContentSecurityPolicy set on the WKWebViewConfiguration
object to the API::PageConfiguration object if non-nil.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]): Copy the instance variable overrideContentSecurityPolicy.
(-[WKWebViewConfiguration _overrideContentSecurityPolicy]): Added.
(-[WKWebViewConfiguration _setOverrideContentSecurityPolicy:]): Added.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Define SPI property _overrideContentSecurityPolicy.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Initialize m_overrideContentSecurityPolicy from the passed
page configuration.
(WebKit::WebPageProxy::creationParameters): Set WebPageCreationParameters::overrideContentSecurityPolicy
so that the WebPage object (in the WebProcess) will know the overridden Content Security Policy
to apply to the document.
* UIProcess/WebPageProxy.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::overrideContentSecurityPolicy): Added. Returns the custom Content
Security Policy to apply to a new document.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::overrideContentSecurityPolicy): Added.
2017-02-03 Anders Carlsson <andersca@apple.com>
Revert toString behavior to what we had in the last version we shipped
https://bugs.webkit.org/show_bug.cgi?id=167814
rdar://problem/30344753
Reviewed by Tim Horton.
This is a speculative fix for a crash that we've seen on recent builds. It simply reverts the toString call back to
what we have in the last version of Safari we shipped.
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
2017-02-03 Chris Dumez <cdumez@apple.com>
Dismiss HTML form validation popover when pressing Escape key
https://bugs.webkit.org/show_bug.cgi?id=167716
<rdar://problem/29872943>
Reviewed by Simon Fraser.
Override ValidationMessageClient::hideAnyValidationMessage().
* WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
(WebKit::WebValidationMessageClient::hideAnyValidationMessage):
* WebProcess/WebCoreSupport/WebValidationMessageClient.h:
2017-02-03 Jeremy Jones <jeremyj@apple.com>
Require keyboard focus for pointer lock.
https://bugs.webkit.org/show_bug.cgi?id=167750
Reviewed by Tim Horton.
When keyboard focus leaves the page, end pointer lock
Prevent pointer lock when the page doesn't have keyboard focus.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::requestPointerLock):
2017-02-03 Anders Carlsson <andersca@apple.com>
Stash away the ports - they will be nulled out before the cancel handlers are called
https://bugs.webkit.org/show_bug.cgi?id=167812
Reviewed by Geoffrey Garen.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open):
2017-02-03 Anders Carlsson <andersca@apple.com>
Inline createReceiveSource in its two call sites
https://bugs.webkit.org/show_bug.cgi?id=167809
Reviewed by Alex Christensen.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open):
(IPC::createReceiveSource): Deleted.
2017-02-03 Wenson Hsieh <wenson_hsieh@apple.com>
WKActionSheet should dismiss with animation when done with the sheet
https://bugs.webkit.org/show_bug.cgi?id=167804
<rdar://problem/30334861>
Reviewed by Tim Horton.
Currently, we do not dismiss the action menu when -doneWithSheet is invoked. While this is okay when the menu is
dismissed via tap (since it will be dismissed as default behavior by the popover controller) we need to manually
dismiss it if we are trying to programmatically dismiss the action sheet/menu.
* UIProcess/ios/WKActionSheet.mm:
(-[WKActionSheet presentSheetFromRect:]):
(-[WKActionSheet doneWithSheet]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView resignFirstResponder]):
2017-02-03 Olivier Blin <olivier.blin@softathome.com>
Doc generation failure in WebKitSecurityOrigin
https://bugs.webkit.org/show_bug.cgi?id=167796
Reviewed by Michael Catanzaro.
* UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
warning: Free-form return value description in webkit_security_origin_get_protocol. Use `Returns:' to avoid ambiguities.
2017-02-03 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add initial implementation of resource usage overlay
https://bugs.webkit.org/show_bug.cgi?id=167731
Reviewed by Michael Catanzaro.
Toggle the resource usage overlay visibility by pressing CTRL + Shift + G. Only available when building with
developer mode enabled.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseKeyPressEvent):
2017-02-03 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r211486) [GTK] The MiniBrowser doesn't work anymore.
https://bugs.webkit.org/show_bug.cgi?id=167776
Reviewed by Yusuke Suzuki.
Since r211486 JSC::initializeThreading() also initializes the main run loop. It would be possible that RunLoop
need to know if it's the main one or not in its constructor, like the GLib impementation does, so we need to
ensure that WTF threading and MainThread are initialized before creating the main RunLoop. This is a quick fix
because the regression made impossible to load anything in a WebView, but I think we should review all the
initialize methods, what they do and how they are called in all the code.
* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2): Call WTF::initializeThreading() and WTF::initializeMainThread() before
JSC::initializeThreading() and do not call RunLoop::initializeMainRunLoop() because it's already called by JSC.
2017-02-03 Csaba Osztrogonác <ossy@webkit.org>
[Mac][cmake] One more unreviewed speculative buildfix after r211403.
https://bugs.webkit.org/show_bug.cgi?id=165478
* UIProcess/API/Cocoa/WKWebView.mm: WebSQLiteDatabaseTrackerClient.h is an iOS specific
header in platform/ios directory which shouldn't and can't be included on non iOS build.
2017-02-03 Csaba Osztrogonác <ossy@webkit.org>
[Mac][cmake] Unreviewed speculative buildfix after r211403.
https://bugs.webkit.org/show_bug.cgi?id=165478
* UIProcess/API/Cocoa/WKWebView.mm: WebBackgroundTaskController.h is an iOS specific
header in platform/ios directory which shouldn't and can't be included on non iOS build.
2017-02-02 Andreas Kling <akling@apple.com>
[Mac] In-process memory pressure monitor for WebContent processes AKA websam
<https://webkit.org/b/167491>
<rdar://problem/30116072>
Reviewed by Antti Koivisto.
Enable the in-process memory monitor for WebContent processes on macOS 10.12+
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
2017-02-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r211535, r211566, and r211568.
https://bugs.webkit.org/show_bug.cgi?id=167765
Causing timeouts? (Requested by andersca_ on #webkit).
Reverted changesets:
"IPC::Connection receive ports should be guarded"
https://bugs.webkit.org/show_bug.cgi?id=167704
http://trac.webkit.org/changeset/211535
"<rdar://problem/30323148> Webkit Nightly on 10.10 broken"
http://trac.webkit.org/changeset/211566
"<rdar://problem/30323148> Webkit Nightly on 10.10 broken"
http://trac.webkit.org/changeset/211568
2017-02-02 Megan Gardner <megan_gardner@apple.com>
Don't attempt wide gammut on older OSes
https://bugs.webkit.org/show_bug.cgi?id=167754
<rdar://problem/29931587>
Reviewed by Tim Horton.
We need to guard our extended color checks the same way throughout the code, or we will attempt to set up
support for wide gamut partially, which causes crashes when using sharable bitmap.
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertImageToBitmap):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
2017-02-02 Enrica Casucci <enrica@apple.com>
WK2: cannot tap on candidate view with hardware keyboard.
https://bugs.webkit.org/show_bug.cgi?id=167761
rdar://problem/28775395
Reviewed by Tim Horton.
The candidate view is a subview of the view returned by
automaticallySelectedOverlay and it should be the unscaled view
instead of the WKContentView.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView automaticallySelectedOverlay]):
2017-02-02 Wenson Hsieh <wenson_hsieh@apple.com>
Drag images should be anchored to the mouse location
https://bugs.webkit.org/show_bug.cgi?id=167690
<rdar://problem/30295261>
Reviewed by Enrica Casucci.
Adds some plumbing for the mouse anchor point in the UI process. Additionally, refactors some unrelated code
for handling data interaction.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::startDataInteractionWithImage):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::startDataInteractionWithImage):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setDragImage):
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag):
2017-02-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r211571 and r211582.
https://bugs.webkit.org/show_bug.cgi?id=167751
This change caused API test WebKit1.MemoryPressureHandler to
fail with an assertion. (Requested by ryanhaddad on #webkit).
Reverted changesets:
"[Mac] In-process memory pressure monitor for WebContent
processes."
https://bugs.webkit.org/show_bug.cgi?id=167491
http://trac.webkit.org/changeset/211571
"Unreviewed attempt to fix the Windows build after r211571."
http://trac.webkit.org/changeset/211582
2017-02-02 Dan Bernstein <mitz@apple.com>
The Make Frameworks Symbolic Link build phase can end up creating a symlink inside the Frameworks subdirectory
https://bugs.webkit.org/show_bug.cgi?id=167745
Reviewed by Tim Horton.
* WebKit2.xcodeproj/project.pbxproj: Pass the -h option to ln(1) so that it will replace,
rather than follow, an existing symlink.
2017-02-02 Andreas Kling <akling@apple.com>
[Mac] In-process memory pressure monitor for WebContent processes.
<https://webkit.org/b/167491>
<rdar://problem/30116072>
Reviewed by Antti Koivisto.
Enable the in-process memory monitor for WebContent processes on macOS 10.12+
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
2017-02-02 Chris Dumez <cdumez@apple.com>
[Crash] com.apple.WebKit.WebContent at WebKit: WebKit::WebPage::fromCorePage()
https://bugs.webkit.org/show_bug.cgi?id=167738
<rdar://problem/30229990>
Reviewed by Andreas Kling.
The BackForwardClient no longer needs to worry about removing HistoryItems
from the PageCache now that WebCore takes care of it.
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::addItemFromUIProcess):
(WebKit::WebBackForwardListProxy::addItem):
(WebKit::WebBackForwardListProxy::close):
* WebProcess/WebPage/WebBackForwardListProxy.h:
2017-02-02 Anders Carlsson <andersca@apple.com>
<rdar://problem/30323148> Webkit Nightly on 10.10 broken
Follow-up fix.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open):
2017-02-02 Anders Carlsson <andersca@apple.com>
<rdar://problem/30323148> Webkit Nightly on 10.10 broken
Try to fix the 10.10 build.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open):
2017-02-01 Anders Carlsson <andersca@apple.com>
Handle m_processLauncher being null in ChildProcessProxy::processIdentifier()
https://bugs.webkit.org/show_bug.cgi?id=167713
rdar://problem/28896113
Reviewed by Dan Bernstein.
This can happen if the process has been explicitly terminated.
* UIProcess/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::processIdentifier):
2017-02-02 Yongjun Zhang <yongjun_zhang@apple.com>
In iOS, we should take background assertion when accessing localstorage databases.
https://bugs.webkit.org/show_bug.cgi?id=165478
Just like in WebKit1, when initializing a WKWebView, initialize the database transaction
tracker client. Also, we should set up the start and end background task blocks here. In
WebKit1, this is done inside UIKit.
Reviewed by Brady Eidson.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _setUpSQLiteDatabaseTrackerClient]): Set up the start/end background task blocks
and database transaction tracker client.
2017-02-01 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the nightly open source build.
Adds more header checks when importing from WebKitAdditions.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2017-02-01 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] With visual viewports, a fixed bottom bar can be clipped out when the keyboard is visible
https://bugs.webkit.org/show_bug.cgi?id=167710
rdar://problem/30100286
Reviewed by Wenson Hsieh.
The unobscuredRectInContentCoordinates passed to -didUpdateVisibleRect:... could project outside
of the bounds of the document, which is OK when rubber-banding, but not when we're in a stable state,
because that can cause fixed elements to get pushed outside the doc. This happened when the keyboard
triggered bottom content insets on the scroll view.
Fix by computing a rectangle which is the "allowed" bounds of fixed content, which is permitted
to extend outside the document bounds only when rubber-banding, and intersect unobscuredRectInContentCoordinates
with that rectangle.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _contentBoundsExtendedForRubberbandingWithScale:]):
(-[WKWebView _updateContentRectsWithState:]):
2017-02-01 Enrica Casucci <enrica@apple.com>
WebProcess crashes in int WTF::__throw_bad_variant_access<int> when expanding/shrinking a block selection.
https://bugs.webkit.org/show_bug.cgi?id=167673
rdar://problem/30229620
Reviewed by Anders Carlsson
This is a speculative fix for a bug that might have been introduced
with http://trac.webkit.org/changeset/208479.
The code in containsRange inline fuction in WebPageIOS.mm has not been
updated when the return value of Range::compareBoundaryPoints was changed
to ExceptionOr<short>.
Since there is already a method containsRange in the Range class that
does the right thing, expandedRangeFromHandle now uses that.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::expandedRangeFromHandle):
(WebKit::containsRange): Deleted.
2017-02-01 Anders Carlsson <andersca@apple.com>
IPC::Connection receive ports should be guarded
https://bugs.webkit.org/show_bug.cgi?id=167704
Reviewed by Tim Horton.
Guarding receive rights will make sure that they won't be closed accidentally. They are created
with a context pointer and can only be unguarded or destructed with the same context pointer.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate):
Use mach_port_destruct and pass the connection pointer as the context.
(IPC::Connection::platformInitialize):
Guard the server port with the connection pointer as the context.
(IPC::Connection::open):
Use mach_port_construct to create the port which lets us avoid a call to mach_port_set_attributes and setMachPortQueueLength.
Make the port guarded and use the connection pointer as the context.
(IPC::createReceiveSource):
Get rid of this and just duplicate the five lines of code in two places. For the receive port we want to use mach_port_destruct
in our cancel handler.
2017-02-01 Andreas Kling <akling@apple.com>
Implement the alwaysRunsAtBackgroundPriority WK2 setting using thread QoS.
<https://webkit.org/b/167387>
<rdar://problem/29711409>
Reviewed by Antti Koivisto.
Remove the old ProcessThrottlerClient implementation of alwaysRunsAtBackgroundPriority
and replace it with WTF::setGlobalMaxQOSClass().
If the setting is enabled, it's passed over to each WK2 child process along with its
bootstrap parameter, and we notify WTF in XPCServiceInitializer(), before anything
too threading related happens.
* Platform/IPC/Connection.cpp:
(IPC::Connection::processIncomingMessage):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::ChildProcessProxy):
(WebKit::ChildProcessProxy::getLaunchOptions):
* UIProcess/ChildProcessProxy.h:
* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::DatabaseProcessProxy):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::NetworkProcessProxy):
(WebKit::NetworkProcessProxy::alwaysRunsAtBackgroundPriority): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::assertionState):
* UIProcess/ProcessThrottlerClient.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::alwaysRunsAtBackgroundPriority): Deleted.
* UIProcess/WebProcessProxy.h:
2017-02-01 Tomas Popela <tpopela@redhat.com>
[GTK] Add an API to add a custom tab into the print dialog
https://bugs.webkit.org/show_bug.cgi?id=151998
Reviewed by Carlos Garcia Campos.
Add a new create-custom-widget signal to the WebKitPrintOperation. The
signal is emitted before the dialog is displayed and it gives an
opportunity to embed a custom widget in the dialog. You can do so by
creating a new WebKitPrintCustomWidget and returning it from the
create-custom-widget signal handler. The WebKitPrintCustomWidget is
emitting two signals:
- update - emitted when the currently selected printer is changed,
to be able to actualize the custom widget based on the
current printer
- apply - emitted when the dialog is closed, just before the
printing will start, to be able e.g. to change content
based on the custom widget state.
* PlatformGTK.cmake:
* UIProcess/API/gtk/WebKitAutocleanups.h:
* UIProcess/API/gtk/WebKitPrintCustomWidget.cpp: Added.
(webkitPrintCustomWidgetSetProperty):
(webkit_print_custom_widget_class_init):
(webkit_print_custom_widget_new):
(webkit_print_custom_widget_get_widget):
(webkit_print_custom_widget_get_title):
(webkitPrintCustomWidgetEmitCustomWidgetApplySignal):
(webkitPrintCustomWidgetEmitUpdateCustomWidgetSignal):
* UIProcess/API/gtk/WebKitPrintCustomWidget.h: Added.
* UIProcess/API/gtk/WebKitPrintCustomWidgetPrivate.h: Added.
* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(webkitPrintOperationAccumulatorObjectHandled):
(webkit_print_operation_class_init):
(notifySelectedPrinterCallback):
(webkitPrintOperationRunDialog):
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
2017-02-01 Antti Koivisto <antti@apple.com>
Load resources speculatively
https://bugs.webkit.org/show_bug.cgi?id=167660
Reviewed by Andreas Kling.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::makeEntry):
Factor to a function.
(WebKit::NetworkCache::Cache::store):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
Support loads where we don't have existing cache entry to validate.
(WebKit::NetworkCache::SpeculativeLoad::didReceiveBuffer):
Synthesize a NetworkCache::Entry if we can't store it.
(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
(WebKit::NetworkCache::SpeculativeLoad::didFailLoading):
(WebKit::NetworkCache::SpeculativeLoad::abort):
(WebKit::NetworkCache::SpeculativeLoad::didComplete):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::constructRevalidationRequest):
Make having existing cache entry optional.
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
Allow validation without validation headers (that is, normal load).
(WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
Make having existing cache entry optional.
(WebKit::NetworkCache::canRevalidate):
Allow speculative loads without validation headers if we have high confidence that the
page is going to request this resource again. This is based on the time span we have
seen this resource being loaded on a given page and how much time has elapsed since we
last loaded it.
For example if we have seen the resource over the last 10 days we'll speculate that it will
be required for the next 5 days.
(WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry): Deleted.
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode):
(WebKit::NetworkCache::SubresourceInfo::decode):
Encode the firstSeen and lastSeen time stamps.
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
(WebKit::NetworkCache::makeSubresourceInfoVector):
(WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
(WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
(WebKit::NetworkCache::SubresourceInfo::lastSeen):
(WebKit::NetworkCache::SubresourceInfo::firstSeen):
(WebKit::NetworkCache::SubresourceInfo::setNonTransient):
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo): Deleted.
(WebKit::NetworkCache::SubresourceInfo::setTransient): Deleted.
2017-02-01 Csaba Osztrogonác <ossy@webkit.org>
[Mac][cmake] Unreviewed speculative buildfix after r211403.
https://bugs.webkit.org/show_bug.cgi?id=167601
* UIProcess/API/Cocoa/WKWebView.mm:
2017-01-31 Antti Koivisto <antti@apple.com>
Teach cache coders to encode time_points
https://bugs.webkit.org/show_bug.cgi?id=167670
Reviewed by Andreas Kling.
Encode time_point instead of duration.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::decodeRecordMetaData):
(WebKit::NetworkCache::Storage::readRecord):
(WebKit::NetworkCache::encodeRecordMetaData):
(WebKit::NetworkCache::Storage::encodeRecord):
(WebKit::NetworkCache::Storage::traverse):
2017-01-31 Brent Fulgham <bfulgham@apple.com>
[WebRTC][WebKit2] Support expanding the sandbox to allow microphone access at process launch
https://bugs.webkit.org/show_bug.cgi?id=167669
<rdar://problem/29974333>
Reviewed by Alexey Proskuryakov.
This change implements a temporary workaround to <rdar://problem/29448368> to allow us to do live
testing of WebRTC microphone access. It should be removed when that underlying bug is fixed.
This change adds a new process creation parameter that indicates whether we wish to expand the
sandbox to allow microphone access.
Tested by WebRTC suite (part of another set of bugs).
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode): Serialize the audio access entitlement handle.
(WebKit::WebProcessCreationParameters::decode): Ditto.
* Shared/WebProcessCreationParameters.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess): Create an entitlement handle and pass along to
the child process.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess): If an audio entitlement (for the microphone)
was desired, expand the sandbox to include access.
2017-01-31 Tim Horton <timothy_horton@apple.com>
Fix the build.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2017-01-31 Anders Carlsson <andersca@apple.com>
Add more CRASH calls to try to figure out why we're failing to send mach ports over the wire
https://bugs.webkit.org/show_bug.cgi?id=167657
Reviewed by Tim Horton.
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openFrontendConnection):
2017-01-31 Wenson Hsieh <wenson_hsieh@apple.com>
Crash when trying to compute global location when the WKContentView does not have a window
https://bugs.webkit.org/show_bug.cgi?id=167627
<rdar://problem/30272380>
Reviewed by Beth Dakin.
Moves data interaction state out of OpenSource and into WebKitAdditions. Work towards fixing a crash in
<rdar://problem/30272380>.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView resignFirstResponder]):
2017-01-31 Youenn Fablet <youennf@gmail.com>
[WebRTC] Add support for WK2 libwebrtc endpoint
https://bugs.webkit.org/show_bug.cgi?id=167306
<rdar://problem/30245426>
Reviewed by Alex Christensen.
Implementation of the LibWebRTC networking in WebKit2.
The following features are required to be moved from WebProcess to NetworkProcess:
1 Resolution of DNS names (RTCResolver)
2 Enumeration of interfaces/gathering of host addresses (RTCMonitor)
3 Implementation of Packet Socket for TCP/UDP communication (RTCSocket).
This patch implements the related classes in WebProcess/NetworkProcess and the integration with libwebrtc.
NetworkProcess implementation is using libwebetc for NetworkRTCMonitor and NetworkRTCSocket.
This ensures an as-close implementation to libwebrtc as possible.
In the future, after getting a better test infrastructure we should try to implement these using native APIs.
Currently, the implementation is as follow:
- libwebrtc is calling WebProcess stack on the rtc network thread
- WebProcess stack is forwarding calls to the main thread and makes related IPC calls
- NetworkProcess receives the IPC calls and forward them to the rtc network thread.
- The calls are processed in the rtc network thread
Conversely, when the rtc network thread wants to notify its client, the reverse path is used.
This patch also implements the LibWebRTCProvider for WebKit2.
This provider uses the related classes to create a peer connection factory that will use them.
* CMakeLists.txt:
* DerivedSources.make:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::rtcProvider):
(WebKit::NetworkConnectionToWebProcess::didClose):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/webrtc/LibWebRTCSocketClient.cpp: Added.
(WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
(WebKit::LibWebRTCSocketClient::sendTo):
(WebKit::LibWebRTCSocketClient::close):
(WebKit::LibWebRTCSocketClient::setOption):
(WebKit::LibWebRTCSocketClient::signalReadPacket):
(WebKit::LibWebRTCSocketClient::signalSentPacket):
(WebKit::LibWebRTCSocketClient::signalAddressReady):
(WebKit::LibWebRTCSocketClient::signalConnect):
(WebKit::LibWebRTCSocketClient::signalClose):
* NetworkProcess/webrtc/LibWebRTCSocketClient.h: Added.
* NetworkProcess/webrtc/NetworkRTCMonitor.cpp: Added.
(WebKit::NetworkRTCMonitor::startUpdating):
(WebKit::NetworkRTCMonitor::stopUpdating):
(WebKit::NetworkRTCMonitor::onNetworksChanged):
* NetworkProcess/webrtc/NetworkRTCMonitor.h: Added.
* NetworkProcess/webrtc/NetworkRTCMonitor.messages.in: Added.
* NetworkProcess/webrtc/NetworkRTCProvider.cpp: Added.
(WebKit::createThread):
(WebKit::NetworkRTCProvider::NetworkRTCProvider):
(WebKit::NetworkRTCProvider::close):
(WebKit::NetworkRTCProvider::createUDPSocket):
(WebKit::NetworkRTCProvider::createServerTCPSocket):
(WebKit::NetworkRTCProvider::createClientTCPSocket):
(WebKit::NetworkRTCProvider::addSocket):
(WebKit::NetworkRTCProvider::takeSocket):
(WebKit::NetworkRTCProvider::didReceiveNetworkRTCSocketMessage):
(WebKit::NetworkRTCProvider::createResolver):
(WebKit::NetworkRTCProvider::stopResolver):
(WebKit::NetworkRTCProvider::resolvedName):
(WebKit::NetworkMessageData::NetworkMessageData):
(WebKit::NetworkRTCProvider::OnMessage):
(WebKit::NetworkRTCProvider::callOnRTCNetworkThread):
(WebKit::NetworkRTCProvider::callSocket):
(WebKit::NetworkRTCProvider::sendFromMainThread):
* NetworkProcess/webrtc/NetworkRTCProvider.h: Added.
(WebKit::NetworkRTCProvider::create):
(WebKit::NetworkRTCProvider::didReceiveNetworkRTCMonitorMessage):
(WebKit::NetworkRTCProvider::Resolver::Resolver):
(WebKit::NetworkRTCProvider::Resolver::~Resolver):
* NetworkProcess/webrtc/NetworkRTCProvider.messages.in: Added.
* NetworkProcess/webrtc/NetworkRTCSocket.cpp: Added.
(WebKit::NetworkRTCSocket::NetworkRTCSocket):
(WebKit::NetworkRTCSocket::sendTo):
(WebKit::NetworkRTCSocket::close):
(WebKit::NetworkRTCSocket::setOption):
* NetworkProcess/webrtc/NetworkRTCSocket.h: Added.
* NetworkProcess/webrtc/NetworkRTCSocket.messages.in: Added.
* Shared/RTCNetwork.cpp: Added.
(WebKit::RTCNetwork::RTCNetwork):
(WebKit::ips):
(WebKit::RTCNetwork::value):
(WebKit::RTCNetwork::IPAddress::decode):
(WebKit::RTCNetwork::IPAddress::encode):
(WebKit::RTCNetwork::decode):
(WebKit::RTCNetwork::encode):
* Shared/RTCNetwork.h: Added.
(WebKit::RTCNetwork::IPAddress::IPAddress):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
* WebProcess/Network/webrtc/LibWebRTCNetwork.h: Added.
(WebKit::LibWebRTCNetwork::monitor):
(WebKit::LibWebRTCNetwork::socketFactory):
(WebKit::LibWebRTCNetwork::socket):
(WebKit::LibWebRTCNetwork::resolver):
* WebProcess/Network/webrtc/LibWebRTCProvider.cpp: Added.
(WebKit::LibWebRTCProvider::createPeerConnection):
* WebProcess/Network/webrtc/LibWebRTCProvider.h: Added.
* WebProcess/Network/webrtc/LibWebRTCResolver.cpp: Added.
(WebKit::sendOnMainThread):
(WebKit::LibWebRTCResolver::Start):
(WebKit::LibWebRTCResolver::GetResolvedAddress):
(WebKit::LibWebRTCResolver::Destroy):
(WebKit::LibWebRTCResolver::setResolvedAddress):
(WebKit::LibWebRTCResolver::setError):
* WebProcess/Network/webrtc/LibWebRTCResolver.h: Added.
* WebProcess/Network/webrtc/LibWebRTCSocket.cpp: Added.
(WebKit::sendOnMainThread):
(WebKit::LibWebRTCSocket::LibWebRTCSocket):
(WebKit::LibWebRTCSocket::~LibWebRTCSocket):
(WebKit::LibWebRTCSocket::GetLocalAddress):
(WebKit::LibWebRTCSocket::GetRemoteAddress):
(WebKit::LibWebRTCSocket::signalAddressReady):
(WebKit::LibWebRTCSocket::signalReadPacket):
(WebKit::LibWebRTCSocket::signalSentPacket):
(WebKit::LibWebRTCSocket::signalConnect):
(WebKit::LibWebRTCSocket::signalClose):
(WebKit::authKey):
(WebKit::LibWebRTCSocket::willSend):
(WebKit::LibWebRTCSocket::SendTo):
(WebKit::LibWebRTCSocket::Close):
(WebKit::LibWebRTCSocket::GetOption):
(WebKit::LibWebRTCSocket::SetOption):
* WebProcess/Network/webrtc/LibWebRTCSocket.h: Added.
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: Added.
(WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
(WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
(WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
(WebKit::LibWebRTCSocketFactory::detach):
(WebKit::LibWebRTCSocketFactory::CreateAsyncResolver):
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.h: Added.
* WebProcess/Network/webrtc/WebRTCMonitor.cpp: Added.
(WebKit::sendOnMainThread):
(WebKit::WebRTCMonitor::StartUpdating):
(WebKit::WebRTCMonitor::StopUpdating):
(WebKit::WebRTCMonitor::networksChanged):
* WebProcess/Network/webrtc/WebRTCMonitor.h: Added.
* WebProcess/Network/webrtc/WebRTCMonitor.messages.in: Added.
* WebProcess/Network/webrtc/WebRTCResolver.cpp: Added.
(WebKit::WebRTCResolver::WebRTCResolver):
(WebKit::WebRTCResolver::setResolvedAddress):
(WebKit::WebRTCResolver::resolvedAddressError):
* WebProcess/Network/webrtc/WebRTCResolver.h: Added.
* WebProcess/Network/webrtc/WebRTCResolver.messages.in: Added.
* WebProcess/Network/webrtc/WebRTCSocket.cpp: Added.
(WebKit::WebRTCSocket::signalOnNetworkThread):
(WebKit::WebRTCSocket::WebRTCSocket):
(WebKit::WebRTCSocket::signalAddressReady):
(WebKit::WebRTCSocket::signalReadPacket):
(WebKit::WebRTCSocket::signalSentPacket):
(WebKit::WebRTCSocket::signalConnect):
(WebKit::WebRTCSocket::signalClose):
* WebProcess/Network/webrtc/WebRTCSocket.h: Added.
* WebProcess/Network/webrtc/WebRTCSocket.messages.in: Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeLibWebRTC):
* WebProcess/WebProcess.h:
(WebKit::WebProcess::libWebRTC):
2017-01-31 Jessie Berlin <jberlin@webkit.org>
Build fix.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::dragImageForView):
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(-[WKPDFLayerControllerDelegate writeItemsToPasteboard:withTypes:]):
(WebKit::PDFPlugin::handleEditingCommand):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFLayerControllerDelegate pdfLayerController:copyItems:withTypes:]):
(WebKit::PDFPlugin::handleEditingCommand):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteAttachment):
(WebKit::WebDragClient::declareAndWriteDragImage):
2017-01-31 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.4 release.
* gtk/NEWS: Add release notes for 2.15.4.
2017-01-31 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix syntax error in GTK+ API docs.
* UIProcess/API/gtk/WebKitWebContext.cpp:
2017-01-31 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Enable CSS Grid Layout by default
https://bugs.webkit.org/show_bug.cgi?id=167578
Reviewed by Michael Catanzaro.
Now that Safari 10.1 is shipping CSS Grid Layout it seems safe to enable the feature by default:
https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_10_1.html
* Shared/WebPreferencesDefinitions.h: Remove Grid Layout from the list of experimental flags and enable it by default.
2017-01-31 Fujii Hironori <Hironori.Fujii@sony.com>
[CoordinatedGraphics] WebCoordinatedSurface::create should do null-check of the return value of ShareableBitmap::createShareable
https://bugs.webkit.org/show_bug.cgi?id=167631
Reviewed by Carlos Garcia Campos.
* Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
(WebKit::WebCoordinatedSurface::create): Do null-check of the
return value of ShareableBitmap::createShareable.
2017-01-31 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Environment variables for enabling/disabling AC mode should take precedence over the API.
https://bugs.webkit.org/show_bug.cgi?id=167605
Reviewed by Žan Doberšek.
Add HardwareAccelerationManager singleton helper to handle the global values for enabling, disabling or forcing
accelerated compositing. This is used by WebPreferences to initialize the values like always, but also by
WebKitSettings to ensure those values are honored and are not changed when it's not possible. This new class can
be used in the future to implement the GPU blacklist.
* PlatformGTK.cmake: Add new files to compilation.
* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_class_init): Document that the setting depends on actual hardware capabilities.
(webkit_settings_set_hardware_acceleration_policy): Check HardwareAccelerationManager before trying to change
the settings.
* UIProcess/gtk/HardwareAccelerationManager.cpp: Added.
(WebKit::HardwareAccelerationManager::singleton):
(WebKit::HardwareAccelerationManager::HardwareAccelerationManager): Initialize m_canUseHardwareAcceleration and
m_forceHardwareAcceleration dependoing on hardware and system capabilites and
WEBKIT_DISABLE_COMPOSITING_MODE/WEBKIT_FORCE_COMPOSITING_MODE variables.
* UIProcess/gtk/HardwareAccelerationManager.h: Added.
(WebKit::HardwareAccelerationManager::canUseHardwareAcceleration):
(WebKit::HardwareAccelerationManager::forceHardwareAcceleration):
* UIProcess/gtk/WebPreferencesGtk.cpp:
(WebKit::WebPreferences::platformInitializeStore): Use HardwareAccelerationManager to set the initial values.
2017-01-30 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] HTTP authentication is not implemented for downloads
https://bugs.webkit.org/show_bug.cgi?id=167583
Reviewed by Michael Catanzaro.
When a normal load is converted to a download, the HTTP authentication happens before the load is converted, and
the download starts already authenticated. However, downloads started by DownloadManager::startDownload use the
DownloadClient API to do the authentication. We don't implement didReceiveAuthenticationChallenge() in our
download client, what makes the load to be cancelled and then fail silently. We should probably add API to
handle downloads authentication, but we can also forward the authentication to the web view for downloads having
a web view associated. That would cover most of the cases, like downloading from the context menu.
* UIProcess/API/gtk/WebKitDownloadClient.cpp: Add didReceiveAuthenticationChallenge implementation.
2017-01-30 Sam Weinig <sam@webkit.org>
JSDOMBinding is too big. Split it up!
https://bugs.webkit.org/show_bug.cgi?id=167601
Reviewed by Darin Adler.
* Shared/WebCoreArgumentCoders.cpp:
Replace include of JSDOMBinding with JSDOMExceptionHandling.
2017-01-30 Andy Estes <aestes@apple.com>
[QuickLook] FrameLoaderClient should return the new QuickLookHandleClient it creates
https://bugs.webkit.org/show_bug.cgi?id=167625
Reviewed by Andreas Kling.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Declared createQuickLookHandleClient().
* WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
(WebKit::WebFrameLoaderClient::createQuickLookHandleClient): Renamed from didCreateQuickLookHandle().
(WebKit::WebFrameLoaderClient::didCreateQuickLookHandle): Renamed to createQuickLookHandleClient().
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp:
(WebKit::WebQuickLookHandleClient::WebQuickLookHandleClient): Set m_fileName and m_uti from
the constructor arguments instead of from handle.
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h:
2017-01-30 Anders Carlsson <andersca@apple.com>
Add some more crash reporter information to diagnose a failed mach_msg
https://bugs.webkit.org/show_bug.cgi?id=167610
Reviewed by Dean Jackson.
Include the receive port name as well.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::readFromMachPort):
2017-01-30 Simon Fraser <simon.fraser@apple.com>
[iOS] position:fixed inside touch-scrollable overflow is mispositioned
https://bugs.webkit.org/show_bug.cgi?id=167604
rdar://problem/29500273
Reviewed by Zalan Bujtas.
Make sure we tell m_webPageProxy.computeCustomFixedPositionRect() when visual viewports are enabled.
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
2017-01-30 Simon Fraser <simon.fraser@apple.com>
Fixed elements should not rubber-band in WK2, nor remain at negative offsets
https://bugs.webkit.org/show_bug.cgi?id=167484
rdar://problem/29453068
Reviewed by Dean Jackson.
Pass in StickToViewportBounds as we did before visual viewports.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect):
2017-01-30 Chris Dumez <cdumez@apple.com>
Update DiagnosticLoggingClient::logDiagnosticMessageWithValue() to take in the value as a double
https://bugs.webkit.org/show_bug.cgi?id=167536
Reviewed by Darin Adler.
Update DiagnosticLoggingClient::logDiagnosticMessageWithValue() to take in the value as a double
instead of a string. The value needs to be numeric and the current API is error-prone.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::logDiagnosticMessage):
(WebKit::NetworkProcess::logDiagnosticMessageWithResult):
(WebKit::NetworkProcess::logDiagnosticMessageWithValue):
* NetworkProcess/NetworkProcess.h:
* Scripts/webkit/messages.py:
(headers_for_type):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
(WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::logDiagnosticMessage):
(WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
(WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/PerActivityStateCPUUsageSampler.cpp:
(WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::goToItem):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logDiagnosticMessage):
(WebKit::WebPageProxy::logDiagnosticMessageWithResult):
(WebKit::WebPageProxy::logDiagnosticMessageWithValue):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
2017-01-30 Csaba Osztrogonác <ossy@webkit.org>
[Mac][cmake] Fix the build after r211354.
https://bugs.webkit.org/show_bug.cgi?id=167565
Unreviewed buildfix.
* PlatformMac.cmake:
2017-01-30 Miguel Gomez <magomez@igalia.com>
[GTK] Scrolling iframes, doesn't redraw their content
https://bugs.webkit.org/show_bug.cgi?id=167581
Reviewed by Carlos Garcia Campos.
Take into account whether we are using AC or not in order to repaint an area after scrolling.
No behaviour change, no new tests.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::invalidateContentsForSlowScroll):
2017-01-30 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK+ debug build after r211365.
Remove invalid assert.
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
2017-01-30 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Do not release OpenGL resource immediately when leaving accelerated compositing mode
https://bugs.webkit.org/show_bug.cgi?id=167544
Reviewed by Michael Catanzaro.
Sometimes the conditions to be in AC mode or not change quickly, and then we leave AC mode just enter it again
after a very short period of time. In those cases we are dropping all the GL resources and the compositor
thread, and creating it again. We could keep the layer tree host alive for a while when exiting AC mode, and
reuse it if we enter AC mode before the previous one has been discarded. While the previous layer tree host is
alive we still need to keep it up to date, for example if the web view is resized or contents size change, and
synchronize with the threaded compositor when it becomes the layer tree host again.
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::~AcceleratedDrawingArea): Discard the previous layer tree host.
(WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea): Initialize the timer to discard the previous layer
tree host.
(WebKit::AcceleratedDrawingArea::pageBackgroundTransparencyChanged): Notify the previous layer tree host if needed.
(WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Ditto.
(WebKit::AcceleratedDrawingArea::updateBackingStoreState): Ditto.
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): Reuse the previous layer tree host if possible.
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow): Exit AC mode and save the layer tree host
starting a timer of 5 seconds to discard it if not reused.
(WebKit::AcceleratedDrawingArea::discardPreviousLayerTreeHost): Invalidate and destroy the previous layer tree host.
(WebKit::AcceleratedDrawingArea::didChangeViewportAttributes): Notify the previous layer tree host if needed.
(WebKit::AcceleratedDrawingArea::deviceOrPageScaleFactorChanged): Ditto.
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): If it's discardable add the action to
be synchronized instead.
(WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): Ditto.
(WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): Ditto.
(WebKit::ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Ditto.
(WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange): Ditto.
(WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportAttributes): Ditto.
(WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable): When the layer tree host becomes discardable,
reset the sync actions and return. When it becomes the real layer tree host again, apply all pending actions to
synchronize with the threaded compositor.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::scroll): Notify the previous layer tree host if needed.
(WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Ditto.
(WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Use AcceleratedDrawingArea::exitAcceleratedCompositingModeNow().
* WebProcess/WebPage/LayerTreeHost.h:
(WebKit::LayerTreeHost::setIsDiscardable): Added.
2017-01-30 Manuel Rego Casasnovas <rego@igalia.com>
[GTK] Remove support to enable/disable experimental features
https://bugs.webkit.org/show_bug.cgi?id=167586
Reviewed by Michael Catanzaro.
As requested in bug #167578 we should remove the support to enable/disable
experimental features in WebKitGTK+.
One reason is that CSS Grid Layout is going to be enabled by default now,
so we don't need it to be in this file.
Another is that this support needs to be rewritten to use
the enumerable experimental features API.
* PlatformGTK.cmake:
* UIProcess/API/gtk/WebKitSettings.cpp:
(webKitSettingsConstructed):
* UIProcess/gtk/ExperimentalFeatures.cpp: Removed.
* UIProcess/gtk/ExperimentalFeatures.h: Removed.
2017-01-30 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add API to handle the accelerated compositing policy
https://bugs.webkit.org/show_bug.cgi?id=167509
Reviewed by Michael Catanzaro.
Now that we have brought back the on demand mode, we should allow applications to choose the policy, without
having to deal with environment variables. Settings also allows to set different policy depending on the web
view, so for example evolution could disable AC for the composer, but leave the on demand mode for the email
viewer. This patch adds a single new setting hardware-acceleration-policy to handle both
acceleratedCompositingEnabled and forceCompositingMode preferences using an enum with values
WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND, WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS and
WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER.
* UIProcess/API/gtk/WebKitSettings.cpp:
(webKitSettingsSetProperty): Add setter for hardware-acceleration-policy property.
(webKitSettingsGetProperty): Add getter for hardware-acceleration-policy property.
(webkit_settings_class_init): Add hardware-acceleration-policy property.
(webkit_settings_get_hardware_acceleration_policy): Return policy according to the preferences.
(webkit_settings_set_hardware_acceleration_policy): set preferences according to the given policy.
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::updatePreferences):
2017-01-29 Carlos Garcia Campos <cgarcia@igalia.com>
[Threaded Compositor] Crash on WebCore::GLContext::version()
https://bugs.webkit.org/show_bug.cgi?id=167559
Reviewed by Michael Catanzaro.
This is happening because TextureMapperPlatformLayerProxy::compositorThreadUpdateTimerFired() is fired after the
threaded compositor is deleted. CoordinatedGraphicsScene::purgeGLResources() should invalidate the proxies
before clearing the map.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::purgeGLResources):
2017-01-29 Nan Wang <n_wang@apple.com>
AX: WKContentView needs to implement UITextInput methods to make speak selection highlighting work
https://bugs.webkit.org/show_bug.cgi?id=166955
Reviewed by Ryosuke Niwa.
Implemented methods that Speak Selection can use to retrieve the word/sentence highlighting rects.
* Scripts/webkit/messages.py:
(headers_for_type):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView webSelectionRectsForSelectionRects:]):
(-[WKContentView webSelectionRects]):
(-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
(-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::selectionRectsCallback):
(WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
(WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::visiblePositionForPositionWithOffset):
(WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
(WebKit::rangeNearPositionMatchesText):
(WebKit::WebPage::getRectsAtSelectionOffsetWithText):
2017-01-29 Dan Bernstein <mitz@apple.com>
[iOS] Expose WebCore::DataDetection::detectContentInRange WKWebProcessPlugInRangeHandle
https://bugs.webkit.org/show_bug.cgi?id=167565
Reviewed by Sam Weinig.
Test: TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandle.mm
* Shared/API/Cocoa/WKDataDetectorTypes.h: Added. Moved the enum definition from
WKWebViewConfiguration.h to here.
* Shared/API/Cocoa/WKDataDetectorTypesInternal.h: Added.
(fromWKDataDetectorTypes): Moved from WKWebView.mm.
* UIProcess/API/Cocoa/WKWebView.mm:
(fromWKDataDetectorTypes): Moved to WKDataDetectorTypesInternal.h.
* UIProcess/API/Cocoa/WKWebViewConfiguration.h: Moved WKDataDetectorTypes definition out
to WKDataDetectorTypes.h.
* WebKit2.xcodeproj/project.pbxproj: Added references to new files.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
(-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Added. Calls
DataDetection::detectContentInRange.
2017-01-29 Carlos Garcia Campos <cgarcia@igalia.com>
[Coordinated Graphics] WebPage shouldn't use the layerTreeHost directly
https://bugs.webkit.org/show_bug.cgi?id=167494
Reviewed by Michael Catanzaro.
In Coordinated Graphics we have a couple of methods that the WebPage uses directly from the layer tree host,
instead of using the drawing area interface. This patch adds DrawingArea::didChangeViewportAttributes and
DrawingArea::deviceOrPageScaleFactorChanged and renames LayerTreeHost::didChangeViewportProperties as
LayerTreeHost::didChangeViewportAttributes for consistency.
* Shared/CoordinatedGraphics/SimpleViewportController.cpp:
(WebKit::SimpleViewportController::didChangeViewportAttributes): Receive an rvalue reference to avoid copies.
* Shared/CoordinatedGraphics/SimpleViewportController.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::didChangeViewportAttributes): Forward it to the layer tree host if any.
(WebKit::AcceleratedDrawingArea::deviceOrPageScaleFactorChanged): Ditto.
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportAttributes): Renamed and updated to pass an rvalue reference.
(WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/LayerTreeHost.h:
(WebKit::LayerTreeHost::didChangeViewportAttributes): Renamed and updated to pass an rvalue reference.
(WebKit::LayerTreeHost::didChangeViewportProperties): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged): Use the drawing area.
(WebKit::WebPage::scalePage): Ditto
(WebKit::WebPage::setDeviceScaleFactor): Ditto.
(WebKit::WebPage::viewportPropertiesDidChange): Ditto.
2017-01-28 Carlos Garcia Campos <cgarcia@igalia.com>
[Threaded Compositor] Crash when detaching the CoordinatedGraphicsScene
https://bugs.webkit.org/show_bug.cgi?id=167547
Reviewed by Michael Catanzaro.
It seems that commitSceneState() can be called after the CoordinatedGraphicsScene has been detached.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::commitSceneState): Return early if scene has been detached.
(WebKit::CoordinatedGraphicsScene::detach): Take the render queue lock before clearing the render queue.
2017-01-28 Carlos Garcia Campos <cgarcia@igalia.com>
[Threaded Compositor] Crash when deleting the compositor run loop
https://bugs.webkit.org/show_bug.cgi?id=167545
Reviewed by Michael Catanzaro.
The problem is that we are releasing the WorkQueue before the update timer that keeps a reference to the run
loop, destroyed by the WorkQueue. So, invalidate the WorkQueue in the next run loop iteration to ensure it
happens after the CompositingRunLoop destructor.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::~CompositingRunLoop):
2017-01-28 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] ASSERTION FAILED: !m_layerTreeHost in DrawingAreaImpl::display()
https://bugs.webkit.org/show_bug.cgi?id=167548
Reviewed by Michael Catanzaro.
The problem is that non accelerated compositing forceRepaint implementation is doing a layout and then calling
display. The layout makes the drawing area enter in AC mode and display asserts that we have a layer tree
host. forceRepaint shouldn't do the layout because display already does that and it correctly handles the case
of entering AC mode during the layout. It shouldn't call setNeedsDisplay either, because that schedules a
display, but we are going to display synchronously.
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::forceRepaint):
2017-01-28 Tim Horton <timothy_horton@apple.com>
Don't flash a tap highlight for the entirety of an editable WKWebView
https://bugs.webkit.org/show_bug.cgi?id=167486
<rdar://problem/30193996>
Reviewed by Dan Bernstein.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
Bail from providing a tap highlight if we are about to highlight
the entire body of an editable web view.
2017-01-28 Wenson Hsieh <wenson_hsieh@apple.com>
Check USE(APPLE_INTERNAL_SDK) instead of specific headers when importing from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=167555
Reviewed by Dan Bernstein.
Instead of guarding #import <WebKitAdditions/*> on the existence of the imported file, consult
USE(APPLE_INTERNAL_SDK) instead.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2017-01-28 Yoav Weiss <yoav@yoav.ws>
Add Link Preload as an off-by-default experimental feature menu item.
https://bugs.webkit.org/show_bug.cgi?id=167201
Reviewed by Ryosuke Niwa.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetLinkPreloadEnabled):
(WKPreferencesGetLinkPreloadEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2017-01-28 Joseph Pecoraro <pecoraro@apple.com>
Add User Timing Experimental Feature
https://bugs.webkit.org/show_bug.cgi?id=167542
<rdar://problem/22746307>
Reviewed by Ryosuke Niwa.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetUserTimingEnabled):
(WKPreferencesGetUserTimingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Experimental feature. Off for now while we update ResourceTiming
and NavigationTiming to be compatible with Performance Timing 2.
2017-01-28 Dan Bernstein <mitz@apple.com>
<rdar://problem/30247736> WebKit2-7604.1.5 has failed to build: error: only virtual member functions can be marked 'override'
* UIProcess/ios/PageClientImplIOS.h: Guard the declaration of requestPasswordForQuickLookDocument
with USE(QUICK_LOOK) to match the base class.
* UIProcess/ios/PageClientImplIOS.mm: Guard the implementation as well.
2017-01-27 Dan Bernstein <mitz@apple.com>
[Cocoa] No way to get the text from a WKWebProcessPlugInRangeHandle
https://bugs.webkit.org/show_bug.cgi?id=167535
Reviewed by Sam Weinig.
Added a text property to WKWebProcessPlugInRangeHandle.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: Declare new property.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
(-[WKWebProcessPlugInRangeHandle text]): Added. Calls InjectedBundleRangeHandle::text.
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::text): Added. Calls WebCore::Range::text.
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
2017-01-27 Alex Christensen <achristensen@webkit.org>
Move smartInsertDeleteEnabled to WebPageCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=167530
Reviewed by Brady Eidson.
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::create):
(WebKit::WebPage::WebPage):
(WebKit::m_userInterfaceLayoutDirection):
(WebKit::WebPage::reinitializeWebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
* WebProcess/WebProcess.h:
Instead of making a WebPage then immediately sending it a message to set smartInsertDeleteEnabled,
just call setSmartInsertDeleteEnabled at the end of the WebPage creation. No change in behaviour.
2017-01-27 Brady Eidson <beidson@apple.com>
IconLoadingClient API doesn't work asynchronously.
<rdar://problem/30243429> and https://bugs.webkit.org/show_bug.cgi?id=167532
Reviewed by Alex Christensen.
Make a WTF::Function (inherently not compatible with ObjC blocks as they must be copyable)
into a std::function, which is copyable.
* UIProcess/API/APIIconLoadingClient.h:
(API::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/API/mac/WKView.mm:
(-[WKView maybeInstallIconLoadingClient]):
* UIProcess/Cocoa/IconLoadingDelegate.h:
* UIProcess/Cocoa/IconLoadingDelegate.mm:
(WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getLoadDecisionForIcon):
2017-01-27 Chris Dumez <cdumez@apple.com>
Fix remaining bad uses of logDiagnosticMessageWithValue()
https://bugs.webkit.org/show_bug.cgi?id=167526
Reviewed by Alex Christensen.
Fix remaining bad uses of logDiagnosticMessageWithValue(). It can only
be called with numeric values.
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
(WebKit::NetworkCache::Statistics::recordRetrievalFailure):
(WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::goToItem):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::willStartUserTriggeredZooming):
2017-01-27 Chris Dumez <cdumez@apple.com>
Round CPU Usage diagnostic logging to 2 significant digits
https://bugs.webkit.org/show_bug.cgi?id=167515
<rdar://problem/30236297>
Reviewed by Antti Koivisto.
Round CPU Usage diagnostic logging to 2 significant digits
as requested by diagnostic logging team.
* UIProcess/PerActivityStateCPUUsageSampler.cpp:
(WebKit::toStringRoundingSignificantFigures):
(WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
2017-01-27 Carlos Garcia Campos <cgarcia@igalia.com>
[Threaded Compositor] Stop creating the GLContext on demand the first time makeContextCurrent is called
https://bugs.webkit.org/show_bug.cgi?id=167496
Reviewed by Žan Doberšek.
This is causing problems with animations when entering AC mode on demand. What happens is that the threaded
compositor is created, then the animation is scheduled and during the first animation iteration the GLContext is
created, making the first frame of the animation quite slow. In my computer creating the GLContext takes 0.8
seconds. If the animation duration is less than the time it takes to create the GLContext, the animation ends
without iterating. This causing timeouts in the bots in tests like
animations/animation-iteration-event-destroy-renderer.html that expect webkitAnimationIteration events that
never fire.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::ThreadedCompositor): Create the GLContext right after the compositing thread is
created if we already have a native surface handle.
(WebKit::ThreadedCompositor::createGLContext): Helper to create the GLContext.
(WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Create the GLContext when a native surface
handle is given.
(WebKit::ThreadedCompositor::makeContextCurrent): Deleted.
(WebKit::ThreadedCompositor::renderLayerTree): Make the context cunrrent directly here.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2017-01-27 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Stop forcing accelerated compositing by default
https://bugs.webkit.org/show_bug.cgi?id=167492
Reviewed by Žan Doberšek.
We are now ready to bring back the on demand accelerated compositing mode with the threaded
compositor. Unfortunately, having AC always enabled brought a lot of issues for many people. Not only it
requires a lot more memory but also caused rendering issues (or even nothing rendered at all) with some graphics
drivers. People started to use WEBKIT_DISABLE_COMPOSITING_MODE as a workaround, but that was not expected to be
used by users. So, entering/leaving AC when required by web contents is not actually the solution but a huge
improvement for many people. If we are eventually ready to force AC mode again, we'll change this again. Note
that we still have WEBKIT_DISABLE_COMPOSITING_MODE, but now also WEBKIT_FORCE_COMPOSITING_MODE for testing and debugging.
* UIProcess/gtk/WebPreferencesGtk.cpp:
(WebKit::WebPreferences::platformInitializeStore):
2017-01-26 Chris Dumez <cdumez@apple.com>
Crash when navigating back to a page in PacheCache when one of its frames has been removed
https://bugs.webkit.org/show_bug.cgi?id=167421
<rdar://problem/30188490>
Reviewed by Darin Adler.
Add a new setting allowing layout tests to enable PageCache in a window
that has an opener, for convenience.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetAllowsPageCacheWithWindowOpener):
(WKPreferencesGetAllowsPageCacheWithWindowOpener):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2017-01-26 Keith Miller <keith_miller@apple.com>
classInfo should take a VM so it is not materialized from the object on each call
https://bugs.webkit.org/show_bug.cgi?id=167424
Rubber Stamped by Michael Saboff.
Previously, classInfo() would get the VM from the target's
MarkedBlock. Most callers already have a VM on hand, so it is
wasteful to compute the VM from the marked block every time. This
patch refactors some of the most common callers of classInfo(),
jsDynamicCast and inherits to take a VM as well.
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::elementForNodeHandle):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::getOrCreate):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::getOrCreate):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::reportException):
(WebKit::InjectedBundle::webNotificationID):
(WebKit::InjectedBundle::createWebDataFromUint8Array):
* WebProcess/Plugins/Netscape/JSNPMethod.cpp:
(WebKit::JSNPMethod::finishCreation):
(WebKit::callMethod):
* WebProcess/Plugins/Netscape/JSNPObject.cpp:
(WebKit::JSNPObject::finishCreation):
(WebKit::callNPJSObject):
(WebKit::constructWithConstructor):
* WebProcess/Plugins/Netscape/NPJSObject.cpp:
(WebKit::NPJSObject::create):
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::getOrCreateNPObject):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::frameForContext):
(WebKit::WebFrame::counterValue):
2017-01-26 Chris Dumez <cdumez@apple.com>
Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler
https://bugs.webkit.org/show_bug.cgi?id=167471
<rdar://problem/30221723>
Reviewed by Alex Christensen.
Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler
to use numeric values for logDiagnosticMessageWithValue().
* UIProcess/PerActivityStateCPUUsageSampler.cpp:
(WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
(WebKit::loggingKeyForCPUUsage): Deleted.
2017-01-26 Jeremy Jones <jeremyj@apple.com>
Request pointer unlock on navigation and re-enable pointer-lock tests for WK2.
https://bugs.webkit.org/show_bug.cgi?id=166765
Reviewed by Tim Horton.
When the main frame is load is committed, pointer lock should end.
This resets pointer lock state between tests and allows tests to succeed.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
2017-01-26 Chris Dumez <cdumez@apple.com>
Fix WebGL diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=167463
<rdar://problem/30216981>
Reviewed by Alex Christensen.
Fix WebGL diagnostic logging so that it no longer uses logDiagnosticMessageWithValue().
This is because the value apparently needs to be numeric on Mac.
* UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
(WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
2017-01-26 Wenson Hsieh <wenson_hsieh@apple.com>
Add support for recognizing data interaction gestures in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=167444
Reviewed by Beth Dakin.
Adds a new data interaction gesture recognizer, responsible for determining when to begin data interaction. This
is a new long press gesture recognizer that fires simultaneously with the existing long press gesture
recognizers (for performing long-press actions, and for showing the tap highlight).
Also tweaks logic for determining whether selection gesture recognizers should fire to account for data
interaction -- in particular, we don't want selection gesture recognizers to cause the current selection to
change while data interaction is possible. See -hasSelectablePositionAtPoint and -pointIsInAssistedNode for
more details.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
(WebKit::PageClientImpl::startDataInteractionWithImage):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _createAndConfigureLongPressGestureRecognizer]):
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView resignFirstResponder]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsInDataInteractionContent:]):
(-[WKContentView pointIsInAssistedNode:]):
2017-01-26 Matt Rajca <mrajca@apple.com>
Notify clients when the user plays media otherwise prevented from autoplaying
https://bugs.webkit.org/show_bug.cgi?id=167390
Reviewed by Alex Christensen.
* UIProcess/API/APIUIClient.h:
(API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* WebProcess/WebCoreSupport/WebChromeClient.h:
2017-01-26 Anders Carlsson <andersca@apple.com>
Don't use _CFBundleCreateUnique on Yosemite, it's not available there
https://bugs.webkit.org/show_bug.cgi?id=167459
rdar://problem/30181179
Reviewed by Beth Dakin.
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::getPluginInfo):
2017-01-26 Alex Christensen <achristensen@webkit.org>
Add SPI for updating WebsitePolicies
https://bugs.webkit.org/show_bug.cgi?id=167040
Reviewed by Brady Eidson.
In r209558 we added a way to send a WebsitePolicies structure to the WebProcess during navigation.
If the UIProcess wants to update these policies on a WKWebView while a page is open, we will
need to have SPI for doing so. This adds such SPI, but it's not hooked up to change functionality yet.
* UIProcess/API/C/WKPage.cpp:
(WKPageUpdateWebsitePolicies):
* UIProcess/API/C/WKPage.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateWebsitePolicies:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateWebsitePolicies):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateWebsitePolicies):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2017-01-26 Carlos Garcia Campos <cgarcia@igalia.com>
[Threaded Compositor] Update also the contents size when creating the threaded compositor
https://bugs.webkit.org/show_bug.cgi?id=167452
Reviewed by Žan Doberšek.
In r210954 we ensured that the threaded compositor and the viewport controller were created with the initial web
page size. If we don't update the contents size, the visible rectangle will be empty and tiles won't be created
until contentsSizeDidChange is called. It's even possible, when entering AC mode on demand, that we create the
layer tree host after the contents size changed, in which case nothing is rendered unless we resize the window.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
2017-01-26 Csaba Osztrogonác <ossy@webkit.org>
[Mac][cmake] Fix the build after r211160
https://bugs.webkit.org/show_bug.cgi?id=167451
Unreviewed buildfix.
* UIProcess/API/Cocoa/WKWebView.mm:
2017-01-25 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r211193.
This change broke internal builds.
Reverted changeset:
"Notify clients when the user plays media otherwise prevented
from autoplaying"
https://bugs.webkit.org/show_bug.cgi?id=167390
http://trac.webkit.org/changeset/211193
2017-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Add infrastructure to support data interaction in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=167443
Reviewed by Simon Fraser.
Adds plumbing for two new XPC messages: WebPageProxy::DidPerformDataInteractionControllerOperation and
WebPage::RequestStartDataInteraction. Additionally, adds a new field to InteractionInformationAtPosition that
indicates whether or not there is data to interact with at a given location.
This patch only adds infrastructure, and does not change any behavior.
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
(WebKit::PageClientImpl::startDataInteractionWithImage):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didPerformDataInteractionControllerOperation):
(WebKit::requestStartDataInteraction):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
(WebKit::PageClientImpl::startDataInteractionWithImage):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestStartDataInteraction):
(WebKit::WebPage::getPositionInformation):
2017-01-25 Tim Horton <timothy_horton@apple.com>
Stop inheriting from UIWebScrollView, just use UIScrollView
https://bugs.webkit.org/show_bug.cgi?id=167440
<rdar://problem/7729691>
Reviewed by Simon Fraser.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView scrollViewWillBeginDragging:]):
* UIProcess/ios/WKScrollView.h:
* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView initWithFrame:]): Deleted.
(-[WKScrollView setDecelerationRate:]): Deleted.
Inherit directly from UIScrollView, no need for UIWebScrollView.
Set the few settings we care about directly.
This has the side effect of reducing the default rate of scroll deceleration.
2017-01-25 Matt Rajca <mrajca@apple.com>
Notify clients when the user plays media otherwise prevented from autoplaying
https://bugs.webkit.org/show_bug.cgi?id=167390
Reviewed by Alex Christensen.
* UIProcess/API/APIUIClient.h:
(API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
* WebProcess/WebCoreSupport/WebChromeClient.h:
2017-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Refactor drag and drop implementation on Mac
https://bugs.webkit.org/show_bug.cgi?id=167427
Reviewed by Enrica Casucci.
See WebCore ChangeLog for more details.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2017-01-25 Andy Estes <aestes@apple.com>
Use #pragma once in a few places
https://bugs.webkit.org/show_bug.cgi?id=167435
Reviewed by Alex Christensen.
* UIProcess/PageClient.h:
* UIProcess/ios/PageClientImplIOS.h:
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h:
2017-01-25 Andy Estes <aestes@apple.com>
[QuickLook] Display a WKPasswordView when a document is password-protected
https://bugs.webkit.org/show_bug.cgi?id=167407
<rdar://problem/28544527>
Reviewed by Alex Christensen.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _hidePasswordView]): Added an early return if there is no _passwordView.
* UIProcess/PageClient.h: Declared requestPasswordForQuickLookDocument().
(WebKit::PageClient::didStartProvisionalLoadForMainFrame): Added an no-op base class
implementation.
(WebKit::PageClient::didFailProvisionalLoadForMainFrame): Ditto.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Called
PageClient::didStartProvisionalLoadForMainFrame() if frame is the main frame.
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame): Ditto for
PageClient::didFailProvisionalLoadForMainFrame().
* UIProcess/WebPageProxy.h: Declared didRequestPasswordForQuickLookDocumentInMainFrame().
* UIProcess/WebPageProxy.messages.in: Added message
DidRequestPasswordForQuickLookDocumentInMainFrame.
* UIProcess/ios/PageClientImplIOS.h: Overrode requestPasswordForQuickLookDocument(),
didStartProvisionalLoadForMainFrame(), and didFailProvisionalLoadForMainFrame().
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Called
-[WKWebView _hidePasswordView].
(WebKit::PageClientImpl::didFailProvisionalLoadForMainFrame): Ditto.
(WebKit::PageClientImpl::didCommitLoadForMainFrame): Ditto.
(WebKit::PageClientImpl::requestPasswordForQuickLookDocument): If there is already a
password view, assert that it is for the same fileName. Call
-[WKPasswordView showPasswordFailureAlert] and update the userDidEnterPassword block.
Otherwise, call -[WKWebView _showPasswordViewWithDocumentName:passwordHandler:].
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): Called
PageClient::requestPasswordForQuickLookDocument() with a completion handler that send
message WebPage::DidReceivePasswordForQuickLookDocument.
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp:
(WebKit::passwordCallbacks): Stores a map of page IDs to completion handler functions.
(WebKit::WebQuickLookHandleClient::~WebQuickLookHandleClient): Removes the current page ID
from passwordCallbacks().
(WebKit::WebQuickLookHandleClient::didRequestPassword): Asserts there is no current function
for this page ID in passwordCallbacks(), adds completionHandler to passwordCallbacks(), and
sends message WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame.
(WebKit::WebQuickLookHandleClient::didReceivePassword): Asserts there is a function for this
page ID in passwordCallbacks(), takes the completionHandler from passwordCallbacks(), and
calls it with the received password.
* WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Declared didReceivePassword()
and overrode supportsPasswordEntry() and didRequestPassword().
* WebProcess/WebPage/WebPage.h: Declared didReceivePasswordForQuickLookDocument().
* WebProcess/WebPage/WebPage.messages.in: Added message
DidReceivePasswordForQuickLookDocument.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didReceivePasswordForQuickLookDocument): Called
WebQuickLookHandleClient::didReceivePassword() with the received password and current page ID.
2017-01-25 Youenn Fablet <youennf@gmail.com>
[WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
https://bugs.webkit.org/show_bug.cgi?id=167294
Reviewed by Alex Christensen.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
2017-01-25 Andy Estes <aestes@apple.com>
[iOS] Move WKPDFView's password view to WKWebView
https://bugs.webkit.org/show_bug.cgi?id=167401
Reviewed by Tim Horton.
r210943 moved the PDF password view into the new class WKPasswordView but left it as a
subview of the WKPDFView. To show the password view for Web content, my original plan was to
teach WKContentView to host its own password view, but this turned out not to work. Since
QuickLook needs to unlock a document before determining its preview's MIME type, we have to
ask for a password during provisional navigation, but if the still-committed document is a
PDF then the WKContentView will not be in the view hierarchy.
To ensure password view visibility, this patch moves the ownership of WKPasswordView to
WKWebView and creates an internal API for showing and hiding it. When
-_showPasswordViewWithDocumentName:passwordHandler: is called, WKWebView inserts a new
WKPasswordView as a subview of the scroll view and hides the current content view. The
password view is removed and the current content view is unhidden by -_hidePasswordView.
This also fixes a bug in WKPDFView where a PDF document is laid out incorrectly if the view
size changes while the password view is displayed.
* UIProcess/API/Cocoa/WKWebView.mm: Declared _passwordView.
(-[WKWebView _processDidExit]): Hid the password view.
(-[WKWebView _didCommitLayerTree:]): Ignored if not showing the standard content view.
(-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): Ditto.
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): Ditto.
(-[WKWebView usesStandardContentView]): Changed to return false if _passwordView is non-nil.
(-[WKWebView _updateContentRectsWithState:]): Updated _passwordView's frame with the current
bounds size.
(-[WKWebView _showPasswordViewWithDocumentName:passwordHandler:]): Created a WKPasswordView,
called -showInScrollView:, and hid _currentContentView.
(-[WKWebView _hidePasswordView]): Removed _passwordView from its superview, set
_passwordView to nil, and unhid _currentContentView.
(-[WKWebView _passwordView]): Returned _passwordView.
(-[WKWebView _beginAnimatedResizeWithUpdates:]): Called -usesStandardContentView instead of
checking for a non-nil _customContentView when deciding whether to do a non-animated resize.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/WKPDFView.mm: Removed _passwordView.
(-[WKPDFView web_setMinimumSize:]): Set m_minimumSize and updated the frame size even when a
password view is displayed.
(-[WKPDFView _computePageAndDocumentFrames]): Removed password view code.
(-[WKPDFView _showPasswordEntryField]): Ditto.
(-[WKPDFView _passwordViewFrame]): Deleted.
* UIProcess/ios/WKPasswordView.h:
* UIProcess/ios/WKPasswordView.mm:
(-[WKPasswordView initWithFrame:documentName:]): Stored a copy of documentName in
_documentName.
(-[WKPasswordView documentName]): Added. Returns _documentName.
(-[WKPasswordView showInScrollView:]): Renamed from displayInContentView:. Started saving
zoomScale and contentSize.
(-[WKPasswordView hide]): Started restoring zoomeScale and contentSize.
(-[WKPasswordView showPasswordFailureAlert]): Renamed from -displayPasswordFailureAlert.
(-[WKPasswordView displayInContentView:]): Renamed to -showInScrollView:
(-[WKPasswordView displayPasswordFailureAlert]): Renamed to -showPasswordFailureAlert.
2017-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Add support for named pasteboards, pasteboard strategies and platform pasteboards
https://bugs.webkit.org/show_bug.cgi?id=167404
Reviewed by Enrica Casucci.
Adds support for delivering the pasteboard name to the UI process when writing to or reading from the pasteboard.
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
(WebKit::WebPasteboardProxy::writeImageToPasteboard):
(WebKit::WebPasteboardProxy::writeStringToPasteboard):
(WebKit::WebPasteboardProxy::readStringFromPasteboard):
(WebKit::WebPasteboardProxy::readURLFromPasteboard):
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):
(WebKit::WebPasteboardProxy::getPasteboardItemsCount):
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::writeToPasteboard):
(WebKit::WebPlatformStrategies::getPasteboardItemsCount):
(WebKit::WebPlatformStrategies::readBufferFromPasteboard):
(WebKit::WebPlatformStrategies::readURLFromPasteboard):
(WebKit::WebPlatformStrategies::readStringFromPasteboard):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2017-01-25 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Icon Database should be in private browsing mode for ephemeral web views
https://bugs.webkit.org/show_bug.cgi?id=167414
Reviewed by Michael Catanzaro.
This is already done by WebProcessPool for the legacy private session setting, but only checking the setting and not
whether there are ephemeral web pages or not.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded): Enable icon database private browsing if there's
any ephemeral web view.
(webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded): Disable icon database private browsing if there
aren't ephemeral web views anymore.
(webkit_web_context_set_favicon_database_directory): Enable icon database private browsing if the web context is ephemeral.
(webkitWebContextCreatePageForWebView): Call webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded().
(webkitWebContextWebViewDestroyed): Call webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded().
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewDispose): Ensure webkitWebContextWebViewDestroyed is called only once.
2017-01-25 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] UIProcess from WebKitGtk+ 2.15.x SIGSEGVs because of X Error BadDamage in WebKit::AcceleratedBackingStoreX11::update(WebKit::LayerTreeContext const&) () at Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp:145
https://bugs.webkit.org/show_bug.cgi?id=165656
Reviewed by Michael Catanzaro.
We are incorrectly handling BadDamage errors because the BadDamage value we pass to the XErrorTrapper is not
the actual error code used by X11. Since XDamage is an extension, it has its own errors and a base error
code. We need to use the base error code we get when calling XDamageQueryExtension to pass the right error code
to the XErrorTrapper.
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
(WebKit::AcceleratedBackingStoreX11::create): Get also the damage base error.
(WebKit::xDamageErrorCode): Helper to get the actual error code.
(WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11): Use xDamageErrorCode().
(WebKit::AcceleratedBackingStoreX11::update): Ditto.
2017-01-25 Miguel Gomez <magomez@igalia.com>
[GTK] The inspector is broken when AC support is disabled
https://bugs.webkit.org/show_bug.cgi?id=165237
Reviewed by Carlos Garcia Campos.
WebInspector must not use PageOverlays or GraphicsLayers when AC is not avaialable.
No new tests added.
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::highlight):
(WebKit::WebInspectorClient::showPaintRect):
2017-01-25 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Custom protocols don't work in private browsing mode
https://bugs.webkit.org/show_bug.cgi?id=167236
Reviewed by Sergio Villar Senin.
We only register them in the default session, they should be registered in all existing sessions, and also on
newly created ones.
* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
(WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for
custom protocols.
(WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know
the class was already created in registerProtocolClass(). Setup custom protocols in all existing sessions.
2017-01-24 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add API to create ephemeral web views and deprecate the private browsing setting
https://bugs.webkit.org/show_bug.cgi?id=167370
Reviewed by Michael Catanzaro.
Add API to create ephemeral WebKitWebView, WebKitWebsiteDataManager and WebKitWebContext.
* UIProcess/API/gtk/WebKitSettings.cpp:
(webKitSettingsSetProperty): Ignore deprecation warnings.
(webKitSettingsGetProperty): Ditto.
(webkit_settings_class_init): Mark WebKitSettings:enable-private-browsing as deprecated.
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_new_ephemeral): Create an ephemeral WebKitWebContext. This is just a convenient method to
create a WebKitWebContext with an ephemeral WebKitWebsiteDataManager without having to deal with the manager.
(webkit_web_context_is_ephemeral): Return whether the context is ephemeral.
(webkitWebContextCreatePageForWebView): Configure page with the web view WebKitWebsiteDataManager if it has one.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewConstructed): Check if the WebView is or should be ephemeral and create a non persistent website
data manager if it's an ephemeral web view in a non ephemeral web context.
(webkitWebViewSetProperty): Add setter for is-ephemeral property.
(webkitWebViewGetProperty): Add getter for is-ephemeral property.
(webkit_web_view_class_init): Add is-ephemeral property.
(webkitWebViewHandleAuthenticationChallenge): Check also whether web view is ephemeral.
(webkitWebViewGetWebsiteDataManager): Helper private to return the web view data manager.
(webkit_web_view_new_with_context): Also set is-ephemeral property depending on the context.
(webkit_web_view_is_ephemeral): Return whether the view is ephemeral.
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
(webkitWebsiteDataManagerGetProperty): Add setter for is-ephemeral property.
(webkitWebsiteDataManagerSetProperty): Add getter for is-ephemeral property.
(webkit_website_data_manager_class_init): Add is-ephemeral property.
(webkit_website_data_manager_new_ephemeral): Create a new ephemeral WebKitWebsiteDataManager.
(webkit_website_data_manager_is_ephemeral): Return whether the website data manager is ephemeral.
(webkit_website_data_manager_get_base_data_directory): Return nullptr if manager is ephemeral.
(webkit_website_data_manager_get_base_cache_directory): Ditto.
(webkit_website_data_manager_get_local_storage_directory): Ditto.
(webkit_website_data_manager_get_disk_cache_directory): Ditto.
(webkit_website_data_manager_get_offline_application_cache_directory): Ditto.
(webkit_website_data_manager_get_indexeddb_directory): Ditto.
(webkit_website_data_manager_get_websql_directory): Ditto.
* UIProcess/API/gtk/WebKitWebsiteDataManager.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
2017-01-24 Zalan Bujtas <zalan@apple.com>
Add simple line layout toggle to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=167405
Reviewed by Andreas Kling.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _simpleLineLayoutEnabled]):
(-[WKPreferences _setSimpleLineLayoutEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2017-01-24 Joseph Pecoraro <pecoraro@apple.com>
Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
https://bugs.webkit.org/show_bug.cgi?id=167394
Reviewed by Ryosuke Niwa.
* Configurations/FeatureDefines.xcconfig:
2017-01-24 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Avoid IOSurface readback for snapshot creation
https://bugs.webkit.org/show_bug.cgi?id=167397
rdar://problem/30174873
Reviewed by Tim Horton.
Use IOSurface::sinkIntoImage() for snapshots, to avoid GPU readback.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2017-01-24 Tim Horton <timothy_horton@apple.com>
Script gets touch events even after navigation swipe begins
https://bugs.webkit.org/show_bug.cgi?id=167383
<rdar://problem/22938927>
Reviewed by Simon Fraser.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isNavigationSwipeGestureRecognizer:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/ios/ViewGestureControllerIOS.mm:
(-[WKSwipeTransitionController isNavigationSwipeGestureRecognizer:]):
(WebKit::ViewGestureController::isNavigationSwipeGestureRecognizer):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
Require the navigation swipe gesture recognizer to fail before the
UIWebTouchEventsGestureRecognizer can recognize. This way, the page
doesn't get touch events during the swipe, which previously led to
e.g. carousels scrolling while swiping.
2017-01-24 Matt Rajca <mrajca@apple.com>
Pass down website autoplay policies to media elements
https://bugs.webkit.org/show_bug.cgi?id=167355
Reviewed by Alex Christensen.
Autoplay policies can be specified at the global web view preferences level or on a per-page
basis during navigation. This patch ensures that policies specified on a per-page basis hold
precedence over global policies. If no policies are specified during navigation, global
policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
explicitly specify web view defaults should be used.
* Shared/WebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesGetAutoplayPolicy):
(WKWebsitePoliciesSetAutoplayPolicy):
* UIProcess/API/C/WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setAutoplayPolicy:]):
(-[_WKWebsitePolicies autoplayPolicy]):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2017-01-24 Nan Wang <n_wang@apple.com>
AX: Speak Selection does not work in an iframe
https://bugs.webkit.org/show_bug.cgi?id=166794
<rdar://problem/29913013>
Reviewed by Chris Fleizach.
Making sure WebPage::getSelectionOrContentsAsString() is getting the
selection content in the right frame.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
(-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::getSelectionOrContentsAsString):
2017-01-24 Jer Noble <jer.noble@apple.com>
Make _WKFullscreenDelegate available to users of the WebKit2 C-API.
https://bugs.webkit.org/show_bug.cgi?id=165255
Reviewed by Anders Carlsson.
Add a getter and setter to WKPagePrivate allowing clients to set/get the
_WKFullscreenDelegate associated with the page.
* UIProcess/API/C/mac/WKPagePrivateMac.h:
* UIProcess/API/C/mac/WKPagePrivateMac.mm:
(WKPageSetFullscreenDelegate):
(WKPageGetFullscreenDelegate):
2017-01-23 Anders Carlsson <andersca@apple.com>
The Score Esports crashes on launch
https://bugs.webkit.org/show_bug.cgi?id=167338
rdar://problem/29948645
Reviewed by Dan Bernstein.
* Shared/Cocoa/WKObject.mm:
(+[WKObject conformsToProtocol:]):
Add a class method implementation in case an app ends up calling +[WKObject conformsToProtocol:] for some reason.
2017-01-24 Miguel Gomez <magomez@igalia.com>
[Coordinated Graphics] Ensure that we're in AC mode before trying to create GraphicsLayers
https://bugs.webkit.org/show_bug.cgi?id=167365
Reviewed by Carlos Garcia Campos.
When entering AC on demand, the RenderLayerCompositor wants to create the root GraphicsLayer before the
AcceleratedDrawingArea is in AC mode. This means there's no LayerTreeHost to request the GraphicsLayerFactory,
so no layers are created. Ensure that we are in AC mode before requesting the GraphicsLayerFactory.
No behaviour change, no new tests.
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::graphicsLayerFactory):
2017-01-23 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add API to WebKitWebsiteDataManager to handle website data
https://bugs.webkit.org/show_bug.cgi?id=146589
Reviewed by Michael Catanzaro.
Add WebKitWebsiteData boxed type to wrap a WebsiteDataRecord and new methods to WebKitWebsiteDataManager to
fetch, remove and clear website data.
* PlatformGTK.cmake: Add new files to compilation.
* UIProcess/API/gtk/WebKitWebsiteData.cpp: Added.
(_WebKitWebsiteData::_WebKitWebsiteData):
(recordContainsSupportedDataTypes): Helper function to check if the WebsiteDataRecord contains any type exposed
by our API.
(toWebKitWebsiteDataTypes): Convert from WebKit::WebsiteDataType to the GTK+ public API types.
(webkitWebsiteDataCreate): Create a new WebKitWebsiteData for the given WebsiteDataRecord if it contains any
supported type.
(webkitWebsiteDataGetRecord): Returns the wrapped WebsiteDataRecord.
(webkit_website_data_ref):
(webkit_website_data_unref):
(webkit_website_data_get_name): Return the display name.
(webkit_website_data_get_types): Returns the mask of types.
(webkit_website_data_get_size): Returns the size for the given types.
* UIProcess/API/gtk/WebKitWebsiteData.h: Added.
* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
(toWebsiteDataTypes): Convert from GTK+ public API types to WebKit::WebsiteDataType.
(webkit_website_data_manager_fetch): Fetch website data of the given types.
(webkit_website_data_manager_fetch_finish):
(webkit_website_data_manager_remove): Remove the website data of the given types for the given WebKitWebsiteData list.
(webkit_website_data_manager_remove_finish):
(webkit_website_data_manager_clear): Clear all website data of the given types modified since the given time span.
(webkit_website_data_manager_clear_finish):
* UIProcess/API/gtk/WebKitWebsiteDataManager.h:
* UIProcess/API/gtk/WebKitWebsiteDataPrivate.h: Added.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
* UIProcess/API/gtk/webkit2.h: Inlcude WebKitWebsiteData.h
2017-01-23 Antti Koivisto <antti@apple.com>
Maintain ordering when doing speculative loads
https://bugs.webkit.org/show_bug.cgi?id=167324
Forgot to implement a review comment.
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::makeSubresourceInfoVector):
Allocated initial capacity and use uncheckedAppend.
2017-01-23 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r211062.
https://bugs.webkit.org/show_bug.cgi?id=167354
broke API tests (Requested by alexchristensen on #webkit).
Reverted changeset:
"Pass down website autoplay policies to media elements"
https://bugs.webkit.org/show_bug.cgi?id=167132
http://trac.webkit.org/changeset/211062
2017-01-23 Antti Koivisto <antti@apple.com>
Maintain ordering when doing speculative loads
https://bugs.webkit.org/show_bug.cgi?id=167324
Reviewed by Chris Dumez.
We currently randomize the ordering of speculative loads because they are serialized as a hash map.
It would be better to load in the same order as the requests were originally issued as that is
likely to match the order the document needs them.
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode):
(WebKit::NetworkCache::SubresourceInfo::decode):
Include key into SubresourceInfo.
(WebKit::NetworkCache::makeSubresourcesVector):
Deduplicate the entries.
(WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
(WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
(WebKit::NetworkCache::SubresourceInfo::key):
(WebKit::NetworkCache::SubresourceInfo::setTransient):
(WebKit::NetworkCache::SubresourcesEntry::subresources):
Keep the resources in a Vector instead of a HashMap to maintain order.
2017-01-23 Matt Rajca <mrajca@apple.com>
Pass down website autoplay policies to media elements
https://bugs.webkit.org/show_bug.cgi?id=167132
Reviewed by Alex Christensen.
The playbackRequiresUserGesture APIs are already covered by tests. This patch adds API tests
for autoplay website policies.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2017-01-23 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Asserts seen opening and closing Remote Web Inspector windows
https://bugs.webkit.org/show_bug.cgi?id=167316
<rdar://problem/28891161>
Reviewed by Alexey Proskuryakov.
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
Assume read access, like the local web inspector, to Web Inspector resources.
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::closeWindow):
Clear ourselves as the inspector frontend client when closing.
2017-01-20 Anders Carlsson <andersca@apple.com>
When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
https://bugs.webkit.org/show_bug.cgi?id=167268
rdar://problem/29857388
Reviewed by Sam Weinig.
* WebProcess/Plugins/WebPluginInfoProvider.h:
Make refreshPlugins() private.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::refreshPlugins):
Call the newly added PluginInfoProvider::refresh().
2017-01-23 Antti Koivisto <antti@apple.com>
Use priorities in speculative revalidation
https://bugs.webkit.org/show_bug.cgi?id=167314
Reviewed by Chris Dumez.
We currently do all speculative cache operations with 'Medium' priority
and network operations with 'Low'. We should use the actual request priorities instead.
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::constructRevalidationRequest):
Use priority when constructing validation request.
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
Use priority when retrieving from cache.
(WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode):
(WebKit::NetworkCache::SubresourceInfo::decode):
Save and restore the priority.
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
(WebKit::NetworkCache::SubresourceInfo::priority):
2017-01-23 Jer Noble <jer.noble@apple.com>
Video details does not apear and missing scrubber in Control Center
https://bugs.webkit.org/show_bug.cgi?id=167233
Reviewed by Alex Christensen.
Make requestActiveNowPlayingSessionInfo() and handleActiveNowPlayingSessionInfoResponse()
work in PLATFORM(IOS).
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestActiveNowPlayingSessionInfo]):
(-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
(WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::requestActiveNowPlayingSessionInfo):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::requestActiveNowPlayingSessionInfo): Deleted.
2017-01-23 Chris Dumez <cdumez@apple.com>
REGRESSION (r211033): ASSERTION FAILED: m_ptr in com.apple.WebCore: WTF::RefPtr<WebCore::Element>::operator* const + 70
https://bugs.webkit.org/show_bug.cgi?id=167308
<rdar://problem/30144964>
Unreviewed, do a partial revert of r211033 to fix assertion.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exitFullScreenForElement):
* WebProcess/WebCoreSupport/WebChromeClient.h:
2017-01-20 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
urlParserEnabled parameter is only encoded for COCOA ports
https://bugs.webkit.org/show_bug.cgi?id=167238
Reviewed by Alex Christensen.
This leads to URLParser being enabled on the UI process, since it is
the default, but disabled on the WebProcess, which is the default for
WebProcessCreationParameters, casuing asserts like on tests such as these
due to differences in parsing:
- fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate.html
- fast/loader/window-open-to-invalid-url-calls-policy-delegate.html
- http/tests/inspector/network/copy-as-curl.html
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode): encode urlParserEnabled
(WebKit::WebProcessCreationParameters::decode): decode urlParserEnabled
2017-01-20 Darin Adler <darin@apple.com>
Remove PassRefPtr from "page" directory of WebCore, also deploy references
https://bugs.webkit.org/show_bug.cgi?id=167224
Reviewed by Chris Dumez.
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode): Return a Ref
instead of PassRefPtr.
* UIProcess/Scrolling/RemoteScrollingTree.h: Updated for the above.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay): Pass a reference.
(WKBundlePageUninstallPageOverlay): Ditto.
(WKBundlePageInstallPageOverlayWithAnimation): Ditto.
(WKBundlePageUninstallPageOverlayWithAnimation): Ditto.
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::jsPDFDocPrint): Ditto.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::focusPluginElement): Ditto.
(WebKit::PluginView::setStatusbarText): Ditto.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::elementDidFocus): Updated for changes to ChromeClient.
(WebKit::WebChromeClient::elementDidBlur): Ditto.
(WebKit::WebChromeClient::makeFirstResponder): Ditto.
(WebKit::WebChromeClient::createWindow): Ditto.
(WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Ditto.
(WebKit::WebChromeClient::runJavaScriptAlert): Ditto.
(WebKit::WebChromeClient::runJavaScriptConfirm): Ditto.
(WebKit::WebChromeClient::runJavaScriptPrompt): Ditto.
(WebKit::WebChromeClient::contentsSizeChanged): Ditto.
(WebKit::WebChromeClient::unavailablePluginButtonClicked): Ditto.
(WebKit::WebChromeClient::print): Ditto.
(WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): Ditto.
(WebKit::WebChromeClient::createColorChooser): Ditto.
(WebKit::WebChromeClient::createPopupMenu): Ditto.
(WebKit::WebChromeClient::createSearchPopupMenu): Ditto.
(WebKit::WebChromeClient::attachRootGraphicsLayer): Ditto.
(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer): Ditto.
(WebKit::WebChromeClient::createScrollingCoordinator): Ditto.
(WebKit::WebChromeClient::supportsFullScreenForElement): Ditto.
(WebKit::WebChromeClient::enterFullScreenForElement): Ditto.
(WebKit::WebChromeClient::exitFullScreenForElement): Ditto.
(WebKit::WebChromeClient::didAddHeaderLayer): Ditto.
(WebKit::WebChromeClient::didAddFooterLayer): Ditto.
(WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Ditto.
* WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::elementDidRefocus): Ditto.
(WebKit::WebChromeClient::didReceiveMobileDocType): Ditto.
(WebKit::WebChromeClient::observedContentChange): Ditto.
(WebKit::WebChromeClient::clearContentChangeObservers): Ditto.
(WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchCreatePage): Pass reference.
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::~WebInspectorClient): Ditto.
(WebKit::WebInspectorClient::hideHighlight): Ditto.
(WebKit::WebInspectorClient::showPaintRect): Ditto.
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterPageScroll): Ditto.
(WebKit::FindController::hideFindUI): Ditto.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createWithCoreMainFrame): Return Ref instead of
PassRefPtr.
(WebKit::WebFrame::createSubframe): Ditto.
(WebKit::WebFrame::create): Ditto.
* WebProcess/WebPage/WebFrame.h: Updated for the above.
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openInNewTab): Pass reference.
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::updateFindIndicator): Use reference.
(WebKit::FindController::hideFindIndicator): Ditto.
2017-01-21 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed, rolling out r211012.
It caused a lot of crashes in the network process
Reverted changeset:
"[SOUP] Custom protocols don't work in private browsing mode"
https://bugs.webkit.org/show_bug.cgi?id=167236
http://trac.webkit.org/changeset/211012
2017-01-20 Joseph Pecoraro <pecoraro@apple.com>
Remove never changing IndexedDB RuntimeEnabledFeature
https://bugs.webkit.org/show_bug.cgi?id=167278
Reviewed by Darin Adler.
* WebProcess/WebProcess.cpp:
(WebKit::m_resourceLoadStatisticsStorage):
2017-01-20 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Custom protocols don't work in private browsing mode
https://bugs.webkit.org/show_bug.cgi?id=167236
Reviewed by Sergio Villar Senin.
We only register them in the default session.
* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
(WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for
custom protocols, and setup custom protocols in all existing sessions.
(WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know
the class was already created in registerProtocolClass().
2017-01-20 Brady Eidson <beidson@apple.com>
Require a button press on a gamepad for them to be exposed to the DOM.
<rdar://problem/28620919> and https://bugs.webkit.org/show_bug.cgi?id=167272
Reviewed by Alex Christensen.
* UIProcess/Gamepad/UIGamepadProvider.cpp:
(WebKit::UIGamepadProvider::gamepadSyncTimerFired):
(WebKit::UIGamepadProvider::platformGamepadInputActivity):
* UIProcess/Gamepad/UIGamepadProvider.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::gamepadActivity):
* UIProcess/WebPageProxy.h:
* WebProcess/Gamepad/WebGamepadProvider.cpp:
(WebKit::WebGamepadProvider::gamepadActivity):
* WebProcess/Gamepad/WebGamepadProvider.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::gamepadActivity):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2017-01-20 Joseph Pecoraro <pecoraro@apple.com>
Cleanup RuntimeEnabledFeatures
https://bugs.webkit.org/show_bug.cgi?id=167228
Reviewed by Simon Fraser.
* WebProcess/WebProcess.cpp:
(WebKit::m_resourceLoadStatisticsStorage):
2017-01-20 Joseph Pecoraro <pecoraro@apple.com>
Remove outdated ENABLE(CSP_NEXT) build flag
https://bugs.webkit.org/show_bug.cgi?id=167252
Reviewed by Brent Fulgham.
* Configurations/FeatureDefines.xcconfig:
2017-01-20 Alex Christensen <achristensen@webkit.org>
Fix Mac CMake build.
* CMakeLists.txt:
* PlatformMac.cmake:
2017-01-20 Antoine Quint <graouts@apple.com>
Web Animations should be off by default and enabled as an experimental feature
https://bugs.webkit.org/show_bug.cgi?id=167115
<rdar://problem/30048963>
Reviewed by Joseph Pecoraro.
Promote, or relegate depending on how you see things, the Web Animations preference
to an experimental feature.
* Shared/WebPreferencesDefinitions.h:
2017-01-20 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Turn modern media controls on by default
https://bugs.webkit.org/show_bug.cgi?id=165668
Reviewed by Dean Jackson.
Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
* Shared/WebPreferencesDefinitions.h:
2017-01-20 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.3 release.
* gtk/NEWS: Add release notes for 2.15.3.
2017-01-19 Carlos Garcia Campos <cgarcia@igalia.com>
[Threaded Compositor] Initialize the threaded compositor with the current size
https://bugs.webkit.org/show_bug.cgi?id=167196
Reviewed by Žan Doberšek.
We are always creating the threaded compositor with an empty size and then a sizeDidChange always happen when
the backing store state changes. This is always happening because the threaded compositor is created before the
first backing store state, but if we wanted to create it later, for example to enter/leave AC mode on demand,
the threaded compositor will not have the viewport size unless the window is resized, or sizeDidChange is called
manually when entering AC mode. Creating the threaded compositor is sync and changing the size too, so it's
better to do both things at the same time using the same sync operation.
* Shared/CoordinatedGraphics/SimpleViewportController.cpp:
(WebKit::SimpleViewportController::SimpleViewportController): Pass an initial size to the constructor.
* Shared/CoordinatedGraphics/SimpleViewportController.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::create): Add viewportSize and scaleFactor construction parameters,
(WebKit::ThreadedCompositor::ThreadedCompositor): Ditto. Also mark as needs resize if the given size is not empty.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Initialize the threaded compositor
with an initial viewport size and scale factor.
2017-01-19 Chris Dumez <cdumez@apple.com>
iterable<> should be enabled on WK1
https://bugs.webkit.org/show_bug.cgi?id=167221
<rdar://problem/30108531>
Reviewed by Youenn Fablet.
* Shared/WebPreferencesDefinitions.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2017-01-19 Alex Christensen <achristensen@webkit.org>
Construct URLSearchParams from array or object
https://bugs.webkit.org/show_bug.cgi?id=166973
Reviewed by Sam Weinig.
* NetworkProcess/capture/NetworkCaptureManager.cpp:
(WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
Change std::pair's first/second to WTF::KeyValuePair's key/value.
2017-01-19 Andy Estes <aestes@apple.com>
[iOS] Move the PDF password view into its own class for possible reuse
https://bugs.webkit.org/show_bug.cgi?id=167192
Reviewed by Tim Horton.
* UIProcess/ios/WKPDFView.h: Stopped conforming to UIDocumentPasswordViewDelegate.
* UIProcess/ios/WKPDFView.mm: Changed _passwordView to a WKPasswordView.
(-[WKPDFView _passwordViewFrame]): Returns the frame to set on _passwordView.
(-[WKPDFView _updatePasswordEntryField]): Removed.
(-[WKPDFView _showPasswordEntryField]): Created a WKPasswordView, set a lambda on its
userDidEnterPassword property to do the work previously done in -_tryToUnlockWithPassword:,
and showed the password view.
(-[WKPDFView _keyboardDidShow:]): Moved to WKPasswordView.
(-[WKPDFView _hidePasswordEntryField]): Deleted. The userDidEnterPassword lambda now calls
-[WKPasswordView hide] when the document is unlocked.
(-[WKPDFView userDidEnterPassword:forPasswordView:]): Moved to WKPasswordView.
(-[WKPDFView didBeginEditingPassword:inView:]): Ditto.
(-[WKPDFView didEndEditingPassword:inView:]): Ditto.
(-[WKPDFView _didFailToUnlock]): Ditto.
(-[WKPDFView _tryToUnlockWithPassword:]): Moved into _passwordView's userDidEnterPassword lambda.
* UIProcess/ios/WKPasswordView.h: Added.
* UIProcess/ios/WKPasswordView.mm: Added.
(-[WKPasswordView initWithFrame:documentName:]): Created a UIDocumentPasswordView with
documentName, set self as its passwordDelegate, and added it as a subview.
(-[WKPasswordView layoutSubviews]): Updated _scrollView's contentSize if we are displaying
the view.
(-[WKPasswordView displayInContentView:]): Saved the scroll view's previous minimum/maximum
zoom scale and color, set new values for minimum/maximum zoom scale and color, and added
self as a subview of contentView.
(-[WKPasswordView hide]): Restored the saved minimum/maximum zoom scale and color on the
scroll view and removed self from its superview.
(-[WKPasswordView displayPasswordFailureAlert]): Displayed the alert previously shown by
-[WKPDFView _didFailToUnlock].
(-[WKPasswordView _keyboardDidShow:]): Moved from WKPDFView.
(-[WKPasswordView userDidEnterPassword:forPasswordView:]): Retained self and called the
_userDidEnterPassword block with the password.
(-[WKPasswordView didBeginEditingPassword:inView:]): Moved from WKPDFView.
(-[WKPasswordView didEndEditingPassword:inView:]): Ditto.
* WebKit2.xcodeproj/project.pbxproj:
2017-01-19 Chris Dumez <cdumez@apple.com>
Make sure HTML validation bubble gets dismissed when its associated element's frame gets detached
https://bugs.webkit.org/show_bug.cgi?id=167215
<rdar://problem/29885052>
Reviewed by Andreas Kling.
Make sure HTML validation bubble gets dismissed when its associated
element's frame gets detached and that we do not crash.
* WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
(WebKit::WebValidationMessageClient::documentDetached):
* WebProcess/WebCoreSupport/WebValidationMessageClient.h:
2017-01-19 Chris Dumez <cdumez@apple.com>
Implement per activity state CPU usage reporting using diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=167163
<rdar://problem/30058349>
Reviewed by Andreas Kling.
Implement per activity state CPU usage reporting using diagnostic logging.
* Platform/Logging.h:
* UIProcess/PerActivityStateCPUUsageSampler.cpp: Added.
(WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler):
(WebKit::PerActivityStateCPUUsageSampler::~PerActivityStateCPUUsageSampler):
(WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime):
(WebKit::loggingKeyForActivityState):
(WebKit::loggingKeyForCPUUsage):
(WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
(WebKit::PerActivityStateCPUUsageSampler::pageForLogging):
* UIProcess/PerActivityStateCPUUsageSampler.h: Copied from Source/WebCore/page/ActivityState.h.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
(WebKit::WebProcessPool::reportWebContentCPUTime):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessPool.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::reportProcessCPUTime):
* WebProcess/WebCoreSupport/WebChromeClient.h:
2017-01-19 Dan Bernstein <mitz@apple.com>
Build fix.
Rubber-stamped by Anders Carlsson.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKPaymentAuthorizationStatus): Suppressed deprecation warnings.
2017-01-19 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Variation fonts are erroneously disabled on iOS
https://bugs.webkit.org/show_bug.cgi?id=167172
Reviewed by Simon Fraser.
OpenSource builders don't seem to understand sdk=embedded*.
* Configurations/FeatureDefines.xcconfig:
2017-01-18 Anders Carlsson <andersca@apple.com>
Install WebKit.apinotes with the public headers of WebKit framework
https://bugs.webkit.org/show_bug.cgi?id=167182
rdar://problem/29008989
Reviewed by Sam Weinig.
* Shared/API/Cocoa/WebKit.apinotes: Added.
* WebKit2.xcodeproj/project.pbxproj:
2017-01-19 Brian Burg <bburg@apple.com>
Web Inspector: move Mac-specific automation commands to a separate implementation file
https://bugs.webkit.org/show_bug.cgi?id=163297
<rdar://problem/28718990>
Reviewed by Timothy Hatcher.
Not all Automation commands are available on all platforms. Start splitting out
command declarations and implementations based on the target platform.
* DerivedSources.make:
Set an appropriate --platform so the correct backend interface is generated.
* UIProcess/Automation/Automation.json:
Guard commands that should not be available on iOS:
- resizeWindowOfBrowsingContext
- moveWindowOfBrowsingContext
- inspectBrowsingContext
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::platformSimulateKeySequence): Deleted.
- Move shared convenience macros to header file.
- Move out Cocoa-only or Mac-only command implementations.
* UIProcess/Automation/WebAutomationSession.h:
Rearrange some declarations and switch from USE(APPKIT) to PLATFORM(MAC).
* UIProcess/Automation/WebAutomationSessionMacros.h: Added.
* UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm: Added.
(WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
Moved from WebAutomationSessionCocoa.mm. Add iOS-specific header includes.
* UIProcess/Automation/mac/WebAutomationSessionMac.mm: Renamed from Source/WebKit2/UIProcess/Cocoa/WebAutomationSessionCocoa.mm.
(WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
(WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
(WebKit::WebAutomationSession::inspectBrowsingContext):
Move macOS platform command implementations to here. If other desktop ports want
to use these commands, we can move them somewhere else later.
(WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
(WebKit::WebAutomationSession::markEventAsSynthesizedForAutomation):
(WebKit::WebAutomationSession::wasEventSynthesizedForAutomation):
Move out AppKit-specific event simulation code to here.
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
(WebKit::WebAutomationSession::platformSimulateKeyStroke):
(WebKit::WebAutomationSession::platformSimulateKeySequence):
Move out Mac platformFoo implementations to here.
* WebKit2.xcodeproj/project.pbxproj:
- Added UIProcess/Automation/{mac,cocoa} groups.
- Add new platform-specific implementation files.
2017-01-19 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Provide API to set proxy settings
https://bugs.webkit.org/show_bug.cgi?id=128674
Reviewed by Michael Catanzaro.
Add new method webkit_web_context_set_network_proxy_settings() that allows to set proxy settings in a
WebKitWebContext. It receives an enum WebKitNetworkProxyMode with modes Default, NoProxy and Custom, and an
optional WebKitNetworkProxySettings that is used when mode is Custom. WebKitNetworkProxySettings is a simple
boxed type that user can create to set proxy settins with a similar API to GSimpleProxyResolver.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in: Add SetNetworkProxySettings message.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode): Encode proxy settings.
(WebKit::NetworkProcessCreationParameters::decode): Decode proxy settings.
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/efl/NetworkProcessMainEfl.cpp: Use SoupNetworkSession::setProxySettingsFromEnvironment().
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess): Set proxy settings if provided by the user.
(WebKit::NetworkProcess::setNetworkProxySettings): Set global proxy settings and setup the proxy for all
existing contexts.
* PlatformGTK.cmake: Add new files to compilation.
* Shared/WebCoreArgumentCoders.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode): Encode proxy settings.
(WebKit::WebProcessCreationParameters::decode): Decode proxy settings.
* Shared/WebProcessCreationParameters.h:
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<SoupNetworkProxySettings>::encode): Add encoder implementation for SoupNetworkProxySettings.
(IPC::ArgumentCoder<SoupNetworkProxySettings>::decode): add decoder implementation for SoupNetworkProxySettings.
* UIProcess/API/gtk/WebKitNetworkProxySettings.cpp: Added.
(_WebKitNetworkProxySettings::_WebKitNetworkProxySettings):
(webkitNetworkProxySettingsGetNetworkProxySettings):
(webkit_network_proxy_settings_new): Create a new WebKitNetworkProxySettings with optional default proxy uri and
ignore hosts list.
(webkit_network_proxy_settings_copy):
(webkit_network_proxy_settings_free):
(webkit_network_proxy_settings_add_proxy): Add a proxy uri for a given uri scheme.
* UIProcess/API/gtk/WebKitNetworkProxySettings.h: Added.
* UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h: Added.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_set_network_proxy_settings): Set proxy settings.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols to the documentation.
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitNetworkProxySettings.
* UIProcess/API/gtk/webkit2.h: Include WebKitNetworkProxySettings.h.
* UIProcess/WebProcessPool.h: Add m_networkProxySettings and a setter for soup.
* UIProcess/efl/WebProcessPoolEfl.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Set m_networkProxySettings to parameters.
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Ditto.
(WebKit::WebProcessPool::setNetworkProxySettings): Update m_networkProxySettings and notify all processes.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in: Add SetNetworkProxySettings message.
* WebProcess/efl/WebProcessMainEfl.cpp: Use SoupNetworkSession::setProxySettingsFromEnvironment().
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformSetCacheModel): Remove comment that is no longer true.
(WebKit::WebProcess::platformInitializeWebProcess): Set proxy settings if provided by the user.
(WebKit::WebProcess::setNetworkProxySettings): Set global proxy settings and setup the proxy for all
existing contexts.
2017-01-19 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Do not update the backing store state unnecessarily when page visibility changes
https://bugs.webkit.org/show_bug.cgi?id=167195
Reviewed by Sergio Villar Senin.
I've noticed that we are receiving UpdateBackingStoreState messages in the web process even when size and scale
factor didn't change. That's quite unfortunate because we do a lot of work unnecessarily and we tell the
threaded compositor that the size changed. This is not only a problem because it's not true, but also because
changing the size is a sync operation in the threaded compositor, so we block the compositing thread for
nothing. This is happening because the WebPageProxy notifies the drawing area that the backing store is
discardable when the page is not visible, and that always produces a new backing store state. In accelerating
compositing mode we don't even have a backing store to discard, so we should check we have something to discard
and also make sure we only generate a new backing store state if we really discarded the backing store.
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
(WebKit::DrawingAreaProxyImpl::discardBackingStore):
2017-01-18 Said Abou-Hallawa <sabouhallawa@apple.com>
[iOS][WK2] Remove the WebView private configuration contentUpdateFrequency
https://bugs.webkit.org/show_bug.cgi?id=167188
Reviewed by Simon Fraser.
This patch reverts r209294. This configuration is not needed anymore.
The CADisplayLink::preferredFramesPerSecond for WK2 will be set to the
default value always.
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::setAlwaysRunsAtForegroundPriority):
(API::PageConfiguration::contentUpdateFrequency): Deleted.
(API::PageConfiguration::setContentUpdateFrequency): Deleted.
(): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackAfterFullscreen:]):
(-[WKWebViewConfiguration _contentUpdateFrequency]): Deleted.
(-[WKWebViewConfiguration _setContentUpdateFrequency:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
(WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency): Deleted.
2017-01-18 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r210848.
This change introduced media-related LayoutTest failures and
crashes on macOS.
Reverted changeset:
"[Modern Media Controls] Turn modern media controls on by
default"
https://bugs.webkit.org/show_bug.cgi?id=165668
http://trac.webkit.org/changeset/210848
2017-01-18 Anders Carlsson <andersca@apple.com>
Add instrumentation for when we fail to receive a message
https://bugs.webkit.org/show_bug.cgi?id=167179
Reviewed by Alexey Proskuryakov.
This will help us diagnose what the error from mach_msg is.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::readFromMachPort):
2017-01-18 Alex Christensen <achristensen@webkit.org>
Fix CFURLConnection build on Mac
https://bugs.webkit.org/show_bug.cgi?id=167168
Reviewed by Andy Estes.
* NetworkProcess/Downloads/mac/DownloadMac.mm:
(WebKit::Download::resume):
(WebKit::Download::platformDidFinish):
(WebKit::Download::platformCancelNetworkLoad):
(WebKit::Download::startNetworkLoadWithHandle):
(WebKit::Download::startNetworkLoad):
(WebKit::Download::platformInvalidate):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
(WebKit::serverTrustCredential):
* Shared/Authentication/mac/AuthenticationManager.mac.mm:
(WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
* config.h:
2017-01-18 Alex Christensen <achristensen@webkit.org>
Modernize DelayedReply IPC code
https://bugs.webkit.org/show_bug.cgi?id=167176
Reviewed by Brady Eidson.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* Platform/IPC/HandleMessage.h:
(IPC::callMemberFunctionImpl):
(IPC::callMemberFunction):
(IPC::handleMessageDelayed):
* Scripts/webkit/messages.py:
(message_to_struct_declaration):
(generate_message_handler):
* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
* UIProcess/Databases/DatabaseProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getNetworkProcessConnection):
(WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Plugins/PluginProcessManager.cpp:
(WebKit::PluginProcessManager::getPluginProcessConnection):
* UIProcess/Plugins/PluginProcessManager.h:
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::getPluginProcessConnection):
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runJavaScriptAlert):
(WebKit::WebPageProxy::runJavaScriptConfirm):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::getNetworkProcessConnection):
(WebKit::WebProcessPool::getDatabaseProcessConnection):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getPluginProcessConnection):
(WebKit::WebProcessProxy::getNetworkProcessConnection):
(WebKit::WebProcessProxy::getDatabaseProcessConnection):
* UIProcess/WebProcessProxy.h:
2017-01-18 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
2017-01-18 Megan Gardner <megan_gardner@apple.com>
Ignore Connection Assertion if we are not using connection to send messages
https://bugs.webkit.org/show_bug.cgi?id=167022
Reviewed by Darin Adler.
Ask the process about a particular connection rather that getting it and making the
comparison ourselves.
* UIProcess/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::hasConnection):
Check to see the the ProcessProxy has this particular connection. This get around the assert
that we would run into when just requesting the connection directly.
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::setPasteboardPathnamesForType):
Use the new check instead of getting the raw connection.
2017-01-18 Andreas Kling <akling@apple.com>
Document::securityOrigin() should return a reference.
<https://webkit.org/b/167124>
Reviewed by Sam Weinig.
* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::createTransientLocalStorageMap):
* WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
(WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameCopySecurityOrigin):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::storageBlockingStateChanged):
(WebKit::PluginView::performFrameLoadURLRequest):
(WebKit::PluginView::isPrivateBrowsingEnabled):
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
* WebProcess/Storage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exceededDatabaseQuota):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::didRunInsecureContent):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::allowsFollowingLink):
2017-01-18 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Turn modern media controls on by default
https://bugs.webkit.org/show_bug.cgi?id=165668
Reviewed by Dean Jackson.
Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
* Shared/WebPreferencesDefinitions.h:
2017-01-15 Darin Adler <darin@apple.com>
Remove PassRefPtr from "loader" directory of WebCore
https://bugs.webkit.org/show_bug.cgi?id=167055
Reviewed by Alex Christensen.
* Shared/APIWebArchive.h: Use RefPtr&& instead of PassRefPtr.
* Shared/APIWebArchive.mm:
(API::WebArchive::create): Ditto.
(API::WebArchive::WebArchive): Ditto.
(API::WebArchive::subresources): Ditto.
(API::WebArchive::subframeArchives): Ditto.
* Shared/TextCheckerState.h: Initialize data members so classes
using this won't have to explicitly initalize them.
* UIProcess/WebIconDatabase.cpp:
(WebKit::WebIconDatabase::setIconDataForIconURL): Pass a raw
pointer to WebCore.
* UIProcess/WebPageProxy.h: Removed forward declaration of
StringPairVector, not needed here.
* WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
(WebKit::WebIconDatabaseProxy::WebIconDatabaseProxy): Take a reference.
(WebKit::WebIconDatabaseProxy::retainIconForPageURL): Updated for reference.
(WebKit::WebIconDatabaseProxy::releaseIconForPageURL): Ditto.
(WebKit::WebIconDatabaseProxy::synchronousIconForPageURL): Ditto.
(WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): Ditto.
(WebKit::WebIconDatabaseProxy::receivedIconLoadDecision): Ditto.
(WebKit::WebIconDatabaseProxy::iconDataForIconURL): Ditto.
(WebKit::WebIconDatabaseProxy::setIconURLForPageURL): Ditto.
(WebKit::WebIconDatabaseProxy::setIconDataForIconURL): Ditto.
* WebProcess/IconDatabase/WebIconDatabaseProxy.h: Updated for the above.
Marked the class final, made most functions private and final.
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
(WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
Removed assertion that a pointer is non-null since that pointer is now a
reference. Left use of PassRefPtr here for now.z
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad): Updated since application cache
host is now a reference rather thna a pointer.
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::willSendRequest): Ditto.
(WebKit::WebResourceLoader::didReceiveResponse): Ditto.
(WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::buildHTTPHeaders): Got rid of unneeded use of String::format.
(WebKit::PluginView::create): Take a reference instead of PassRefPtr.
(WebKit::PluginView::PluginView): Ditto. Also moved much of the data
member initialization to the class definition.
(WebKit::PluginView::recreateAndInitialize): Take Ref&& instead of PassRefPtr.
(WebKit::PluginView::manualLoadDidReceiveResponse): Updated for change to
ManualStreamState enumeration.
(WebKit::PluginView::manualLoadDidReceiveData): Ditto.
(WebKit::PluginView::manualLoadDidFinishLoading Ditto.):
(WebKit::PluginView::manualLoadDidFail): Ditto.
(WebKit::PluginView::liveResourceData): Return RefPtr insead of PassRefPtr.
(WebKit::PluginView::redeliverManualStream): Updated for ManualStreamState.
* WebProcess/Plugins/PluginView.h: Updated for the above. Also changed
ManualStreamState into an enum class.
* WebProcess/WebCoreSupport/WebChromeClient.cpp: Changed m_page to a reference.
(WebKit::WebChromeClient::runOpenPanel): Take both arguments as references.
* WebProcess/WebCoreSupport/WebChromeClient.h: Updated for the above.
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerUndoStep): Take reference instead of PassRefPtr.
(WebKit::WebEditorClient::registerRedoStep): Ditto.
* WebProcess/WebCoreSupport/WebEditorClient.h: Updated for the above
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
Updated for change to FrameLoaderClient.
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
(WebKit::WebFrameLoaderClient::dispatchWillSendSubmitEvent): Ditto.
(WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): Ditto.
(WebKit::WebFrameLoaderClient::createFrame): Ditto.
(WebKit::WebFrameLoaderClient::createPlugin): Ditto.
(WebKit::WebFrameLoaderClient::recreatePlugin): Ditto.
(WebKit::WebFrameLoaderClient::createJavaAppletWidget): Ditto.
(WebKit::WebFrameLoaderClient::createNetworkingContext): Ditto.
(WebKit::WebFrameLoaderClient::didRequestAutocomplete): Ditto.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Updated for the above.
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::didReceiveMobileDocType): Updated since m_page is a
reference now.
(WebKit::WebChromeClient::observedContentChange): Ditto.
(WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto.
(WebKit::WebChromeClient::didLayout): Ditto.
(WebKit::WebChromeClient::didStartOverflowScroll): Ditto.
(WebKit::WebChromeClient::didEndOverflowScroll): Ditto.
(WebKit::WebChromeClient::hasStablePageScaleFactor): Ditto.
(WebKit::WebChromeClient::showPlaybackTargetPicker): Ditto.
(WebKit::WebChromeClient::eventThrottlingDelay): Ditto.
(WebKit::WebChromeClient::deviceOrientation): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Pass reference.
(WebKit::WebPage::createPlugin): Return RefPtr instead of PassRefPtr.
(WebKit::WebPage::fromCorePage): Updated for change to WebChromeClient.
(WebKit::WebPage::setHeaderPageBanner): Take pointer instead of PassRefPtr.
(WebKit::WebPage::setFooterPageBanner): Ditto.
(WebKit::WebPage::setActiveOpenPanelResultListener): Take Ref&& instead of
PassRefPtr.
(WebKit::WebPage::currentSelectionAsRange): Return RefPtr instead of PassRefPtr.
(WebKit::WebPage::rangeFromEditingRange): Ditto.
* WebProcess/WebPage/WebPage.h: Updated for the above.
* WebProcess/WebPage/efl/WebPageEfl.cpp:
(WebKit::WebPage::cachedResponseDataForURL): Return RefPtr instead of PassRefPtr.
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::cachedResponseDataForURL): Ditto.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::cachedResponseDataForURL): Ditto.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::cachedResponseDataForURL): Ditto.
(WebKit::WebPage::setTopOverhangImage): Take raw pointer instead of PassRefPtr.
(WebKit::WebPage::setBottomOverhangImage): Ditto.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess): Pass a reference. Move most initialization to
the class definition.
* WebProcess/WebProcess.h: Updaed for the above.
2017-01-17 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r210834
https://bugs.webkit.org/show_bug.cgi?id=165668
It introduced dozens of test timeouts.
Reverted changeset:
"[Modern Media Controls] Turn modern media controls on by default"
https://bugs.webkit.org/show_bug.cgi?id=165668
http://trac.webkit.org/changeset/210834
2017-01-17 Antti Koivisto <antti@apple.com>
Persist derived data
https://bugs.webkit.org/show_bug.cgi?id=167136
Reviewed by Andreas Kling.
Add a mechanism for storing arbitrary data into disk cache.
From WebCore level data can be stored using
loaderStrategy()->storeDerivedDataToCache(key, partition, type, data);
The data is keyed with the body hash of a network resource. It can be retrieved along
with the resource by specifying the type in ResourceLoaderOptions. If a related data
blob is found it will be deliver via CachedResource::didRetrieveDerivedDataFromCache()
callback.
This patch adds the mechanism but doesn't yet use it for anything.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
Look for related resources to return if needed.
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::resourceType):
(WebKit::NetworkCache::Cache::retrieveData):
(WebKit::NetworkCache::Cache::storeData):
(WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::encodeAsStorageRecord):
(WebKit::NetworkCache::Entry::decodeStorageRecord):
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::Key::Key):
* NetworkProcess/cache/NetworkCacheKey.h:
(WebKit::NetworkCache::DataKey::encode):
(WebKit::NetworkCache::DataKey::decode):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::readRecord):
(WebKit::NetworkCache::Storage::traverse):
* NetworkProcess/cache/NetworkCacheStorage.h:
Return body hash with the Record.
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
* Platform/IPC/ArgumentCoders.cpp:
(IPC::ArgumentCoder<SHA1::Digest>::encode):
(IPC::ArgumentCoder<SHA1::Digest>::decode):
* Platform/IPC/ArgumentCoders.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::storeDerivedDataToCache):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didRetrieveDerivedData):
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.messages.in:
2017-01-17 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Turn modern media controls on by default
https://bugs.webkit.org/show_bug.cgi?id=165668
Reviewed by Dean Jackson.
Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
* Shared/WebPreferencesDefinitions.h:
2017-01-17 Joseph Pecoraro <pecoraro@apple.com>
ENABLE(USER_TIMING) Not Defined for Apple Windows or OS X Ports
https://bugs.webkit.org/show_bug.cgi?id=116551
<rdar://problem/13949830>
Reviewed by Alex Christensen.
* Configurations/FeatureDefines.xcconfig:
2017-01-17 Filip Pizlo <fpizlo@apple.com>
JSCell::classInfo() shouldn't have a bunch of mitigations for being called during destruction
https://bugs.webkit.org/show_bug.cgi?id=167066
Reviewed by Keith Miller and Michael Saboff.
Just remove now-erroneous use of jsCast<>.
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::finalize):
2017-01-17 Joseph Pecoraro <pecoraro@apple.com>
Remove unnecessary includes
https://bugs.webkit.org/show_bug.cgi?id=167114
Reviewed by Alex Christensen.
* WebProcess/WebPage/ios/WebPageIOS.mm:
2017-01-17 Brady Eidson <beidson@apple.com>
An update to one gamepad's values should only change that gamepad's modified timestamp.
<rdar://problem/28620865> and https://bugs.webkit.org/show_bug.cgi?id=167139
Reviewed by Andy Estes.
Track the lastModifiedTime for a gamepad in the UI process, and pass it along to web processes.
* Shared/Gamepad/GamepadData.cpp:
(WebKit::GamepadData::GamepadData):
(WebKit::GamepadData::encode):
(WebKit::GamepadData::decode):
* Shared/Gamepad/GamepadData.h:
(WebKit::GamepadData::lastUpdateTime):
* UIProcess/Gamepad/UIGamepad.cpp:
(WebKit::UIGamepad::UIGamepad):
(WebKit::UIGamepad::updateFromPlatformGamepad):
(WebKit::UIGamepad::condensedGamepadData):
(WebKit::UIGamepad::fullGamepadData):
* UIProcess/Gamepad/UIGamepad.h:
* WebProcess/Gamepad/WebGamepad.cpp:
(WebKit::WebGamepad::updateValues):
2017-01-17 Anders Carlsson <andersca@apple.com>
It's not possible to perform a POST request with HTTPBody content in a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=167131
rdar://problem/20464240
Reviewed by Beth Dakin.
Encode/decode the form data if necessary.
* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode):
(WebKit::LoadParameters::decode):
2017-01-17 Joseph Pecoraro <pecoraro@apple.com>
Crash when closing tab with debugger paused
https://bugs.webkit.org/show_bug.cgi?id=161746
<rdar://problem/15607819>
Reviewed by Brian Burg and Brent Fulgham.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::DeferredPageDestructor::createDeferredPageDestructor):
(WebKit::DeferredPageDestructor::DeferredPageDestructor):
(WebKit::DeferredPageDestructor::tryDestruction):
(WebKit::WebPage::close):
Defer destruction of the Page and WebPage if we are in a nested runloop.
Also, proactively close all inspector frontends, including remote frontends.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completeSyntheticClick):
Return early in some cases where a nested run loop may have closed
the WebPage on us while handling JavaScript events.
2017-01-16 Joseph Pecoraro <pecoraro@apple.com>
Remove the REQUEST_ANIMATION_FRAME flag
https://bugs.webkit.org/show_bug.cgi?id=156980
<rdar://problem/25906849>
Reviewed by Simon Fraser.
* Configurations/FeatureDefines.xcconfig:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::syncDisplayState):
(WebKit::CompositingCoordinator::nextAnimationServiceTime):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/LayerTreeHost.h:
2017-01-16 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Accept-language could be set twice in a row for the default context
https://bugs.webkit.org/show_bug.cgi?id=167089
Reviewed by Žan Doberšek.
* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
(WebKit::CustomProtocolManager::registerScheme): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
* NetworkProcess/efl/NetworkProcessMainEfl.cpp:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::userPreferredLanguagesChanged): Only set the languages if NetworkStorageSession has a
SoupNetworkSession.
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::soupSession): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
* WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
(WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
* WebProcess/efl/WebProcessMainEfl.cpp:
2017-01-16 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Fix handling of accept language property
https://bugs.webkit.org/show_bug.cgi?id=166969
Reviewed by Michael Catanzaro.
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::buildAcceptLanguages): Moved from WebCore.
(WebKit::NetworkProcess::userPreferredLanguagesChanged): Build the accept language string from the vector and
pass set it to SoupNetworkSession to be used for new sessions, and also to all other existing sessions.
2017-01-14 Tim Horton <timothy_horton@apple.com>
Remove unused WKView initializer parameter
https://bugs.webkit.org/show_bug.cgi?id=167046
Reviewed by Dan Bernstein.
* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:processPool:configuration:]):
(-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
(-[WKView initWithFrame:configurationRef:]):
(-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
* UIProcess/API/mac/WKViewInternal.h:
Ever since WKWebView stopped having WKView inside it, this parameter
has never been used. Now, it only leads to confusion.
2017-01-13 Joseph Pecoraro <pecoraro@apple.com>
Remove ENABLE(DETAILS_ELEMENT) guards
https://bugs.webkit.org/show_bug.cgi?id=167042
Reviewed by Alex Christensen.
* Configurations/FeatureDefines.xcconfig:
2017-01-13 Brady Eidson <beidson@apple.com>
Crash when visiting a webpage that uses Gamepads in a new WebProcess after a previous page has used gamepads..
https://bugs.webkit.org/show_bug.cgi?id=167033
Reviewed by Alex Christensen.
* UIProcess/Gamepad/UIGamepadProvider.cpp:
(WebKit::UIGamepadProvider::processPoolStartedUsingGamepads): Don't schedule a state update here.
(WebKit::UIGamepadProvider::processPoolStoppedUsingGamepads): Ditto.
* UIProcess/Gamepad/UIGamepadProvider.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::startedUsingGamepads): Populate the WebProcess with initial gamepads.
2017-01-11 Darin Adler <darin@apple.com>
Remove PassRefPtr from more of "platform"
https://bugs.webkit.org/show_bug.cgi?id=166809
Reviewed by Sam Weinig.
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(IPC::ArgumentCoder<TextureMapperAnimation>::encode): Updated since timing function
returns a raw pointer.
(IPC::ArgumentCoder<TextureMapperAnimation>::decode): Updated since timing function
setters now takes an rvalue reference.
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::createScrollbar): Updated since addChild now takes a reference.
2017-01-13 Chris Dumez <cdumez@apple.com>
[WK2] Add diagnostic logging to measure WebGL usage
https://bugs.webkit.org/show_bug.cgi?id=166730
<rdar://problem/29883469>
Reviewed by Alex Christensen.
Add diagnostic logging to measure high performance WebGL usage. We report
at regular intervals in which WebGL state Safari is:
- Inactive
- ActiveInForegroundTab
- ActiveInBackgroundTabOnly
This should give us an estimate of:
- What % of the time is Safari using high performance graphics
- What % of this time is only due to background tabs
* UIProcess/HighPerformanceGraphicsUsageSampler.cpp: Added.
(WebKit::HighPerformanceGraphicsUsageSampler::HighPerformanceGraphicsUsageSampler):
(WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
* UIProcess/HighPerformanceGraphicsUsageSampler.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::setIsUsingHighPerformanceWebGL):
(WebKit::WebPageProxy::isUsingHighPerformanceWebGL):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::m_highPerformanceGraphicsUsageSampler):
* UIProcess/WebProcessPool.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
2017-01-13 Matt Rajca <mrajca@apple.com>
Defer use of autoplay heuristics to clients
https://bugs.webkit.org/show_bug.cgi?id=167010
Reviewed by Alex Christensen.
Switch the autoplay policy tristate to an on/off option since clients should run any
heuristics and simply send their final decision to WebKit.
* Shared/WebsitePolicies.h:
(WebKit::WebsitePolicies::encode):
(WebKit::WebsitePolicies::decode):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesGetAutoplayEnabled):
(WKWebsitePoliciesSetAutoplayEnabled):
(WKWebsitePoliciesGetAutoplayPolicy): Replaced.
(WKWebsitePoliciesSetAutoplayPolicy): Replaced.
* UIProcess/API/C/WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setAutoplayEnabled:]):
(-[_WKWebsitePolicies autoplayEnabled]):
(-[_WKWebsitePolicies setAutoplayPolicy:]): Replaced.
(-[_WKWebsitePolicies autoplayPolicy]): Replaced.
2017-01-13 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Simplify cookie storage handling
https://bugs.webkit.org/show_bug.cgi?id=166967
Reviewed by Sergio Villar Senin.
Get the SoupSession from NetworkStorageSession::defaultStorageSession().
* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
(WebKit::CustomProtocolManager::registerScheme): Get the SoupSession from NetworkStorageSession::defaultStorageSession().
* NetworkProcess/efl/NetworkProcessMainEfl.cpp: Ditto.
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::userPreferredLanguagesChanged): Ditto.
(WebKit::NetworkProcess::platformInitializeNetworkProcess): SoupNetworkSession::clearOldSoupCache is static.
* WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
(WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): Use the cookie storage from NetworkStorageSession::defaultStorageSession().
(WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Ditto.
* WebProcess/efl/WebProcessMainEfl.cpp:
2017-01-12 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Do not use the legacy session ID in WebFrameNetworkingContext::storageSession()
https://bugs.webkit.org/show_bug.cgi?id=166970
Reviewed by Sergio Villar Senin.
Get the session for the current page instead.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::storageSession):
2017-01-12 Joseph Pecoraro <pecoraro@apple.com>
Remove unnecessary includes of Page.h
https://bugs.webkit.org/show_bug.cgi?id=166996
Reviewed by Yusuke Suzuki.
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2017-01-12 Chris Dumez <cdumez@apple.com>
Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=166995
Reviewed by Jer Noble.
Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
as some people are having trouble building without it.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
2017-01-12 Chris Dumez <cdumez@apple.com>
[iOS] HTML form validation popover sometimes does not go away
https://bugs.webkit.org/show_bug.cgi?id=166990
<rdar://problem/29985957>
Reviewed by Tim Horton.
Update code using ValidationBubble now that it is RefCounted.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createValidationBubble):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createValidationBubble):
2017-01-12 Enrica Casucci <enrica@apple.com>
Do not allow selection of editable content when not editing.
https://bugs.webkit.org/show_bug.cgi?id=166897
<rdar://problem/29388806>
Reviewed by Tim Horton.
Test: fast/events/touch/ios/long-press-on-editable.html
When retrieving the position information, we should not consider
as candidates for selection editable elements, since this is only
used for non editable selections.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::isAssistableElement): Moved within the file.
(WebKit::WebPage::getPositionInformation):
2017-01-12 Megan Gardner <megan_gardner@apple.com>
Double Check URLs on UI side before putting in pasteboard
https://bugs.webkit.org/show_bug.cgi?id=166945
<rdar://problem/11187315>
Reviewed by Tim Horton.
Check URLs sent from the web process before putting the on pasteboard.
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::setPasteboardPathnamesForType):
Add a check to make sure the URLs we've received are valid and not compromising to the user's system.
* UIProcess/WebPasteboardProxy.cpp:
(WebKit::WebPasteboardProxy::addWebProcessProxy):
Keep track of the webProcesses associated with the pasteboard proxies specifically, so that we can
use it to check the URLs before putting them on pasteboard.
(WebKit::WebPasteboardProxy::removeWebProcessProxy):
Remove dead webProcesses.
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
Allow for the connection to be passed in, so that we can determine which webProcess we need to
check the URLs of.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):
Make sure to remove WebProcessProxys from the list stored in WebPasteboardProxy
2017-01-12 Chris Dumez <cdumez@apple.com>
[iOS] Implement support for KeyboardEvent.code
https://bugs.webkit.org/show_bug.cgi?id=166932
<rdar://problem/29972518>
Reviewed by Darin Adler.
Make sure KeyboardEvent.code is properly initialized on
iOS WK2.
* Shared/WebEvent.h:
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::createWebKeyboardEvent):
2017-01-12 Andreas Kling <akling@apple.com>
WebBackForwardListProxy should remove restored session history items from PageCache on close.
<https://webkit.org/b/166972>
<rdar://problem/28904157>
Reviewed by Brady Eidson.
Register history item ID's from the UIProcess with the associated-items map
so that we can remove any PageCache entries associated with them immediately
when closing a WebPage.
Otherwise they might not get removed until the next PageCache pruning happens.
This patch is a speculative fix for what looks like it might be weirdness
related to a PageCache entry outliving its originating Page.
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::addItemFromUIProcess):
* WebProcess/WebPage/WebBackForwardListProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::restoreSessionInternal):
2017-01-12 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Correct license on WebKitSecurityOrigin headers
These ought to be LGPLv2+, because the rest of the GTK+ API is LPGLv2+.
* UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
* UIProcess/API/gtk/WebKitSecurityOrigin.h:
* UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
2017-01-12 Eric Carlson <eric.carlson@apple.com>
[MediaStream, Mac] Render media stream audio buffers
https://bugs.webkit.org/show_bug.cgi?id=159836
<rdar://problem/27380390>
Unreviewed, revert accidental change.
* WebProcess/com.apple.WebProcess.sb.in:
2017-01-11 Brady Eidson <beidson@apple.com>
Add IconLoadingDelegate functionality to WKView.
https://bugs.webkit.org/show_bug.cgi?id=166951
Reviewed by Tim Horton.
* UIProcess/API/mac/WKView.mm:
(-[WKView dealloc]):
(-[WKView maybeInstallIconLoadingClient]): If the subclass implements the delegate method, install the
icon loading client. Otherwise, maintain the normal IconDatabase loading behavior.
(-[WKView initWithFrame:processPool:configuration:webView:]):
2017-01-11 Brent Fulgham <bfulgham@apple.com>
[WK2][Cocoa] Avoid null dereference in FullScreen code.
https://bugs.webkit.org/show_bug.cgi?id=166957
<rdar://problem/27745004>
Reviewed by Eric Carlson.
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::didSetupFullscreen): Use protected reference to 'this', and check for valid
page before attempting to use it.
2017-01-11 Anders Carlsson <andersca@apple.com>
navigator.plugins.refresh and WKContextRefreshPlugIns doesn't pick up changes to already-present plug-ins
https://bugs.webkit.org/show_bug.cgi?id=166942
rdar://problem/29839194
Reviewed by Sam Weinig.
Use _CFBundleCreateUnique so the resulting bundle won't be cached.
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::getPluginInfo):
2017-01-11 Anders Carlsson <andersca@apple.com>
REGRESSION: Crash in com.apple.WebKit: IPC::Connection::sendMessage(std::__1::unique_ptr<IPC::MachMessage, std::__1::default_delete<IPC::MachMessage> >) + 27
https://bugs.webkit.org/show_bug.cgi?id=165854
rdar://problem/29757269
Reviewed by Tim Horton.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):
Add assertion.
(IPC::Connection::initializeSendSource):
Turns out the event handler can be called spuriously, so guard against that.
2017-01-11 Chris Dumez <cdumez@apple.com>
[iOS][WK2] KeyboardEvent.key always returns an empty string
https://bugs.webkit.org/show_bug.cgi?id=166918
<rdar://problem/29861147>
Reviewed by Wenson Hsieh.
Make sure that KeyboardEvent.key gets properly initialized on iOS / WK2.
* Shared/WebEvent.h:
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::createWebKeyboardEvent):
2017-01-10 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] No way for applications to set notification permissions without waiting for permission request
https://bugs.webkit.org/show_bug.cgi?id=163366
Reviewed by Carlos Garcia Campos.
Websites can check the Notification.permission DOM property to check if they have permission
to show notifications *without triggering a permission request*. But the WebKitGTK+ API has
no way to affirmatively indicate notifications are allowed without a permission request. The
only way is via the permission request API, which is too late. It's a problem for Epiphany.
For example, open the Riot Matrix client in a web app; you will immediately see an info bar
informing the user that Riot does not have permission to send desktop notifications, even
though Epiphany automatically grants notification permission in web app mode when requested.
This problem is not exclusive to web apps; there is simply no way for notification
permission to be set correctly prior to a permission request for it. Fix this by introducing
a webkit_web_context_initialize_notification_permissions() API, and add a signal
WebKitWebContext::initialize-notification-permissions to indicate when it should be called.
* UIProcess/API/gtk/WebKitNotificationProvider.cpp:
(notificationPermissionsCallback):
(WebKitNotificationProvider::create):
(WebKitNotificationProvider::WebKitNotificationProvider):
(WebKitNotificationProvider::notificationPermissions):
(WebKitNotificationProvider::setNotificationPermissions):
* UIProcess/API/gtk/WebKitNotificationProvider.h:
* UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
(webkitSecurityOriginGetSecurityOrigin):
* UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkit_web_context_class_init):
(addOriginToMap):
(webkit_web_context_initialize_notification_permissions):
(webkitWebContextInitializeNotificationPermissions):
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/WebKitWebContextPrivate.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2017-01-10 Keith Rollin <krollin@apple.com>
Record/replay: fix range used for fuzzy matching
https://bugs.webkit.org/show_bug.cgi?id=166041
Reviewed by Darin Adler and Alex Christensen.
Because of two bugs, the attempt to determine the range of URLs to
check as part of the process of fuzzy matching was failing. The intent
was to find the range of URLs that started with the same
<scheme://host:port> as a given URL. However, because of a reversed
test, the upper end of the range ended up being the "end()" iterator
of the entire collection of URLs. With that fixed, there was another
bug due to one URL being given as <scheme://host:port> and the other
given as <scheme://host:port/> (note the trailing slash). Both of
these issues are now fixed.
* NetworkProcess/capture/NetworkCaptureManager.cpp:
(WebKit::NetworkCapture::Manager::initialize):
(WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
(WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain):
* NetworkProcess/capture/NetworkCaptureManager.h:
* NetworkProcess/capture/NetworkCaptureResource.cpp:
(WebKit::NetworkCapture::Resource::url):
(WebKit::NetworkCapture::Resource::urlIdentifyingCommonDomain):
(WebKit::NetworkCapture::Resource::baseURL): Deleted.
* NetworkProcess/capture/NetworkCaptureResource.h:
2017-01-10 Wenson Hsieh <wenson_hsieh@apple.com>
Implement "proximity" scroll snapping
https://bugs.webkit.org/show_bug.cgi?id=135994
<rdar://problem/18162418>
Reviewed by Dean Jackson.
Adds boilerplate support for plumbing lists of snap offset ranges from the web process to the UI process
alongside the list of snap offsets.
* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateScrollingNode>::encode):
(ArgumentCoder<ScrollingStateScrollingNode>::decode):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ScrollOffsetRange<float>>::encode):
(IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
Adjust mainframe proximity scroll snapping logic to not subtract out the top content inset when there is no
active snap offset (i.e. when snapping rests in a snap offset range). Attempting to subtract out the top inset
in this case caused the scroll offset to jump after ending a drag with no momentum in a snap offset range.
(WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping):
(WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling):
(WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling):
2017-01-10 Zan Dobersek <zdobersek@igalia.com>
ThreadedCoordinatedLayerTreeHost::renderNextFrame() should short-cut to layer flushing
https://bugs.webkit.org/show_bug.cgi?id=157614
Reviewed by Carlos Garcia Campos.
CoordinatedLayerTreeHost prevents any layer flushes while a previously-commited scene
state is still being rendered on the composition thread. renderNextFrame() is called
once that is complete, and a new layer flush is scheduled.
This change improves the whole ordeal by immediately performing the layer flush only if
it was requested during the time we were waiting on the renderer (i.e. when the latest
scene state was being composited), instead of scheduling it unconditionally.
m_scheduledWhileWaitingForRenderer member variable is added to track that occurrence.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
(WebKit::CoordinatedLayerTreeHost::renderNextFrame):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2017-01-09 Chris Dumez <cdumez@apple.com>
[iOS] Drop VNodeTracker
https://bugs.webkit.org/show_bug.cgi?id=166868
<rdar://problem/29937587>
Reviewed by Andreas Kling.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
2017-01-09 Enrica Casucci <enrica@apple.com>
Selection animation flashing on editable content when zooming.
https://bugs.webkit.org/show_bug.cgi?id=166863
rdar://problem/29931470
Reviewed by Tim Horton.
Implementing _allowAnimatedUpdateSelectionRectView and returning NO,
prevents the selection animation in UIKit.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _allowAnimatedUpdateSelectionRectViews]):
2017-01-06 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
[GTK] Should support key and code properties on keyboard events
https://bugs.webkit.org/show_bug.cgi?id=166759
Reviewed by Carlos Garcia Campos.
* Shared/WebEvent.h:
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent): accept web key value and code on construction.
* Shared/gtk/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebKeyboardEvent): pass web key value and code on construction.
2017-01-08 Antti Koivisto <antti@apple.com>
Move cache coders to WTF
https://bugs.webkit.org/show_bug.cgi?id=166825
Rubber-stamped by Sam Weinig.
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheCoder.h: Removed.
* NetworkProcess/cache/NetworkCacheCoders.cpp:
(WebKit::NetworkCache::Coder<AtomicString>::encode): Deleted.
(WebKit::NetworkCache::Coder<AtomicString>::decode): Deleted.
(WebKit::NetworkCache::Coder<CString>::encode): Deleted.
(WebKit::NetworkCache::Coder<CString>::decode): Deleted.
(WebKit::NetworkCache::Coder<String>::encode): Deleted.
(WebKit::NetworkCache::decodeStringText): Deleted.
(WebKit::NetworkCache::Coder<String>::decode): Deleted.
(WebKit::NetworkCache::Coder<SHA1::Digest>::encode): Deleted.
(WebKit::NetworkCache::Coder<SHA1::Digest>::decode): Deleted.
(WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode): Deleted.
(WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode): Deleted.
* NetworkProcess/cache/NetworkCacheCoders.h:
(): Deleted.
(WebKit::NetworkCache::Coder<std::optional<T>>::encode): Deleted.
(WebKit::NetworkCache::Coder<std::optional<T>>::decode): Deleted.
* NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
(WebKit::NetworkCache::encodeCFData): Deleted.
(WebKit::NetworkCache::decodeCFData): Deleted.
(WebKit::NetworkCache::encodeSecTrustRef): Deleted.
(WebKit::NetworkCache::decodeSecTrustRef): Deleted.
(WebKit::NetworkCache::encodeCertificateChain): Deleted.
(WebKit::NetworkCache::decodeCertificateChain): Deleted.
(WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
(WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
* NetworkProcess/cache/NetworkCacheDecoder.cpp: Removed.
* NetworkProcess/cache/NetworkCacheDecoder.h: Removed.
* NetworkProcess/cache/NetworkCacheEncoder.cpp: Removed.
* NetworkProcess/cache/NetworkCacheEncoder.h: Removed.
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::encodeAsStorageRecord):
(WebKit::NetworkCache::Entry::decodeStorageRecord):
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::Key::encode):
(WebKit::NetworkCache::Key::decode):
* NetworkProcess/cache/NetworkCacheKey.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::decodeRecordMetaData):
(WebKit::NetworkCache::encodeRecordMetaData):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode):
(WebKit::NetworkCache::SubresourceInfo::decode):
(WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
(WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
* UIProcess/API/APIUserContentExtensionStore.cpp:
(API::encodeContentExtensionMetaData):
(API::decodeContentExtensionMetaData):
* WebKit2.xcodeproj/project.pbxproj:
2017-01-09 Tomas Popela <tpopela@redhat.com>
[GTK] Replace WebKitWebSettings with WebKitSettings in documentation
https://bugs.webkit.org/show_bug.cgi?id=166836
Reviewed by Carlos Garcia Campos.
Don't use WebKitWebSettings (it was a WebKit1 thing) in documentation,
but replace it with WebKitSettings.
* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_class_init):
* UIProcess/API/gtk/WebKitWebView.cpp:
2017-01-06 Darin Adler <darin@apple.com>
Remove PassRefPtr use from "inspector", "platform/sql", and "platform/text"
https://bugs.webkit.org/show_bug.cgi?id=166797
Reviewed by Alex Christensen.
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::requestCheckingOfString): Take a reference
instead of a PassRefPtr.
* WebProcess/WebCoreSupport/WebEditorClient.h: Updated for above change.
2017-01-07 Andy Estes <aestes@apple.com>
[QuickLook] Consolidate usage of QuickLookHandle into SubresourceLoader
https://bugs.webkit.org/show_bug.cgi?id=166713
Reviewed by Alex Christensen.
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResponse): Removed QuickLook code.
(WebKit::WebResourceLoader::didReceiveData): Ditto.
(WebKit::WebResourceLoader::didFinishResourceLoad): Ditto.
(WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
(WebKit::WebResourceLoader::didReceiveResource): Ditto.
2017-01-06 Daniel Bates <dabates@apple.com>
Attempt to fix the EFL build following <http://trac.webkit.org/changeset/210461>
(https://bugs.webkit.org/show_bug.cgi?id=166781)
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesGetAutoplayPolicy): Invoke ASSERT_NOT_REACHED() and return kWKWebsiteAutoplayPolicyUseHeuristics
if the specified policy is not covered by a switch case.
(WKWebsitePoliciesSetAutoplayPolicy): Substituted "return" for "break" in each switch case and
invoke ASSERT_NOT_REACHED() if the specified policy is not covered by a switch case.
2017-01-06 Matt Rajca <mrajca@apple.com>
Add infrastructure for sending autoplay website policies to WebKit
https://bugs.webkit.org/show_bug.cgi?id=166781
Reviewed by Alex Christensen.
* Shared/WebsitePolicies.h:
(WebKit::WebsitePolicies::encode):
(WebKit::WebsitePolicies::decode):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesGetAutoplayPolicy):
(WKWebsitePoliciesSetAutoplayPolicy):
* UIProcess/API/C/WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setAutoplayPolicy:]):
(-[_WKWebsitePolicies autoplayPolicy]):
2017-01-05 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Network process crash in WebKit::CustomProtocolManagerImpl::didFailWithError
https://bugs.webkit.org/show_bug.cgi?id=165082
Reviewed by Alex Christensen.
CustomProtocolManager uses a Workqueue to receive the IPC messages since r149194. Then we added the Soup
implementation adopting that approach, but without making our implementation thread safe. The crash happens
because the CustomProtocolManager implementation is used by two threads at the same time, the main thread
because of a ping load (probably caused by an image load in the unload handler, I haven't been able to
reproduce the crash) and the work queue thread. The reasons to make CustomProtocolManager use a WorkQueue
are no longer valid because CustomProtocolManager is now only used in the network process and sync loads don't
use any nested run loop, they are just an IPC sync message. So this patch makes CustomProtocolManager a normal
message receiver again to ensure messages are handled in the main thread. It also adds the common implementation
to a new CustomProtocolManager.cpp file shared by Cocoa and Soup based ports.
* CMakeLists.txt: Add CustomProtocolManager.cpp.
* NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
(-[WKCustomProtocol initWithRequest:cachedResponse:client:]): Use new CustomProtocolManager API.
(-[WKCustomProtocol startLoading]): Ditto.
(-[WKCustomProtocol stopLoading]): Ditto.
(WebKit::CustomProtocolManager::registerProtocolClass): Register the NSURLProtocol class when not using the
network session.
(WebKit::CustomProtocolManager::didFailWithError): removeCustomProtocol now receives an ID.
(WebKit::CustomProtocolManager::didFinishLoading): Ditto.
* NetworkProcess/CustomProtocols/CustomProtocolManager.cpp: Added.
(WebKit::generateCustomProtocolID): Moved from CustomProtocolManagerCocoa.mm and CustomProtocolManagerSoup.cpp.
(WebKit::CustomProtocolManager::supplementName): Ditto.
(WebKit::CustomProtocolManager::CustomProtocolManager): Also removes the work queue initialization.
(WebKit::CustomProtocolManager::initialize): Copied and modernized the loop.
(WebKit::CustomProtocolManager::addCustomProtocol): Copied from CustomProtocolManagerCocoa.mm.
(WebKit::CustomProtocolManager::removeCustomProtocol): Ditto.
(WebKit::CustomProtocolManager::startLoading): Send the StartLoading message to the proxy.
(WebKit::CustomProtocolManager::stopLoading): Send the StopLoading message to the proxy.
* NetworkProcess/CustomProtocols/CustomProtocolManager.h:
* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.cpp: Removed.
* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.h: Removed.
* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: Moved the implementation from
CustomProtocolManagerImpl and updated to the new CustomProtocolManager API.
(WebKit::CustomProtocolManager::WebSoupRequestAsyncData::WebSoupRequestAsyncData):
(WebKit::CustomProtocolManager::WebSoupRequestAsyncData::~WebSoupRequestAsyncData):
(WebKit::CustomProtocolManager::registerProtocolClass):
(WebKit::CustomProtocolManager::registerScheme):
(WebKit::CustomProtocolManager::supportsScheme):
(WebKit::CustomProtocolManager::didFailWithError):
(WebKit::CustomProtocolManager::didLoadData):
(WebKit::CustomProtocolManager::didReceiveResponse):
(WebKit::CustomProtocolManager::didFinishLoading):
(WebKit::CustomProtocolManager::wasRedirectedToRequest):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::globalCustomProtocolManager):
(WebKit::NetworkSessionCocoa::defaultSession):
CustomProtocolManager is no longer refcounted, so just pass a pointer.
A static pointer has the same lifetime as the NetworkProcess object in the NetworkProcess,
and in the WebProcess it will remain nullptr, just like it used to.
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* WebKit2.xcodeproj/project.pbxproj:
2017-01-05 Antti Koivisto <antti@apple.com>
Use WTF::Function instead of std::function in network cache code
https://bugs.webkit.org/show_bug.cgi?id=166721
Reviewed by Andreas Kling.
Use better move-only type. Fix some unnecessary function copies.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::Cache::clear):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
(WebKit::NetworkCache::Data::apply):
* NetworkProcess/cache/NetworkCacheDataSoup.cpp:
(WebKit::NetworkCache::Data::apply):
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::traverseDirectory):
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::canRetrieve):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
Split retrieve() to canRetrieve() and retrieve() functions.
This avoids the need to copy the completion handler in the caller.
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):
* NetworkProcess/cache/NetworkCacheStorage.h:
2017-01-05 Enrica Casucci <enrica@apple.com>
Unreviewed build fix after https://trac.webkit.org/changeset/210360
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::performDragOperation):
2017-01-05 Enrica Casucci <enrica@apple.com>
Support File Promise during drag for macOS.
https://bugs.webkit.org/show_bug.cgi?id=165204
rdar://problem/19595567
Reviewed by Tim Horton.
Adds support for dropping a File Promise in a WKWebView.
The implementation uses new File Promise API available in Sierra.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):
* Shared/mac/PasteboardTypes.mm:
(WebKit::PasteboardTypes::forURL):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::createSandboxExtensionsIfNeeded):
(WebKit::WebViewImpl::performDragOperation):
(WebKit::maybeCreateSandboxExtensionFromPasteboard): Deleted.
(WebKit::createSandboxExtensionsForFileUpload): Deleted.
2017-01-05 Andreas Kling <akling@apple.com>
Remove ChromeClient::needTouchEvents().
<https://webkit.org/b/166723>
Rubber-stamped by Antti Koivisto.
* WebProcess/WebCoreSupport/WebChromeClient.h:
2017-01-04 Darin Adler <darin@apple.com>
Remove PassRefPtr use from the "html" directory, other improvements
https://bugs.webkit.org/show_bug.cgi?id=166635
Reviewed by Alex Christensen.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::loadIconForFiles): Take a reference instead of a pointer.
* WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
2017-01-04 Myles C. Maxfield <mmaxfield@apple.com>
Remove runtime flag for variation fonts
https://bugs.webkit.org/show_bug.cgi?id=164251
Reviewed by Dean Jackson.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::registerUserDefaultsIfNeeded):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2017-01-04 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r210287.
This change caused editing test failures on macOS.
Reverted changeset:
"Support File Promise during drag for macOS."
https://bugs.webkit.org/show_bug.cgi?id=165204
http://trac.webkit.org/changeset/210287
2017-01-04 Enrica Casucci <enrica@apple.com>
Support File Promise during drag for macOS.
https://bugs.webkit.org/show_bug.cgi?id=165204
rdar://problem/19595567
Reviewed by Tim Horton.
Adds support for dropping a File Promise in a WKWebView.
The implementation uses new File Promise API available in Sierra.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):
* Shared/mac/PasteboardTypes.mm:
(WebKit::PasteboardTypes::forURL):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::createSandboxExtensionsIfNeeded):
(WebKit::WebViewImpl::performDragOperation):
(WebKit::maybeCreateSandboxExtensionFromPasteboard): Deleted.
(WebKit::createSandboxExtensionsForFileUpload): Deleted.
2017-01-04 Jeremy Jones <jeremyj@apple.com>
Release pointer lock when page state is reset for any reason, not just for process exited.
https://bugs.webkit.org/show_bug.cgi?id=166654
<rdar://problem/29849769>
Reviewed by Tim Horton.
Pointer lock was not being released when the window is closed.
Move the pointer lock to resetState() so it happens whenever the page is
reset, not just when it is reset after process exit.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState): Release here.
(WebKit::WebPageProxy::resetStateAfterProcessExited): Don't release here.
2017-01-03 Tim Horton <timothy_horton@apple.com>
NSSpellChecker's recordResponse isn't called for unseen automatic corrections
https://bugs.webkit.org/show_bug.cgi?id=166450
<rdar://problem/29447824>
Reviewed by Darin Adler.
* UIProcess/mac/CorrectionPanel.h:
* UIProcess/mac/CorrectionPanel.mm:
(WebKit::CorrectionPanel::recordAutocorrectionResponse):
(WebKit::CorrectionPanel::handleAcceptedReplacement):
Funnel all calls to recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag:
through recordAutocorrectionResponse, for debugging's sake.
Drop the NSView parameter because we don't need it, just the tag.
* UIProcess/mac/PageClientImpl.mm:
(WebKit::toCorrectionResponse):
(WebKit::PageClientImpl::recordAutocorrectionResponse):
Convert the new AutocorrectionResponseType value to its corresponding
NSCorrectionResponse value.
2017-01-03 Daniel Bates <dabates@apple.com>
Another attempt to fix the Apple Sierra Release 32-bit Build following <https://trac.webkit.org/changeset/210075>
(https://bugs.webkit.org/show_bug.cgi?id=166367)
Guard more code in WebViewImpl::handleRequestedCandidates() inside HAVE(TOUCH_BAR).
Remove unused local variable weakThis.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::handleRequestedCandidates):
2017-01-03 Daniel Bates <dabates@apple.com>
Attempt to fix the Apple Sierra Release 32-bit Build following <https://trac.webkit.org/changeset/210075>
(https://bugs.webkit.org/show_bug.cgi?id=166367)
Add HAVE(TOUCH_BAR)-guard around code that messages candidateListTouchBarItem() as
candidateListTouchBarItem() is only defined when building with Touch Bar support.
Also added an inline comment to help demarcate the code when building without Touch Bar
support. We should look to clean up WebViewImpl.mm including extracting out the Touch
Bar code to another file or better demarcating it so as to improve the hackability of
this code and prevent breaking the build when building without Touch Bar support.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::handleRequestedCandidates):
2017-01-03 Michael Catanzaro <mcatanzaro@igalia.com> and Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Expose WebKitSecurityOrigin API
https://bugs.webkit.org/show_bug.cgi?id=166632
Reviewed by Carlos Garcia Campos.
This API will be useful to have for various purposes, such as setting initial notification
permissions.
* PlatformGTK.cmake:
* UIProcess/API/gtk/WebKitAutocleanups.h:
* UIProcess/API/gtk/WebKitSecurityOrigin.cpp: Added.
(_WebKitSecurityOrigin::_WebKitSecurityOrigin):
(webkitSecurityOriginCreate):
(webkit_security_origin_new):
(webkit_security_origin_new_for_uri):
(webkit_security_origin_ref):
(webkit_security_origin_unref):
(webkit_security_origin_get_protocol):
(webkit_security_origin_get_host):
(webkit_security_origin_get_port):
(webkit_security_origin_is_opaque):
(webkit_security_origin_to_string):
* UIProcess/API/gtk/WebKitSecurityOrigin.h: Added.
* UIProcess/API/gtk/WebKitSecurityOriginPrivate.h: Added.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
2017-01-03 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Load options allowStoredCredentials = DoNotAllowStoredCredentials with clientCredentialPolicy = MayAskClientForCredentials doesn't work
https://bugs.webkit.org/show_bug.cgi?id=164471
Reviewed by Michael Catanzaro.
When DoNotAllowStoredCredentials is used we disable the SoupAuthManager feature for the message, but that
disables all HTTP authentication, causing the load to always fail with Authorization required even when
clientCredentialPolicy allows to ask the user for credentials. The problem is that even if we don't use the
WebCore credentials for that request, libsoup will always use its internal cache of SoupAuth if we enable the
SoupAuthManager feature. Libsoup 2.57.1 has new API to disable the use of cached credentials for a particular
message, adding the new message flag SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::createRequest): Set SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE flag to disable cached
credentials for the message if libsoup >= 2.57.1 is used.
2017-01-03 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] HTTP auth layout tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=158919
Reviewed by Michael Catanzaro.
Implement NetworkSession::clearCredentials() for soup using the new libsoup API when available.
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::clearCredentials):
* NetworkProcess/soup/NetworkSessionSoup.h:
2017-01-01 Jeff Miller <jeffm@apple.com>
Update user-visible copyright strings to include 2017
https://bugs.webkit.org/show_bug.cgi?id=166278
Reviewed by Dan Bernstein.
* DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist:
* Info.plist:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist:
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
2016-12-30 Darin Adler <darin@apple.com>
Remove PassRefPtr use from the "dom" directory, related cleanup
https://bugs.webkit.org/show_bug.cgi?id=166569
Reviewed by Alex Christensen.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): Updated to use struct.
(WebKit::WebFrameLoaderClient::updateGlobalHistory): Ditto.
(WebKit::WebFrameLoaderClient::setTitle): Ditto.
2016-12-27 Alex Christensen <achristensen@webkit.org>
reduce PassRefPtr use in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=166452
Reviewed by Yusuke Suzuki.
* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateCGImage):
(WKImageCreateFromCGImage):
* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::createHandle):
* Shared/ShareableBitmap.h:
* Shared/UserData.cpp:
(WebKit::UserData::encode):
(WebKit::UserData::decode):
* Shared/WebImage.cpp:
(WebKit::WebImage::create):
(WebKit::WebImage::WebImage):
* Shared/WebImage.h:
(WebKit::WebImage::bitmap):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didGetImageForFindMatch):
* UIProcess/mac/WKTextFinderClient.mm:
(-[WKTextFinderClient didGetImageForMatchResult:]):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::takeScreenshot):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::imageForRect):
(WebKit::InjectedBundleNodeHandle::renderedImage):
(WebKit::InjectedBundleNodeHandle::visibleRange):
(WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
(WebKit::InjectedBundleNodeHandle::documentFrame):
(WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
(WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::takeSnapshot):
(WebKit::WebPage::snapshotAtSize):
(WebKit::WebPage::snapshotNode):
(WebKit::WebPage::drawRectToImage):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::setTopOverhangImage):
(WebKit::WebPage::setBottomOverhangImage):
2016-12-27 Emanuele Aina <emanuele.aina@collabora.com>
Ensure NetworkProcess is ready before whitelisting TLS certificates
https://bugs.webkit.org/show_bug.cgi?id=162962
Reviewed by Alex Christensen.
If the API user tries to whitelist TLS certificates before any web
view has been created, the action will be ignored because the
NetworkProcess hasn't been fired up yet.
For example, the snippet below using the GTK+ API does not work,
unless the whitelisting is moved after the web view creation:
webkit_web_context_allow_tls_certificate_for_host(webkit_web_context_get_default(), crt, host);
webView = webkit_web_view_new();
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost): Ensure
that the NetworkProcess has been already fired up when adding
certificates, so they can be whitelisted before the first web view is
instantiated.
2016-12-25 Yusuke Suzuki <utatane.tea@gmail.com>
Propagate the source origin as much as possible
https://bugs.webkit.org/show_bug.cgi?id=166348
Reviewed by Darin Adler.
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::evaluate):
2016-12-22 Andy Estes <aestes@apple.com>
Reduce QuickLook.h include overhead
https://bugs.webkit.org/show_bug.cgi?id=166454
Reviewed by Andreas Kling.
* WebProcess/Network/WebLoaderStrategy.cpp: Included QuickLook.h for QLPreviewProtocol().
* WebProcess/Network/WebResourceLoader.cpp: Included QuickLook.h for QuickLookHandle.
* WebProcess/Network/WebResourceLoader.h: Stopped including QuickLook.h.
2016-12-22 Tim Horton <timothy_horton@apple.com>
Null deref under WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground
https://bugs.webkit.org/show_bug.cgi?id=166433
<rdar://problem/29732407>
Reviewed by Daniel Bates.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
m_drawingArea can be null if the process is not valid.
2016-12-22 Andy Estes <aestes@apple.com>
Make WebCore::EditorInsertAction an enum class
https://bugs.webkit.org/show_bug.cgi?id=166424
Reviewed by Brent Fulgham.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
(WebKit::toAPI):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(toWK):
2016-12-22 Zhuo Li <zachli@apple.com>
[Cocoa] SPI for setloadsImagesAutomatically
https://bugs.webkit.org/show_bug.cgi?id=166401
Reviewed by Darin Adler.
* UIProcess/API/Cocoa/WKPreferences.mm: Call the C API under the hood.
(-[WKPreferences _loadsImagesAutomatically]):
(-[WKPreferences _setLoadsImagesAutomatically:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
Add `_loadsImagesAutomatically` property.
2016-12-22 Eric Carlson <eric.carlson@apple.com>
AVPlayerLayer isn't available on every system
https://bugs.webkit.org/show_bug.cgi?id=166399
Reviewed by Jer Noble.
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: Use SOFT_LINK_CLASS_OPTIONAL.
2016-12-22 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
MediaStream: ASSERTION FAILED: m_ids.size() == m_handles.size() in MediaDeviceSandboxExtensions
https://bugs.webkit.org/show_bug.cgi?id=166328
Reviewed by Eric Carlson.
This assertion failure happens for ports with sandbox extensions disabled. SandboxExtension is empty and
HandleArray:size() always returns 0. Disable creation of MediaDevicesSandboxExtension in UserMediaProcessManager
when building without support of sandbox extension. Disable also WebPage::grantUserMediaDeviceSandboxExtensions
and WebPage::revokeUserMediaDeviceSandboxExtensions which can be avoided when sandbox extension is empty.
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::endedCaptureSession):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2016-12-22 Alejandro G. Castro <alex@igalia.com>
[WebRTC] Add support for runtime PeeConnection setting, required after r209757
https://bugs.webkit.org/show_bug.cgi?id=166346
Reviewed by Carlos Garcia Campos.
After that commit we have to enable the peerConnection runtime
flag if we want webrtc to work. We are not adding a new API for
the moment to control the peerConnection feature.
* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_set_enable_media_stream): Use the mediaStream
setting to control the peerConnection
2016-12-21 Brent Fulgham <bfulgham@apple.com>
[Mac][WK2] Stop using file* rules in WebProcess sandbox profiles
https://bugs.webkit.org/show_bug.cgi?id=165824
<rdar://problem/14024823>
Reviewed by Alexey Proskuryakov
Switch from blanket 'file*' sandbox rules, to the specific 'file-read*' and 'file-write*' rules
we actually need.
* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2016-12-21 Beth Dakin <bdakin@apple.com>
Holding down on candidates in the TouchBar should show panel on screen
https://bugs.webkit.org/show_bug.cgi?id=166367
-and corresponding-
<rdar://problem/28479236>
Reviewed by Tim Horton.
The showCandidates() helper function is not needed. We can call the AppKit method
directly at the one call site.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
The panel should appear under the selection, so offset the selection rect.
(WebKit::WebViewImpl::handleRequestedCandidates):
No more showCandidates() since we can call it directly.
(WebKit::WebViewImpl::showCandidates): Deleted.
2016-12-20 Taras Tsugrii <ttsugrii@fb.com>
Fix undefined behavior caused by macro expansion producing 'defined'
https://bugs.webkit.org/show_bug.cgi?id=166047
Reviewed by Darin Adler.
* Shared/API/Cocoa/WKFoundation.h:
2016-12-20 Brent Fulgham <bfulgham@apple.com>
Address some style problems found by static analysis
https://bugs.webkit.org/show_bug.cgi?id=165975
Reviewed by Alex Christensen.
Avoid passing large ANGLE data structures through the ANGLEWebKitBridge methods.
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::create):
(WebKit::WebBackForwardListItem::WebBackForwardListItem):
* Shared/WebBackForwardListItem.h:
2016-12-20 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Switching or closing a tab leads to all-white tab content if the status bar is double height
https://bugs.webkit.org/show_bug.cgi?id=166286
rdar://problem/29593525
Reviewed by Tim Horton.
A double-height status bar triggers view resize while snapshotting in the background,
which also triggers calls to _endAnimatedResize on tab resume. However, it was possible
for _endAnimatedResize to re-enter via synchronizeDynamicViewportUpdate()/didCommitLayerTree(),
causing us to use a nil _resizeAnimationView for scale computations, thus setting a zero
scale on the WKContentView.
Fix by checking _dynamicViewportUpdateMode again after the call to synchronizeDynamicViewportUpdate(),
and do a belt-and-braces check for a nil _resizeAnimationView.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _endAnimatedResize]):
2016-12-20 Andy Estes <aestes@apple.com>
[Cocoa] REGRESSION (r209558): Calling decisionHandler multiple times in webView:decidePolicyForNavigationAction:decisionHandler: leads to a crash
https://bugs.webkit.org/show_bug.cgi?id=165992
<rdar://problem/29693817>
Reviewed by Brady Eidson.
r209558 added additional move semantics to the decisionHandler block passed to
-webView:decidePolicyForNavigationAction:decisionHandler:, resulting in a null pointer
dereference in clients that call the decisionHandler block more than once.
None of the completion handlers we expose in the WebKit API are intended to be called more
than once, and we ASSERT in CompletionHandlerCallChecker::didCallCompletionHandler() that
this doesn't happen.
This change strenghtens that protection by returning immediately in completion handlers
called more than once. And in programs linked on or after WebKit 603.1.17, an NSException is
thrown if a completion handler is called a second time, like we do for completion handlers
that are never called.
New API test: WebKit2.DuplicateCompletionHandlerCalls
* Shared/Cocoa/CompletionHandlerCallChecker.h: Declared completionHandlerHasBeenCalled().
* Shared/Cocoa/CompletionHandlerCallChecker.mm:
(WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall): Added. Returns true if the
program is linked on or after
LibraryVersion::FirstWithExceptionsForDuplicateCompletionHandlerCalls.
(WebKit::CompletionHandlerCallChecker::completionHandlerHasBeenCalled): Added. Returns
whether or not the completion handler has been called. If it has, and
shouldThrowExceptionForDuplicateCompletionHandlerCall() returns true, throws an
NSInternalInconsistencyException.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setInputDelegate:]): Added an early return if the completion handler has
already been called.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): Ditto.
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): Ditto.
(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): Ditto.
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::runJavaScriptAlert): Ditto.
(WebKit::UIDelegate::UIClient::runJavaScriptConfirm): Ditto.
(WebKit::UIDelegate::UIClient::runJavaScriptPrompt): Ditto.
(WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Ditto.
(WebKit::UIDelegate::UIClient::runOpenPanel): Ditto.
(WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): Ditto.
* UIProcess/Cocoa/VersionChecks.h: Added
FirstWithExceptionsForDuplicateCompletionHandlerCalls with the version number for 603.1.17.
2016-12-20 Dean Jackson <dino@apple.com>
Remove INDIE_UI
https://bugs.webkit.org/show_bug.cgi?id=165881
<rdar://problem/29672532>
Reviewed by Simon Fraser.
The Indie UI work has been discontinued.
* Configurations/FeatureDefines.xcconfig:
2016-12-20 Wenson Hsieh <wenson_hsieh@apple.com>
Implement the updated port/area-based Scroll Snap Module Level 1 Spec
https://bugs.webkit.org/show_bug.cgi?id=165317
<rdar://problem/29490956>
Reviewed by Dean Jackson.
Remove unused code for adopting scroll snapping in the PDF plugin.
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::didCalculateSizes):
2016-12-19 Yusuke Suzuki <utatane.tea@gmail.com>
[ES6] Enable ES6 Modules
https://bugs.webkit.org/show_bug.cgi?id=165849
Reviewed by Geoffrey Garen.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetES6ModulesEnabled): Deleted.
(WKPreferencesGetES6ModulesEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-12-19 Keith Rollin <krollin@apple.com>
Fix unwanted deletion of record/replay files
https://bugs.webkit.org/show_bug.cgi?id=166040
Reviewed by Alex Christensen.
As part of some refactoring, the objects that create the meta files
that are part of the record/replay cache would get deleted. They were
always getting opened in "write" mode", which would truncate the
files. Fix this so that the files are opened in the right modes for
record, replay, and neither.
* NetworkProcess/capture/NetworkCaptureManager.cpp:
(WebKit::NetworkCapture::Manager::initialize):
2016-12-19 Gavin Barraclough <barraclough@apple.com>
[CSS Parser] Enable CSS Deferred Parsing
https://bugs.webkit.org/show_bug.cgi?id=165869
Unreviewed rollout – looks like this regressed performance.
* Shared/WebPreferencesDefinitions.h:
2016-12-19 Anders Carlsson <andersca@apple.com>
REGRESSION: Crash in com.apple.WebKit:IPC::Connection::platformCanSendOutgoingMessages() const + 0
https://bugs.webkit.org/show_bug.cgi?id=165817
rdar://problem/29626731
Reviewed by Dan Bernstein.
If the receive right is invalidated before we send the message, the kernel won't be able to create a send right,
and we'll crash due to mach_msg returning MACH_SEND_INVALID_RIGHT.
Fix this by immediately creating a send right, and passing MACH_MSG_TYPE_MOVE_SEND to the attachment constructor.
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openFrontendConnection):
2016-12-18 Simon Fraser <simon.fraser@apple.com>
Expose a way for MiniBrowser to simulate header and footer banners
https://bugs.webkit.org/show_bug.cgi?id=166005
Reviewed by Wenson Hsieh.
Expose testing SPI that allows a client to simulate the presence of header
and footer banners. These are simply plumbed through to set FrameView's
m_headerHeight and m_footerHeight.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setHeaderBannerHeightForTesting:]):
(-[WKWebView _setFooterBannerHeightForTesting:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setHeaderBannerHeightForTesting):
(WebKit::WebPageProxy::setFooterBannerHeightForTesting):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setHeaderBannerHeightForTesting):
(WebKit::WebPage::setFooterBannerHeightForTesting):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2016-12-16 Dave Hyatt <hyatt@apple.com>
[CSS Values] Make separate wrapper classes for the deprecated CSS Values OM
https://bugs.webkit.org/show_bug.cgi?id=165968
Reviewed by Andreas Kling.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
(WebKit::kit):
(WebKit::core):
(WebKit::wrapCSSValue):
(webkit_dom_css_value_constructor):
(webkit_dom_css_value_get_css_text):
(webkit_dom_css_value_set_css_text):
(webkit_dom_css_value_get_css_value_type):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h:
2016-12-17 Wenson Hsieh <wenson_hsieh@apple.com>
Visual viewports: bottom fixed elements disappear behind the keyboard
https://bugs.webkit.org/show_bug.cgi?id=165983
<rdar://problem/29409852>
Reviewed by Simon Fraser.
Accounts for input view bounds in WebPageProxy::computeCustomFixedPositionRect. To do this, we introduce and
pass unobscuredContentRectRespectingInputViewBounds along with the regular unobscuredContentRect (which does not
respect the obscuring keyboard rect). This unobscuredContentRectRespectingInputViewBounds is then used when
computing the origin of the updated layout viewport rect (and also, when we are _not_ below minimum scale),
Additionally, the size is computed using the (unconstrained) unobscured rect. This is because we previously
would use the document-constrained version of the unobscured rect, which caused the layout viewport to shrink
when approaching the max scroll extents of the document while the keyboard is up, since the unobscured rect
would spill out of the document rect. However, using this unconstrained rect's size also means that if the user
rubber-bands out of the document rect, we would end up pushing the layout viewport rect out of the document,
with no way of adjusting it back in without the user scrolling to push the layout viewport into back document
bounds. To address this, we move the layout rect to be within document bounds after computing its size and
location.
Added a new layout test: fast/visual-viewport/ios/fixed-element-on-bottom-with-keyboard.html, and also tweaked
fixed-caret-position-after-scroll.html to cover these changes.
* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::unobscuredContentRectRespectingInputViewBounds):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateContentRectsWithState:]):
(-[WKWebView _inputViewBounds]):
Returns the current bounds of the input view. For testing purposes.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::unobscuredContentRectRespectingInputViewBounds):
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]):
Helper to compute the unobscured rect, accounting for the bounds of the current input view.
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView _didCommitLayerTree:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2016-12-16 Ryosuke Niwa <rniwa@webkit.org>
Deleting a character converted from pinyin after an image causes a Safari crash
https://bugs.webkit.org/show_bug.cgi?id=165839
Reviewed by Darin Adler.
The crash was caused by the payload of the IPC not being decoded correctly when the encoded attributed string
contains a NSTextAttachment but send<> would still gladly send it to the UIProcess.
Fixed it by omitting the image as done in r176412 since encoding NSFileWrapper, etc... would require
quite a bit of work, and IME doesn't really need to see the image in its attributed string.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::attributedSubstringForCharacterRangeAsync): Fixed the bug.
2016-12-16 Andy Estes <aestes@apple.com>
Add a setting to suppress keyboard input during provisional navigation
https://bugs.webkit.org/show_bug.cgi?id=165830
Reviewed by Brent Fulgham.
* Shared/WebPreferencesDefinitions.h: Defined
shouldSuppressKeyboardDOMEventsDuringProvisionalNavigation.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
(WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
* UIProcess/API/C/WKPreferencesRefPrivate.h: Declared a getter and setter for the new
preference.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]): Added.
(-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]): Added.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared a property for the new preference.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Mapped the new preference to its corresponding
WebCore::Setting.
2016-12-16 Chris Dumez <cdumez@apple.com>
HTML form validation bubble should be dismissed on navigation
https://bugs.webkit.org/show_bug.cgi?id=165960
<rdar://problem/29668086>
Reviewed by Simon Fraser.
Dismiss HTML form validation bubble on top-level navigation on WK2.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2016-12-16 Jer Noble <jer.noble@apple.com>
Small refactor: Use HashCountedSet rather than HashMap<..., int> to store client counts in WebPlaybackSessionManager{,Proxy}.
https://bugs.webkit.org/show_bug.cgi?id=165807
Reviewed by Eric Carlson.
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
(WebKit::WebPlaybackSessionManagerProxy::addClientForContext):
(WebKit::WebPlaybackSessionManagerProxy::removeClientForContext):
* WebProcess/cocoa/WebPlaybackSessionManager.h:
* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionManager::addClientForContext):
(WebKit::WebPlaybackSessionManager::removeClientForContext):
2016-12-16 Wenson Hsieh <wenson_hsieh@apple.com>
Visual viewports: carets and selection UI are incorrectly positioned when editing fixed elements
https://bugs.webkit.org/show_bug.cgi?id=165767
<rdar://problem/29602382>
Reviewed by Simon Fraser.
When focusing an input, the position of the caret on iOS is determined by the overridden layout viewport rect in
the web process. However, this rect is not updated until the end the scroll gesture. Whereas this is fine for
non-fixed inputs since their document location does not change, fixed inputs effectively change their position
in the document as the user scrolls. This causes the caret to be 'left behind' in the document position it was
in at the start of the scroll. To fix this, we deactivate the selection when exiting stable state if the
assisted node is in a fixed position container, and reenable it upon receiving the next stable state EditorState
update (as indicated by postLayoutData().isStableStateUpdate). Additionally, we apply similar treatment to the
web selection assistant -- this time, we need to force the selection view to hide (analagous to deactivating
the text selection assistant) and show it again upon receiving the next selection change update when the WebPage
(in the web process) is stable.
Furthermore, adds test support for querying text caret and selection rects, as well as perform a callback after
the WebPage has indicated that it is stable, both as SPI on the WKWebView.
Covered by 4 new layout tests in fast/editing/caret/ios and fast/editing/selection/ios.
* Platform/spi/ios/UIKitSPI.h:
* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:
Introduce isStableStateUpdate, which is true when the WebPage is known to be in stable state, as well as
insideFixedPosition, which is true when the current selection is inside a fixed position container.
* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::isInStableState):
(WebKit::RemoteLayerTreeTransaction::setIsInStableState):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
(WebKit::RemoteLayerTreeTransaction::description):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _uiTextCaretRect]):
Introduced a new SPI method for fetching the current rect of the text assistant's caret view, at keyPath
"selectionView.selection.caretRect".
(-[WKWebView _uiTextSelectionRects]):
Renamed (and refactored) from _uiTextSelectionRectViews, which was previously fetching an array of UIViews. I
found this to cause character-granularity-rect.html to fail due to the array of UIViews here being empty, so I
refactored this to simply return an array of rects from the keyPath "selectionView.selection.selectionRects" for
the text selection assistant and @"selectionView.selectionRects" for the web selection assistant.
(-[WKWebView _doAfterNextStablePresentationUpdate:]):
Runs the given block after both the UI process and web processes agree that the visible content rect state is
stable. To do this, we fire presentation updates until the UI process (via RemoteLayerTreeTransactions)
discovers that the web page is in stable state. This is used solely for testing purposes.
(-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]):
(-[WKWebView _uiTextSelectionRectViews]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::inStableState):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _didExitStableState]):
Deactivate the text selection if the assisted node is inside a fixed container.
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView shouldHideSelectionWhenScrolling]):
(-[WKContentView _uiTextSelectionRects]):
(-[WKContentView _didEndScrollingOrZooming]):
(-[WKContentView _updateChangedSelection:]):
If the EditorState was created after a stable state update, reactivate the text selection assistant if it exists.
Additionally, if we are deferring the end scrolling selection update until after the first stable editor state
update arrives from the web process, we need to also call [_textSelectionAssistant didEndScrollingOverflow]
and [_webSelectionAssistant didEndScrollingOrZoomingPage] here instead of doing so immediately after scrolling
finishes. This ensures that selection UI (the callout and selection highlights) do not flicker from their old
position to the new position when scrolling finishes.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState):
(WebKit::WebPage::updateVisibleContentRects):
When updating the layout viewport override rect, also recompute the caret if needed and send an updated
EditorState over to the UI process.
2016-12-16 Claudio Saavedra <csaavedra@igalia.com>
[WK2] SharedMemory: include cleanups
https://bugs.webkit.org/show_bug.cgi?id=165950
Reviewed by Žan Doberšek.
The WTFString include is not needed in the header, so move to the
Unix file. Use the existing UNIX_DOMAIN_SOCKETS define. Also
include the WTFOptional header where needed.
* Platform/SharedMemory.h:
* Platform/unix/SharedMemoryUnix.cpp:
2016-12-16 Joonghun Park <jh718.park@samsung.com>
[EFL] Fix build break since r209907. Unreviewed.
https://bugs.webkit.org/show_bug.cgi?id=165954
* UIProcess/efl/TextCheckerEfl.cpp: Change the remaining TextBreakIterator to UBreakIterator
(WebKit::nextWordOffset):
(WebKit::TextChecker::checkTextOfParagraph):
2016-12-15 Darin Adler <darin@apple.com>
Use asString instead of toWTFString, toString, or getString when we already checked isString
https://bugs.webkit.org/show_bug.cgi?id=165895
Reviewed by Yusuke Suzuki.
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): Use asString/value instead of toWTFString.
2016-12-15 Chris Dumez <cdumez@apple.com>
Make sure HTML validation bubble's state is updated after layout
https://bugs.webkit.org/show_bug.cgi?id=165922
<rdar://problem/29694730>
Reviewed by Simon Fraser.
Make sure HTML validation bubble's state is updated after layout.
In particular, if the validation bubble's associated element has
moved or is no longer visible, we now hide the bubble.
* WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
(WebKit::WebValidationMessageClient::showValidationMessage):
(WebKit::WebValidationMessageClient::hideValidationMessage):
(WebKit::WebValidationMessageClient::updateValidationBubbleStateIfNeeded):
* WebProcess/WebCoreSupport/WebValidationMessageClient.h:
2016-12-15 Alex Christensen <achristensen@webkit.org>
Improve NetworkSession logging
https://bugs.webkit.org/show_bug.cgi?id=165941
Reviewed by Tim Horton.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
One of the "didReceiveResponse completionHandler (cancel)" messages was wrong,
and other messages could have more useful information without being overwhelming.
2016-12-15 Myles C. Maxfield <mmaxfield@apple.com>
Sort Xcode project files
https://bugs.webkit.org/show_bug.cgi?id=165937
Reviewed by Simon Fraser.
* WebKit2.xcodeproj/project.pbxproj:
2016-12-15 Anders Carlsson <andersca@apple.com>
Add more mach_msg logging instrumentation
https://bugs.webkit.org/show_bug.cgi?id=165914
Reviewed by Darin Adler.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):
(IPC::Connection::sendOutgoingMessage):
* Platform/IPC/mac/MachMessage.h:
(IPC::MachMessage::messageName):
(IPC::MachMessage::setMessageName):
2016-12-15 Konstantin Tokarev <annulen@yandex.ru>
Added missing override and final specifiers
https://bugs.webkit.org/show_bug.cgi?id=165903
Reviewed by Darin Adler.
* UIProcess/API/gtk/WebKitGeolocationProvider.h:
* UIProcess/WebFormSubmissionListenerProxy.h:
* UIProcess/WebFramePolicyListenerProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.h:
* WebProcess/MediaCache/WebMediaKeyStorageManager.h:
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
* WebProcess/WebCoreSupport/WebPlugInClient.h:
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
* WebProcess/WebPage/FindController.h:
2016-12-15 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Don't disable position:fixed when a form element has focus
https://bugs.webkit.org/show_bug.cgi?id=165891
rdar://problem/29271694
Reviewed by Wenson Hsieh.
Before visual viewports, we had to lay out position:fixed relative to the document rect (effectively
disabling position:fixed) when a form element was focused, to ensure that we could scroll to inputs
inside position:Fixed.
When visual viewports are enabled, we can do a better job of this, and keep position:fixed active.
Test: fast/visual-viewport/ios/zoomed-focus-in-fixed.html
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Soon this will use
insideFixed to have better scroll-into-view behavior.
(-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
(-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _displayFormNodeInputView]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect): Don't fall back to using the documentRect as the fixed
position rect if visual viewports are enabled.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation): Don't reset the customtFixedPositionRect around computing element
coordinates if visual viewports are enabled.
2016-12-15 Andreas Kling <akling@apple.com>
Always clear RenderLayer backing stores when going into page cache.
<https://webkit.org/b/165901>
Reviewed by Simon Fraser.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
2016-12-15 Darin Adler <darin@apple.com>
Remove custom binding for MediaDevices
https://bugs.webkit.org/show_bug.cgi?id=165894
Reviewed by Eric Carlson.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
Added include of MediaConstraintsImpl.h, now needed because we
removed some unneeded includes from the WebCore headers.
2016-12-15 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Enable CSS Deferred Parsing
https://bugs.webkit.org/show_bug.cgi?id=165869
Reviewed by Sam Weinig.
* Shared/WebPreferencesDefinitions.h:
2016-12-14 Andreas Kling <akling@apple.com>
Only send Messages::WebPageProxy::DidSaveToPageCache once when entering page cache.
<https://webkit.org/b/165887>
Reviewed by Brady Eidson.
We were sending one of these IPC messages per frame when a page enters the page cache,
and we really only need one, so only do it for the main frame.
(This message is used to adopt the page cache on the UI process side, in case another
web process currently owns the cache. That happens in WebProcessPool::processDidCachePage().)
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::didSaveToPageCache):
2016-12-14 Simon Fraser <simon.fraser@apple.com>
Fix cause of viewport-related flakiness in iOS tests
https://bugs.webkit.org/show_bug.cgi?id=165878
Reviewed by Tim Horton.
When TestController::platformConfigureViewForTest() changes the view size for a flexible
viewport test, the page would not have updated with the new scale by the time the load event
fired, causing flakiness depending on test order.
This was caused by code added in r170325 that delayed visible content rect updates until
after the UI process has received the transaction after didCommitLoad. So fix by overriding
this mechanism if the view has been resized.
* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::VisibleContentRectUpdateInfo::encode):
(WebKit::VisibleContentRectUpdateInfo::decode):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::isFirstUpdateForNewViewSize):
(WebKit::operator==):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _updateContentRectsWithState:]):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::setSize):
* UIProcess/DrawingAreaProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):
2016-12-04 Sam Weinig <sam@webkit.org>
[WebIDL] Add support for converting dictionaries to JS
https://bugs.webkit.org/show_bug.cgi?id=165367
Reviewed by Chris Dumez.
* CMakeLists.txt:
Add missing directories to look in for headers.
2016-12-14 Anders Carlsson <andersca@apple.com>
Add WKContextRefreshPlugIns
https://bugs.webkit.org/show_bug.cgi?id=165879
rdar://problem/29602414
Reviewed by Tim Horton.
* UIProcess/API/C/WKContext.cpp:
(WKContextRefreshPlugIns):
* UIProcess/API/C/WKContext.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::refreshPlugins):
* UIProcess/WebProcessPool.h:
* WebProcess/Plugins/WebPluginInfoProvider.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::refreshPlugins):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2016-12-14 Tim Horton <timothy_horton@apple.com>
API Test Fullscreen.TopContentInset is asserting on Yosemite
https://bugs.webkit.org/show_bug.cgi?id=165877
Reviewed by Brady Eidson.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setTopContentInset):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
We don't use fences on Yosemite, but this codepath still tried to.
Instead of guarding with PLATFORM(COCOA), make use of the more accurate
HAVE(COREANIMATION_FENCES) guard.
2016-12-14 Anders Carlsson <andersca@apple.com>
Add some instrumentation to try to detect a crash on the bots
https://bugs.webkit.org/show_bug.cgi?id=165866
Reviewed by Sam Weinig.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):
2016-12-14 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
https://bugs.webkit.org/show_bug.cgi?id=165743
Reviewed by Dean Jackson.
Repurpose the newCSSParserEnabled preference for deferred parsing. Just change the name
from "new" to "deferred."
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetDeferredCSSParserEnabled):
(WKPreferencesGetDeferredCSSParserEnabled):
(WKPreferencesSetNewCSSParserEnabled): Deleted.
(WKPreferencesGetNewCSSParserEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-12-14 Brent Fulgham <bfulgham@apple.com>
Unreviewed test fix after r209806.
Plugin-common doesn't define 'home-subpath'. Instead it has 'home-library-subpath'. Switch to the correct
function. Also, 'home-library-subpath' adds '/Library' to the path, so revise the arguments so that we
do not generate paths like '/home/username/Library/Library/Keychains'.
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2016-12-14 Brent Fulgham <bfulgham@apple.com>
Unreviewed test fix after r209779.
The 'Keygen' element requires the ability to create new keys in '$HOME/Library/Keychains'. Remove the
WebProcess and Plugin sandbox restrictions on per-user Keychain creation to support this use.
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2016-12-13 Yusuke Suzuki <utatane.tea@gmail.com>
Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
https://bugs.webkit.org/show_bug.cgi?id=165795
Reviewed by Saam Barati.
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
2016-12-14 Enrique Ocaña González <eocanha@igalia.com>
REGRESSION(r207879-207891): [GStreamer] Introduced many layout test failures and crashes, bots exiting early
https://bugs.webkit.org/show_bug.cgi?id=164022
Reviewed by Xabier Rodriguez-Calvar.
* Shared/WebPreferencesDefinitions.h:
New GStreamerEnabled preference, defaults to true.
* WebProcess/WebPage/WebPage.cpp: Ditto.
(WebKit::WebPage::updatePreferences):
2016-12-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r209792.
https://bugs.webkit.org/show_bug.cgi?id=165841
Cause build failures (Requested by yusukesuzuki on #webkit).
Reverted changeset:
"Use JSValue::toWTFString instead of calling toString(exec)
and value(exec)"
https://bugs.webkit.org/show_bug.cgi?id=165795
http://trac.webkit.org/changeset/209792
2016-12-13 Yusuke Suzuki <utatane.tea@gmail.com>
Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
https://bugs.webkit.org/show_bug.cgi?id=165795
Reviewed by Saam Barati.
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
2016-12-13 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
2016-12-13 Jer Noble <jer.noble@apple.com>
Fullscreen in WebKit2 does not restore topContentInset upon exiting; leaves top of page not visible
https://bugs.webkit.org/show_bug.cgi?id=165697
Delegate the values of topContentInset() from WebViewImpl (used by WKWebView and WKView) to the
WebPageProxy, so that setting the topContentInset() on WebPageProxy is reflected in the getters
for the two view classes.
Reviewed by Tim Horton.
* UIProcess/Cocoa/WebViewImpl.h:
(WebKit::WebViewImpl::topContentInset): Deleted.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
(WebKit::WebViewImpl::topContentInset):
(WebKit::WebViewImpl::setTopContentInset):
(WebKit::WebViewImpl::dispatchSetTopContentInset):
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController enterFullScreen:]):
(-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
(-[WKFullScreenWindowController _saveTopContentInset]): Deleted.
(-[WKFullScreenWindowController _restoreTopContentInset]): Deleted.
2016-12-13 Brent Fulgham <bfulgham@apple.com>
[Mac][WK2] Tighten Keychain directory access
https://bugs.webkit.org/show_bug.cgi?id=165818
<rdar://problem/16863857>
Reviewed by Anders Carlsson.
Lock down Keychain directory access to just the file-read-data, file-read-metadata, and
file-write-data operations we actually need.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2016-12-13 Andy Estes <aestes@apple.com>
[Cocoa] Implement -shouldInsertText: on WKWebProcessPlugInEditingDelegate
https://bugs.webkit.org/show_bug.cgi?id=165785
<rdar://problem/26929398>
Reviewed by Darin Adler.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Defined
WKEditorInsertAction and declared
-_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction:.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(toWK): Added. Mapped a WebCore::EditorInsertAction to a WKEditorInsertAction.
(-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Implemented
EditorClient::shouldInsertText() by calling
-_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction: with
the text, wrapped range handle, and action. Added shouldInsertText to DelegateMethods and
initialized it according to whether the delegate responds to shouldInsertText:.
2016-12-13 Joseph Pecoraro <pecoraro@apple.com>
NSArray leaks seen in Safari, allocated under WKIconDatabaseTryCopyCGImageArrayForURL
https://bugs.webkit.org/show_bug.cgi?id=165809
Reviewed by Dan Bernstein.
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
(WKIconDatabaseTryCopyCGImageArrayForURL):
Avoid an extra retain on already newly created array.
2016-12-13 Eric Carlson <eric.carlson@apple.com>
Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
https://bugs.webkit.org/show_bug.cgi?id=165251
Reviewed by Youenn Fablet.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Update the media stream and peer connection runtime
feature instead of the setting.
2016-12-13 Sergio Villar Senin <svillar@igalia.com>
Fix GTK build after r209733
https://bugs.webkit.org/show_bug.cgi?id=165794
Document::visibilityState() now returns an IDL string enumeration.
Reviewed by Žan Doberšek.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_get_visibility_state):
2016-12-12 Dean Jackson <dino@apple.com>
[iOS] MediaDocument "Done" button should navigate the page back
https://bugs.webkit.org/show_bug.cgi?id=165779
Reviewed by Sam Weinig.
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenModelContext::requestFullscreenMode):
(WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode):
* WebProcess/cocoa/WebVideoFullscreenManager.h:
* WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::requestFullscreenMode):
2016-12-12 Tim Horton <timothy_horton@apple.com>
Provide SPI to avoid blocking on painting when coming into view
https://bugs.webkit.org/show_bug.cgi?id=165780
<rdar://problem/29009559>
Reviewed by Simon Fraser.
By default, when parenting a WKWebView which was previously in-window,
we block on painting to ensure that we don't flash stale content.
We added SPI to disable this behavior to WKWebViewConfiguration, but
some clients might want the behavior most of the time, but sometimes
instead want to not block the UI process main thread, but instead do
their own work (e.g. removing a snapshot) when painting eventually occurs.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Tell WebPageProxy not to block on painting next time we are parented,
and use doAfterNextPresentationUpdate to call the block when the painting
does eventually happen. This SPI must be called before - but in the same
runloop cycle - the WKWebView is brought back in-window to work correctly.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchActivityStateChange):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::skipWaitingForPaintAfterNextViewDidMoveToWindow):
If we would block because we're coming in-window, but the bit to skip
blocking the next time we get brought in-window is set, reset the bit,
and avoid blocking.
2016-12-12 Chris Dumez <cdumez@apple.com>
Document.visibilityState should use an IDL string enumeration
https://bugs.webkit.org/show_bug.cgi?id=165774
Reviewed by Daniel Bates.
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toPageVisibilityState):
2016-12-11 Konstantin Tokarev <annulen@yandex.ru>
Unreviewed attempt to fix EFL and Mac/cmake builds after r209665.
https://bugs.webkit.org/show_bug.cgi?id=165686
* PlatformEfl.cmake: WebKit2 should precede other target so that right
config.h comes first in include path.
2016-12-11 Tim Horton <timothy_horton@apple.com>
Quarter-second stalls scrolling images that are links because of sync getPositionInformation
https://bugs.webkit.org/show_bug.cgi?id=165707
Reviewed by Simon Fraser.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView positionInformationForActionSheetAssistant:]):
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
For now, synchronously block when presenting the action sheet if we
don't have a snapshot ready.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
Respect includeSnapshot in another place in getPositionInformation,
so that many getPositionInformations don't have to do extra snapshotting work.
2016-12-10 Filip Pizlo <fpizlo@apple.com>
The DOM should have an advancing wavefront opaque root barrier
https://bugs.webkit.org/show_bug.cgi?id=165712
Reviewed by Yusuke Suzuki.
Propagate the JSDOMWindowBase::commonVM() -> commonVM() change.
* Shared/linux/WebMemorySamplerLinux.cpp:
(WebKit::WebMemorySampler::sampleWebKit):
* Shared/mac/WebMemorySampler.mac.mm:
(WebKit::WebMemorySampler::sampleWebKit):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::javaScriptObjectsCount):
* WebProcess/Plugins/Netscape/JSNPObject.cpp:
(WebKit::JSNPObject::callMethod):
(WebKit::JSNPObject::callObject):
(WebKit::JSNPObject::callConstructor):
(WebKit::JSNPObject::put):
(WebKit::JSNPObject::deleteProperty):
(WebKit::JSNPObject::getOwnPropertyNames):
(WebKit::JSNPObject::propertyGetter):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runJavaScriptInMainFrame):
(WebKit::WebPage::getBytecodeProfile):
(WebKit::WebPage::getSamplingProfilerOutput):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWebCoreStatistics):
2016-12-11 Konstantin Tokarev <annulen@yandex.ru>
Unreviewed build fix for EFL after r209665
* UIProcess/efl/TextCheckerClientEfl.h:
2016-12-10 Konstantin Tokarev <annulen@yandex.ru>
[cmake] Include WTF, JSC, and WebCore headers automatically to targers using them
https://bugs.webkit.org/show_bug.cgi?id=165686
Reviewed by Michael Catanzaro.
This change reduces duplication of include path lists between modules,
and reduces future need for fixes like r209605 (broken build because of
WebCore header suddenly becoming used in WebKit2).
* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
2016-12-10 Antti Koivisto <antti@apple.com>
CrashTracer: com.apple.WebKit.Networking at WTF::ThreadSafeRefCounted<WebKit::NetworkCache::IOChannel>::deref
https://bugs.webkit.org/show_bug.cgi?id=165659
<rdar://problem/27077977>
Reviewed by Darin Adler.
* NetworkProcess/cache/NetworkCacheIOChannel.h:
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::~IOChannel):
Add non-inlined destructor and release assert against double deletion to narrow down this crash.
2016-12-09 Brent Fulgham <bfulgham@apple.com>
WebCore::Timer is not compatible with UIProcess
https://bugs.webkit.org/show_bug.cgi?id=165706
<rdar://problem/29360564>
Reviewed by Andy Estes.
Anders has explained to me (at least twice) that WebCore::Timer must not
be used in UIProcess code. A recent bug fix introduced a WebCore::Timer,
which led to another crash.
This patch switches from WebCore::Timer to WTF::RunLoop::Timer to avoid
the problem.
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationState):
2016-12-09 Eric Carlson <eric.carlson@apple.com>
Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
https://bugs.webkit.org/show_bug.cgi?id=165251
Reviewed by Dean Jackson.
Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
* Shared/WebPreferencesDefinitions.h: Add peerConnectionEnabled.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPeerConnectionEnabled): Added.
(WKPreferencesGetPeerConnectionEnabled): Added.
* UIProcess/API/C/WKPreferencesRef.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Add WebKitMediaStreamEnabled
and WebKitPeerConnectionEnabled.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Initialize the peerConnection preference.
2016-12-09 Brady Eidson <beidson@apple.com>
Re-landing:
Add _WKIconLoadingDelegate SPI.
https://bugs.webkit.org/show_bug.cgi?id=164894
Reviewed by Alex Christensen.
With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
For icons the app decides to load, WebKit will pass the data to the app without storing locally.
* UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
(API::IconLoadingClient::~IconLoadingClient):
(API::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _iconLoadingDelegate]):
(-[WKWebView _setIconLoadingDelegate:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
(-[_WKLinkIconParameters _initWithLinkIcon:]):
(-[_WKLinkIconParameters url]):
(-[_WKLinkIconParameters mimeType]):
(-[_WKLinkIconParameters size]):
(-[_WKLinkIconParameters iconType]):
* UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
(WebKit::IconLoadingDelegate::IconLoadingDelegate):
(WebKit::IconLoadingDelegate::~IconLoadingDelegate):
(WebKit::IconLoadingDelegate::createIconLoadingClient):
(WebKit::IconLoadingDelegate::delegate):
(WebKit::IconLoadingDelegate::setDelegate):
(WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
(WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
(WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setIconLoadingClient):
(WebKit::WebPageProxy::getLoadDecisionForIcon):
(WebKit::WebPageProxy::finishedLoadingIcon):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::iconLoadingClient):
* UIProcess/WebPageProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::useIconLoadingClient):
(WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
(WebKit::WebFrameLoaderClient::finishedLoadingIcon):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
(WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didGetLoadDecisionForIcon):
(WebKit::WebPage::setUseIconLoadingClient):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2016-12-09 Simon Fraser <simon.fraser@apple.com>
Fix initialization of contentUpdateFrequency
https://bugs.webkit.org/show_bug.cgi?id=165705
rdar://problem/29602039
Reviewed by Tim Horton.
The value that controls web content update frequency was not being initialized.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
2016-12-09 Anders Carlsson <andersca@apple.com>
Once we can send Mach messages again, make sure to send any pending outgoing messages
https://bugs.webkit.org/show_bug.cgi?id=165693
Reviewed by Brady Eidson.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::initializeSendSource):
2016-12-09 Beth Dakin <bdakin@apple.com>
Password fields should not show the emoji button in TouchBar
https://bugs.webkit.org/show_bug.cgi?id=165673
-and corresponding-
rdar://problem/29235739
Reviewed by Wenson Hsieh.
This patch adds a new member variable for the password touch bar and password
candidateListTouchBarItem. Since this TouchBar will actually have a different set
of identifiers than the plain text TouchBar, it should just have its own variable.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
Return m_passwordTextCandidateListTouchBarItem when appropriate.
(WebKit::WebViewImpl::candidateListTouchBarItem):
The candidate list should be the only item for passwords.
(WebKit::passwordTextTouchBarDefaultItemIdentifiers):
Account for m_passwordTextTouchBar.
(WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers):
(WebKit::WebViewImpl::setUpTextTouchBar):
(WebKit::WebViewImpl::textTouchBar):
The empty candidates array is not needed. We can just set @[ ] as the candidates
for the m_passwordTextCandidateListTouchBarItem. Safe guards already exist in the
other parts of the code to prevent us from requesting or setting other candidates
when in a password field.
(WebKit::WebViewImpl::updateTextTouchBar):
2016-12-09 Keith Rollin <krollin@apple.com>
Fix string specification in print format
https://bugs.webkit.org/show_bug.cgi?id=165650
Reviewed by Alex Christensen.
Change "%{public}s" string specifier to something that can be changed
to "%s" at compile time when the build environment doesn't support the
former.
* NetworkProcess/capture/NetworkCaptureLogging.h:
* NetworkProcess/capture/NetworkCaptureManager.cpp:
(WebKit::NetworkCapture::Manager::initialize):
(WebKit::NetworkCapture::Manager::findMatch):
(WebKit::NetworkCapture::Manager::findExactMatch):
(WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
(WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
(WebKit::NetworkCapture::Manager::logPlayedBackResource):
(WebKit::NetworkCapture::Manager::openCacheFile):
(WebKit::NetworkCapture::Manager::getLine):
* NetworkProcess/capture/NetworkCaptureRecorder.cpp:
(WebKit::NetworkCapture::Recorder::recordRequestSent):
(WebKit::NetworkCapture::Recorder::recordResponseReceived):
(WebKit::NetworkCapture::Recorder::recordRedirectReceived):
(WebKit::NetworkCapture::Recorder::recordRedirectSent):
(WebKit::NetworkCapture::Recorder::writeEvents):
* NetworkProcess/capture/NetworkCaptureResource.cpp:
(WebKit::NetworkCapture::Resource::url):
(WebKit::NetworkCapture::Resource::EventStream::nextEvent):
* NetworkProcess/capture/NetworkDataTaskReplay.cpp:
(WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
(WebKit::NetworkCapture::NetworkDataTaskReplay::~NetworkDataTaskReplay):
(WebKit::NetworkCapture::NetworkDataTaskReplay::resume):
(WebKit::NetworkCapture::NetworkDataTaskReplay::suspend):
(WebKit::NetworkCapture::NetworkDataTaskReplay::complete):
(WebKit::NetworkCapture::NetworkDataTaskReplay::invalidateAndCancel):
(WebKit::NetworkCapture::NetworkDataTaskReplay::enqueueEventHandler):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayRequestSent):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayResponseReceived):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectReceived):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectSent):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayDataReceived):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayFinished):
(WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
2016-12-09 Jeremy Jones <jeremyj@apple.com>
WebView doesn't become first responder in element fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=165664
rdar://problem/28927252
Reviewed by Tim Horton.
WebView was being set as the first responder while the contentView was still hidden.
A view can not become first responder while it or its ancestor is hidden.
This change waits until after the contentView is visible to make the web view the first responder.
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController enterFullScreen:]):
(-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
2016-12-09 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Unreviewed build fix. Thanks to Konstantin Tokarev and Csaba Osztrogonác
for pointing out the fix.
* CMakeLists.txt: add WebCore/html/canvas to include paths.
2016-12-09 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
[GTK] Fix build after r209558
https://bugs.webkit.org/show_bug.cgi?id=165653
Unreviewed build fix.
* UIProcess/API/APIPolicyClient.h: include WebsitePolicies.h.
* UIProcess/API/gtk/WebKitPolicyClient.cpp: ditto.
* UIProcess/API/gtk/WebKitPolicyDecision.cpp:
(webkit_policy_decision_use): pass empty structure to new required argument.
2016-12-09 Gavin Barraclough <barraclough@apple.com>
Revert - Add _WKIconLoadingDelegate SPI
https://bugs.webkit.org/show_bug.cgi?id=164894
Unreviewed rollout due to performance regression.
* PlatformMac.cmake:
* UIProcess/API/APIIconLoadingClient.h: Removed.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _iconLoadingDelegate]): Deleted.
(-[WKWebView _setIconLoadingDelegate:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Removed.
* UIProcess/API/Cocoa/_WKLinkIconParameters.h: Removed.
* UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Removed.
* UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Removed.
* UIProcess/Cocoa/IconLoadingDelegate.h: Removed.
* UIProcess/Cocoa/IconLoadingDelegate.mm: Removed.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setIconLoadingClient): Deleted.
(WebKit::WebPageProxy::getLoadDecisionForIcon): Deleted.
(WebKit::WebPageProxy::finishedLoadingIcon): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::iconLoadingClient): Deleted.
* UIProcess/WebPageProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::useIconLoadingClient): Deleted.
(WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): Deleted.
(WebKit::WebFrameLoaderClient::finishedLoadingIcon): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
(WebKit::WebFrameLoaderClient::setUseIconLoadingClient): Deleted.
(): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didGetLoadDecisionForIcon): Deleted.
(WebKit::WebPage::setUseIconLoadingClient): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2016-12-08 Keith Rollin <krollin@apple.com>
Move FileHandle to WebCore FileHandle.h
https://bugs.webkit.org/show_bug.cgi?id=165562
Reviewed by Alex Christensen.
Move FileHandle from NetworkCaptureTypes.h (which can now be deleted)
to WebCore. Update client code to use the new version.
* NetworkProcess/capture/NetworkCaptureEvent.cpp:
* NetworkProcess/capture/NetworkCaptureEvent.h:
* NetworkProcess/capture/NetworkCaptureManager.cpp:
(WebKit::NetworkCapture::Manager::initialize):
(WebKit::NetworkCapture::Manager::terminate):
(WebKit::NetworkCapture::Manager::logRecordedResource):
(WebKit::NetworkCapture::Manager::logLoadedResource):
(WebKit::NetworkCapture::Manager::logPlayedBackResource):
(WebKit::NetworkCapture::Manager::openCacheFile):
(WebKit::NetworkCapture::Manager::ensureFileHandle): Deleted.
(WebKit::NetworkCapture::Manager::printToFile): Deleted.
* NetworkProcess/capture/NetworkCaptureManager.h:
* NetworkProcess/capture/NetworkCaptureRecorder.cpp:
(WebKit::NetworkCapture::Recorder::writeEvents):
* NetworkProcess/capture/NetworkCaptureTypes.h: Removed.
* WebKit2.xcodeproj/project.pbxproj:
2016-12-08 Anders Carlsson <andersca@apple.com>
Attempt to fix the iOS build.
* Platform/IPC/mac/MachMessage.cpp:
2016-12-08 Anders Carlsson <andersca@apple.com>
Defer sending Mach messages if the queue is full
https://bugs.webkit.org/show_bug.cgi?id=165622
rdar://problem/29518036
Reviewed by Brady Eidson.
* Platform/IPC/Connection.cpp:
Include MachMessage.h so the Connection destructor can do its thing.
* Platform/IPC/Connection.h:
Add new members.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate):
Null out the pending outgoing mach message.
(IPC::Connection::sendMessage):
New helper that will send a Mach message. If we time out, store the message in m_pendingOutgoingMachMessage.
When our send source will be triggered we'll try to send the message again.
(IPC::Connection::platformCanSendOutgoingMessages):
We can only send messages if we don't have a pending outgoing message.
(IPC::Connection::sendOutgoingMessage):
Call the newly added sendMessage function.
(IPC::Connection::initializeSendSource):
Add the DISPATCH_MACH_SEND_POSSIBLE mask (and DISPATCH_MACH_SEND_DEAD which was previously implicit).
In our event handler, check for DISPATCH_MACH_SEND_POSSIBLE and try to send the pending outgoing message again.
* Platform/IPC/mac/MachMessage.cpp:
(IPC::MachMessage::create):
Rename length to size.
(IPC::MachMessage::MachMessage):
Initialize m_shouldFreeDescriptors.
(IPC::MachMessage::~MachMessage):
Call mach_msg_destroy, which will free the descriptors.
(IPC::MachMessage::leakDescriptors):
Set m_shouldFreeDescriptors to false.
* Platform/IPC/mac/MachMessage.h:
(IPC::MachMessage::size):
(IPC::MachMessage::length): Deleted.
2016-12-08 Chelsea Pugh <cpugh@apple.com>
[iOS] WKWebView should not allow app links to be opened on back or forward navigation
https://bugs.webkit.org/show_bug.cgi?id=165502
Reviewed by Dan Bernstein.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction): Add a condition to shouldOpenAppLinks
(which we use when creating a NavigationAction) that the navigationActionData is not a navigation
of type BackForward. This way, we don't open app links when a navigation is done via back or
forward.
2016-12-08 Filip Pizlo <fpizlo@apple.com>
Enable SharedArrayBuffer, remove the flag
https://bugs.webkit.org/show_bug.cgi?id=165614
Rubber stamped by Geoffrey Garen.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2016-12-08 Alex Christensen <achristensen@webkit.org>
Add SPI for sending WebsiteSettings to WebProcess during navigation
https://bugs.webkit.org/show_bug.cgi?id=165517
<rdar://29341068>
We add the ability for the navigation client to send settings to the WebProcess
based on the URL of the document being navigated to. This approach adds no new IPC
messages and allows the application to decide what settings to use during navigation
instead of declaratively before navigation. Right now there is only one setting,
whether to disable content blockers, but this infrastructure can be used for more settings.
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* PlatformMac.cmake:
* Shared/API/APIObject.h:
* Shared/API/c/WKBase.h:
* Shared/WebsitePolicies.h: Added.
(WebKit::WebsitePolicies::encode):
(WebKit::WebsitePolicies::decode):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::decidePolicyForNavigationAction):
(API::NavigationClient::decidePolicyForNavigationResponse):
* UIProcess/API/APIPolicyClient.h:
(API::PolicyClient::decidePolicyForNavigationAction):
(API::PolicyClient::decidePolicyForNewWindowAction):
(API::PolicyClient::decidePolicyForResponse):
* UIProcess/API/APIWebsitePolicies.cpp: Added.
(API::WebsitePolicies::create):
* UIProcess/API/APIWebsitePolicies.h: Added.
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKFramePolicyListener.cpp:
(WKFramePolicyListenerUse):
(WKFramePolicyListenerUseWithPolicies):
* UIProcess/API/C/WKFramePolicyListener.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPagePolicyClient):
* UIProcess/API/C/WKWebsitePolicies.cpp: Added.
(WKWebsitePoliciesGetTypeID):
(WKWebsitePoliciesCreate):
(WKWebsitePoliciesSetContentBlockersEnabled):
(WKWebsitePoliciesGetContentBlockersEnabled):
* UIProcess/API/C/WKWebsitePolicies.h: Added.
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h: Added.
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm: Added.
(-[_WKWebsitePolicies dealloc]):
(-[_WKWebsitePolicies init]):
(-[_WKWebsitePolicies setContentBlockersEnabled:]):
(-[_WKWebsitePolicies contentBlockersEnabled]):
(-[_WKWebsitePolicies description]):
(-[_WKWebsitePolicies _apiObject]):
* UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: Added.
(WebKit::wrapper):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::reloadBrowsingContext):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::tryAppLink):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
* UIProcess/WebFormSubmissionListenerProxy.cpp:
(WebKit::WebFormSubmissionListenerProxy::continueSubmission):
* UIProcess/WebFrameListenerProxy.cpp:
(WebKit::WebFrameListenerProxy::receivedPolicyDecision):
* UIProcess/WebFrameListenerProxy.h:
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::use):
(WebKit::WebFramePolicyListenerProxy::download):
(WebKit::WebFramePolicyListenerProxy::ignore):
* UIProcess/WebFramePolicyListenerProxy.h:
(WebKit::WebFramePolicyListenerProxy::create):
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::receivedPolicyDecision):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::decidePolicyForNavigationAction):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2016-12-08 Antti Koivisto <antti@apple.com>
Salt network cache hashes
https://bugs.webkit.org/show_bug.cgi?id=164924
Reviewed by Alex Christensen.
To enhance privacy make cache content unidentifiable from file names alone.
This is done by generating a unique persistent salt for each cache instance.
It is used when computing hashes used in file names.
The patch also replaces plain text partition directory names with salted hashes.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::makeCacheKey):
(WebKit::NetworkCache::makeCacheKey): Deleted.
* NetworkProcess/cache/NetworkCache.h:
Increment cache version.
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::BlobStorage):
(WebKit::NetworkCache::BlobStorage::add):
(WebKit::NetworkCache::BlobStorage::get):
Use salt for blob content hash.
* NetworkProcess/cache/NetworkCacheBlobStorage.h:
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::computeSHA1):
For simplicity all SHA1s are now salted.
(WebKit::NetworkCache::makeSalt):
(WebKit::NetworkCache::readOrMakeSalt):
Read salt if it exists, generate and persist it otherwise.
* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::Key::Key):
Remove the "No partition" string and just empty.
That was only needed to have a directory name of some sort.
(WebKit::NetworkCache::Key::computeHash):
Use salt for key hash.
(WebKit::NetworkCache::Key::computePartitionHash):
Separate hash for partition.
* NetworkProcess/cache/NetworkCacheKey.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::makeSubresourcesKey):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeSaltFilePath):
(WebKit::NetworkCache::Storage::open):
Cache can't be opened if we can't read or persist a salt.
(WebKit::NetworkCache::traverseRecordsFiles):
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
Use the partition hash in the directory name instead of a plain text name.
(WebKit::NetworkCache::decodeRecordHeader):
(WebKit::NetworkCache::Storage::readRecord):
(WebKit::NetworkCache::Storage::encodeRecord):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::salt):
2016-12-08 Eric Carlson <eric.carlson@apple.com>
Fix the EFL build.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange): Add another ENABLE(MEDIA_STREAM) guard.
2016-12-08 Tomas Popela <tpopela@redhat.com>
[GTK] Process accelerated compositing env variables only if they are really enabled
https://bugs.webkit.org/show_bug.cgi?id=165300
Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
(eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).
Reviewed by Michael Catanzaro.
* UIProcess/gtk/WebPreferencesGtk.cpp:
(WebKit::WebPreferences::platformInitializeStore):
2016-12-08 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* CMakeLists.txt:
Add the new NetworkProcess/capture include directory to find new headers from r209498.
* NetworkProcess/capture/NetworkCaptureEvent.cpp:
(WebKit::NetworkCapture::Response::Response):
(WebKit::NetworkCapture::Error::Error):
The String constructor was ambiguous after r209498 because URL has an operator NSString* and String has an NSString constructor.
We should get rid of operator NSString* and operator String on URL.
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
Add some ENABLE(MEDIA_STREAM) macros to fix the build without it enabled after r209512.
2016-12-08 Alex Christensen <achristensen@webkit.org>
Fix iOS debug build after r209498
https://bugs.webkit.org/show_bug.cgi?id=164527
* NetworkProcess/capture/NetworkCaptureLogging.h:
Logs were causing compile warnings/errors. Disable logs for now.
2016-12-07 Dean Jackson <dino@apple.com>
Remove runtime toggle for pointer-lock
https://bugs.webkit.org/show_bug.cgi?id=165577
<rdar://problems/29566996>
Reviewed by Jon Lee.
Remove any runtime calls to check if pointer-lock is enabled. It's
either compiled in or out.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPointerLockEnabled): Deleted.
(WKPreferencesGetPointerLockEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-12-07 Eric Carlson <eric.carlson@apple.com>
[MediaStream][Mac] Revoke sandbox extensions when capture ends
https://bugs.webkit.org/show_bug.cgi?id=165476
Reviewed by Brady Eidson.
Track media capture by process so it is possible to revoke the sandbox extensions issued to
a web process when capture stops. Allocate WK2 user media permission manager lazily rather
than every time a page is created as most pages won't need one.
* CMakeLists.txt: Add new files.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
with process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox
extension code to the process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
(WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
change to the process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaProcessManager.cpp: Added.
(WebKit::ProcessState::ProcessState):
(WebKit::ProcessState::managers):
(WebKit::ProcessState::sandboxExtensionsGranted):
(WebKit::ProcessState::setSandboxExtensionsGranted):
(WebKit::stateMap):
(WebKit::processState):
(WebKit::ProcessState::addRequestManager):
(WebKit::ProcessState::removeRequestManager):
(WebKit::UserMediaProcessManager::singleton):
(WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::startedCaptureSession):
(WebKit::UserMediaProcessManager::endedCaptureSession):
* UIProcess/UserMediaProcessManager.h: Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Don't allocate m_userMediaPermissionRequestManager.
(WebKit::WebPageProxy::resetState): Set m_userMediaPermissionRequestManager to null.
(WebKit::WebPageProxy::userMediaPermissionRequestManager): Allocate m_userMediaPermissionRequestManager
lazily as most pages don't need it.
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Call userMediaPermissionRequestManager().
(WebKit::WebPageProxy::enumerateMediaDevicesForFrame): Ditto.
(WebKit::WebPageProxy::clearUserMediaState): Ditto.
(WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
manager proxy.
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj: Add new files.
* WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
(WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
(WebKit::MediaDeviceSandboxExtensions::encode):
(WebKit::MediaDeviceSandboxExtensions::decode):
(WebKit::MediaDeviceSandboxExtensions::operator[]):
(WebKit::MediaDeviceSandboxExtensions::size):
* WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
is now in a HashMap, not a Vector.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
IDs with extensions so they can be revoked later.
(WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
(WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
(WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2016-12-07 Jeremy Jones <jeremyj@apple.com>
One esc to exit fullscreen and pointer lock
https://bugs.webkit.org/show_bug.cgi?id=165416
rdar://problem/29430711
Reviewed by Jer Noble.
Fix a crash when didLosePointerLock is not specified.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
2016-12-07 Keith Rollin <krollin@apple.com>
Network event record/replay
https://bugs.webkit.org/show_bug.cgi?id=164527
<rdar://problem/29168157>
Reviewed by Alex Christensen.
Add WebKit2/NetworkProcess/capture/* for recording the network events
that occur when loading a page and for replaying them later. Update
NetworkLoad to invoke capture facilities. Add preferences for enabling
record or replay.
* CMakeLists.txt:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
(WebKit::NetworkLoad::initializeForRecord):
(WebKit::NetworkLoad::initializeForReplay):
(WebKit::NetworkLoad::initialize):
(WebKit::NetworkLoad::setDefersLoading):
(WebKit::NetworkLoad::continueWillSendRequest):
(WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
(WebKit::NetworkLoad::notifyDidReceiveResponse):
(WebKit::NetworkLoad::didReceiveData):
(WebKit::NetworkLoad::didCompleteWithError):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::terminate):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/capture/NetworkCaptureEvent.cpp: Added.
(WebKit::NetworkCapture::copyHeaders):
(WebKit::NetworkCapture::KeyValuePair::KeyValuePair):
(WebKit::NetworkCapture::ResourceRequest::ResourceRequest):
(WebKit::NetworkCapture::ResourceRequest::operator WebCore::ResourceRequest):
(WebKit::NetworkCapture::ResourceResponse::ResourceResponse):
(WebKit::NetworkCapture::ResourceResponse::operator WebCore::ResourceResponse):
(WebKit::NetworkCapture::ResourceError::ResourceError):
(WebKit::NetworkCapture::ResourceError::operator WebCore::ResourceError):
(WebKit::NetworkCapture::JSONCoder::encode):
(WebKit::NetworkCapture::JSONCoder::decode):
(WebKit::NetworkCapture::JSONCoder<String>::encode):
(WebKit::NetworkCapture::JSONCoder<String>::decode):
(WebKit::NetworkCapture::JSONCoder<CaptureTimeType>::encode):
(WebKit::NetworkCapture::JSONCoder<CaptureTimeType>::decode):
(WebKit::NetworkCapture::JSONCoder<KeyValuePair>::encode):
(WebKit::NetworkCapture::JSONCoder<KeyValuePair>::decode):
(WebKit::NetworkCapture::JSONCoder<Vector<T>>::encode):
(WebKit::NetworkCapture::JSONCoder<Vector<T>>::decode):
(WebKit::NetworkCapture::JSONCoder<ResourceRequest>::encode):
(WebKit::NetworkCapture::JSONCoder<ResourceRequest>::decode):
(WebKit::NetworkCapture::JSONCoder<ResourceResponse>::encode):
(WebKit::NetworkCapture::JSONCoder<ResourceResponse>::decode):
(WebKit::NetworkCapture::JSONCoder<ResourceError>::encode):
(WebKit::NetworkCapture::JSONCoder<ResourceError>::decode):
(WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::encode):
(WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::decode):
(WebKit::NetworkCapture::JSONCoder<RequestSentEvent>::encode):
(WebKit::NetworkCapture::JSONCoder<RequestSentEvent>::decode):
(WebKit::NetworkCapture::JSONCoder<ResponseReceivedEvent>::encode):
(WebKit::NetworkCapture::JSONCoder<ResponseReceivedEvent>::decode):
(WebKit::NetworkCapture::JSONCoder<RedirectReceivedEvent>::encode):
(WebKit::NetworkCapture::JSONCoder<RedirectReceivedEvent>::decode):
(WebKit::NetworkCapture::JSONCoder<RedirectSentEvent>::encode):
(WebKit::NetworkCapture::JSONCoder<RedirectSentEvent>::decode):
(WebKit::NetworkCapture::JSONCoder<DataReceivedEvent>::encode):
(WebKit::NetworkCapture::JSONCoder<DataReceivedEvent>::decode):
(WebKit::NetworkCapture::JSONCoder<FinishedEvent>::encode):
(WebKit::NetworkCapture::JSONCoder<FinishedEvent>::decode):
(WebKit::NetworkCapture::eventToString):
(WebKit::NetworkCapture::stringToEvent):
* NetworkProcess/capture/NetworkCaptureEvent.h: Added.
(WebKit::NetworkCapture::TimedEvent::TimedEvent):
* NetworkProcess/capture/NetworkCaptureLogging.h: Added.
* NetworkProcess/capture/NetworkCaptureManager.cpp: Added.
(WebKit::NetworkCapture::Manager::singleton):
(WebKit::NetworkCapture::Manager::initialize):
(WebKit::NetworkCapture::Manager::terminate):
(WebKit::NetworkCapture::Manager::findMatch):
(WebKit::NetworkCapture::Manager::findExactMatch):
(WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
(WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
(WebKit::NetworkCapture::Manager::loadResources):
(WebKit::NetworkCapture::Manager::reportLoadPath):
(WebKit::NetworkCapture::Manager::reportRecordPath):
(WebKit::NetworkCapture::Manager::reportReplayPath):
(WebKit::NetworkCapture::Manager::requestToPath):
(WebKit::NetworkCapture::Manager::stringToHash):
(WebKit::NetworkCapture::Manager::hashToPath):
(WebKit::NetworkCapture::Manager::logRecordedResource):
(WebKit::NetworkCapture::Manager::logLoadedResource):
(WebKit::NetworkCapture::Manager::logPlayedBackResource):
(WebKit::NetworkCapture::Manager::ensureFileHandle):
(WebKit::NetworkCapture::Manager::openCacheFile):
(WebKit::NetworkCapture::Manager::readFile):
(WebKit::NetworkCapture::Manager::getLine):
(WebKit::NetworkCapture::Manager::getWord):
(WebKit::NetworkCapture::Manager::printToFile):
* NetworkProcess/capture/NetworkCaptureManager.h: Added.
(WebKit::NetworkCapture::Manager::isRecording):
(WebKit::NetworkCapture::Manager::isReplaying):
(WebKit::NetworkCapture::Manager::mode):
* NetworkProcess/capture/NetworkCaptureRecorder.cpp: Added.
(WebKit::NetworkCapture::Recorder::recordRequestSent):
(WebKit::NetworkCapture::Recorder::recordResponseReceived):
(WebKit::NetworkCapture::Recorder::recordRedirectReceived):
(WebKit::NetworkCapture::Recorder::recordRedirectSent):
(WebKit::NetworkCapture::Recorder::recordDataReceived):
(WebKit::NetworkCapture::Recorder::recordFinish):
(WebKit::NetworkCapture::Recorder::writeEvents):
* NetworkProcess/capture/NetworkCaptureRecorder.h: Added.
(WebKit::NetworkCapture::Recorder::recordEvent):
* NetworkProcess/capture/NetworkCaptureReplayer.cpp: Added.
(WebKit::NetworkCapture::Replayer::replayResource):
* NetworkProcess/capture/NetworkCaptureReplayer.h: Added.
* NetworkProcess/capture/NetworkCaptureResource.cpp: Added.
(WebKit::NetworkCapture::Resource::Resource):
(WebKit::NetworkCapture::Resource::url):
(WebKit::NetworkCapture::Resource::baseURL):
(WebKit::NetworkCapture::Resource::queryParameters):
(WebKit::NetworkCapture::Resource::eventStream):
(WebKit::NetworkCapture::Resource::EventStream::EventStream):
(WebKit::NetworkCapture::Resource::EventStream::nextEvent):
* NetworkProcess/capture/NetworkCaptureResource.h: Added.
* NetworkProcess/capture/NetworkCaptureTypes.h: Added.
(WebKit::NetworkCapture::TypeHolder::forEachTypeImpl):
(WebKit::NetworkCapture::TypeHolder::forEachType):
* NetworkProcess/capture/NetworkDataTaskReplay.cpp: Added.
(WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
(WebKit::NetworkCapture::NetworkDataTaskReplay::~NetworkDataTaskReplay):
(WebKit::NetworkCapture::NetworkDataTaskReplay::resume):
(WebKit::NetworkCapture::NetworkDataTaskReplay::suspend):
(WebKit::NetworkCapture::NetworkDataTaskReplay::cancel):
(WebKit::NetworkCapture::NetworkDataTaskReplay::complete):
(WebKit::NetworkCapture::NetworkDataTaskReplay::invalidateAndCancel):
(WebKit::NetworkCapture::NetworkDataTaskReplay::enqueueEventHandler):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayRequestSent):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayResponseReceived):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectReceived):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectSent):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayDataReceived):
(WebKit::NetworkCapture::NetworkDataTaskReplay::replayFinished):
(WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
(WebKit::NetworkCapture::NetworkDataTaskReplay::didFinish):
* NetworkProcess/capture/NetworkDataTaskReplay.h: Added.
(WebKit::NetworkCapture::NetworkDataTaskReplay::create):
* NetworkProcess/capture/json.hpp: Added.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebKit2.xcodeproj/project.pbxproj:
* config.h:
2016-12-07 Anders Carlsson <andersca@apple.com>
Fix build.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open):
2016-12-07 Anders Carlsson <andersca@apple.com>
Rename the connection sources to better indicate what data direction they are used for
https://bugs.webkit.org/show_bug.cgi?id=165548
Reviewed by Tim Horton.
* Platform/IPC/Connection.h:
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate):
(IPC::Connection::platformInitialize):
(IPC::createReceiveSource):
(IPC::Connection::initializeSendSource):
(IPC::Connection::receiveSourceEventHandler):
(IPC::createDataAvailableSource): Deleted.
(IPC::Connection::initializeDeadNameSource): Deleted.
Rename m_deadNameSource to m_sendSource, and m_receivePortDataAvailableSource to m_receiveSource.
(IPC::Connection::open):
Initialize the send source before we attempt to send a first message.
2016-12-07 Simon Fraser <simon.fraser@apple.com>
Fix use of enum in a WK2 C SPI header.
rdar://problem/28725583
Followup to correctly prefix the enum values.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetEventThrottlingBehaviorOverride):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2016-12-07 Simon Fraser <simon.fraser@apple.com>
Fix use of enum in a WK2 C SPI header.
rdar://problem/28725583
Reviewed by Dan Bernstein.
Use correct enum style for a C SPI header and fix the callers.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetEventThrottlingBehaviorOverride):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2016-12-07 Beth Dakin <bdakin@apple.com>
Remove iCloud Pages and Keynote site-specific hacks
https://bugs.webkit.org/show_bug.cgi?id=165544
-and corresponding-
rdar://problem/29082536
Reviewed by Wenson Hsieh.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::needsHiddenContentEditableQuirk):
(WebKit::needsPlainTextQuirk):
2016-12-05 Ada Chan <adachan@apple.com>
Add a getter for serverTrust in _WKObservablePageState
https://bugs.webkit.org/show_bug.cgi?id=165433
Reviewed by Anders Carlsson.
* UIProcess/API/C/mac/WKPagePrivateMac.h:
* UIProcess/API/C/mac/WKPagePrivateMac.mm:
(-[WKObservablePageState serverTrust]):
2016-12-07 Jer Noble <jer.noble@apple.com>
Exiting Element Fullscreen mode loses focus on WKWebView.
https://bugs.webkit.org/show_bug.cgi?id=165512
Reviewed by Eric Carlson.
Setting 'window.contentView.hidden = YES' will reset the first-responder (whereas
previously setting 'window.contentView.layer.hidden = YES' did not). Grab the first-
responder before doing so, so that it can be reset correctly when moving the WKWebView
back to it's original window.
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
2016-12-07 Alex Christensen <achristensen@webkit.org>
Fix CMake build after r209418.
https://bugs.webkit.org/show_bug.cgi?id=165484
* PlatformMac.cmake:
2016-12-07 Philippe Normand <pnormand@igalia.com>
Unreviewed, GTK build fix after r209407.
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::processMessage):
* UIProcess/LegacySessionStateCodingNone.cpp:
(WebKit::decodeLegacySessionState):
2016-12-06 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r209422.
This change caused assertion failures during API tests.
Reverted changeset:
"[MediaStream][Mac] Revoke sandbox extensions when capture
ends"
https://bugs.webkit.org/show_bug.cgi?id=165476
http://trac.webkit.org/changeset/209422
2016-12-06 Dean Jackson <dino@apple.com>
Include default value in Experimental Feature information
https://bugs.webkit.org/show_bug.cgi?id=165509
<rdar://problems/29547177>
Reviewed by Tim Horton.
Add a defaultValue member variable to experimental
features, both the C++ and ObjC interfaces.
* UIProcess/API/APIExperimentalFeature.cpp:
(API::ExperimentalFeature::create):
(API::ExperimentalFeature::ExperimentalFeature):
* UIProcess/API/APIExperimentalFeature.h:
* UIProcess/API/Cocoa/_WKExperimentalFeature.h:
* UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
(-[_WKExperimentalFeature description]):
(-[_WKExperimentalFeature defaultValue]):
* UIProcess/WebPreferences.cpp:
(WebKit::createExperimentalFeaturesVector):
2016-12-06 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r209391.
https://bugs.webkit.org/show_bug.cgi?id=165501
requires explicit nullptr checks so missing env vars don't
flip AC mode (Requested by mcatanzaro on #webkit).
Reverted changeset:
"[GTK] Process accelerated compositing env variables only if
they are really enabled"
https://bugs.webkit.org/show_bug.cgi?id=165300
http://trac.webkit.org/changeset/209391
2016-12-06 Alexey Proskuryakov <ap@apple.com>
Correct SDKROOT values in xcconfig files
https://bugs.webkit.org/show_bug.cgi?id=165487
rdar://problem/29539209
Reviewed by Dan Bernstein.
Fix suggested by Dan Bernstein.
* Configurations/DebugRelease.xcconfig:
2016-12-06 Andreas Kling <akling@apple.com>
[Cocoa] Add some memory usage related information to sysdiagnose state dumps
<https://webkit.org/b/165375>
<rdar://problem/29057243>
Reviewed by Darin Adler.
Follow-up to address two more review comments.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::registerWithStateDumper): Use adoptNS() instead of autorelease for NSStrings.
2016-12-06 Eric Carlson <eric.carlson@apple.com>
[MediaStream][Mac] Revoke sandbox extensions when capture ends
https://bugs.webkit.org/show_bug.cgi?id=165476
Reviewed by Brady Eidson.
Track media capture by process so it is possible to revoke the sandbox extensions issued to
a web process when capture stops.
* CMakeLists.txt: Add new files.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
with process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox
extension code to the process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
(WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
change to the process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaProcessManager.cpp: Added.
(WebKit::ProcessState::ProcessState):
(WebKit::ProcessState::managers):
(WebKit::ProcessState::sandboxExtensionsGranted):
(WebKit::ProcessState::setSandboxExtensionsGranted):
(WebKit::stateMap):
(WebKit::processState):
(WebKit::ProcessState::addRequestManager):
(WebKit::ProcessState::removeRequestManager):
(WebKit::UserMediaProcessManager::singleton):
(WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::startedCaptureSession):
(WebKit::UserMediaProcessManager::endedCaptureSession):
* UIProcess/UserMediaProcessManager.h: Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
manager proxy.
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj: Add new files.
* WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
(WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
(WebKit::MediaDeviceSandboxExtensions::encode):
(WebKit::MediaDeviceSandboxExtensions::decode):
(WebKit::MediaDeviceSandboxExtensions::operator[]):
(WebKit::MediaDeviceSandboxExtensions::size):
* WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
is now in a HashMap, not a Vector.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
IDs with extensions so they can be revoked later.
(WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
(WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
(WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2016-12-06 Anders Carlsson <andersca@apple.com>
Add a new MachMessage class and use it for sending outgoing messages
https://bugs.webkit.org/show_bug.cgi?id=165484
Reviewed by Sam Weinig.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendOutgoingMessage):
Instead of trying to randomly use memory from the stack as well as using mmap for the message data for out of line messages
(which makes no sense at all, since the body data is already mmapped), just always create a MachMessage object and use it.
(IPC::machMessageSize): Deleted.
This has been moved to MachMessage::messageSize().
* Platform/IPC/mac/MachMessage.cpp: Added.
(IPC::MachMessage::create):
Allocate extra memory to store the actual buffer.
(IPC::MachMessage::MachMessage):
Initialize variables. m_size isn't really used right now, but will be in a subsequent patch.
(IPC::MachMessage::header):
Return the header.
* Platform/IPC/mac/MachMessage.h: Added.
(IPC::MachMessage::length):
* WebKit2.xcodeproj/project.pbxproj:
Add new files.
2016-12-06 Simon Fraser <simon.fraser@apple.com>
Enable visual viewports by default on Mac, and iOS Wk2
https://bugs.webkit.org/show_bug.cgi?id=165452
Reviewed by Zalan Bujtas.
Turn visual viewports on by default for WK2.
* Shared/WebPreferencesDefinitions.h:
2016-12-06 Daniel Bates <dabates@apple.com>
WebKitTestRunner: Plugins are disabled in new windows
https://bugs.webkit.org/show_bug.cgi?id=165410
Reviewed by Alex Christensen.
Remove SPI exposed to explicitly toggle plugins from WebKitTestRunner.
Instead we will update WebKitTestRunner to make use of the SPI
WKBundleOverrideBoolPreferenceForTestRunner() to toggle plugins in
all windows.
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetPluginsEnabled): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPluginsEnabled): Deleted.
2016-12-05 Anders Carlsson <andersca@apple.com>
Don't memcpy out of line data
https://bugs.webkit.org/show_bug.cgi?id=165434
Reviewed by Sam Weinig.
Change the Decoder constructor to take a buffer deallocator parameter. If the buffer deallocator is null, the
data will be copied as before. Otherwise, the memory will be adopted by the Decoder object, and will be deallocated
by invoking the data deallocator.
* Platform/IPC/Decoder.cpp:
(IPC::copyBuffer):
Add a new helper.
(IPC::Decoder::Decoder):
Copy the buffer if the deallocator is null.
(IPC::Decoder::~Decoder):
Invoke the deallocator or call fastFree if it is null.
(IPC::Decoder::unwrapForTesting):
Update constructor.
(IPC::roundUpToAlignment):
(IPC::Decoder::alignBufferPosition):
(IPC::Decoder::decodeVariableLengthByteArray):
(IPC::decodeValueFromBuffer):
Change all these to deal with const pointers.
* Platform/IPC/Decoder.h:
Add new members.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::createMessageDecoder):
When we have out of line data, pass a deallocator that calls vm_deallocate, instead of copying the data
and then immediately throwing the original away.
2016-12-06 Tim Horton <timothy_horton@apple.com>
Almost half-second stall scrolling apple.com because of synchronous getPositionInformation
https://bugs.webkit.org/show_bug.cgi?id=165403
<rdar://problem/29493285>
Reviewed by Enrica Casucci.
When retrieving interaction information, we don't always need to do
snapshots for 3D Touch or the action sheet, especially if we're
synchronously blocking the UI process main thread waiting for the reply.
Add a new InteractionInformationRequest, which allows callers of
getPositionInformation and requestPositionInformation to specify which
optional pieces of information they would like to compute.
* Shared/AssistedNodeInformation.h:
Fix a incorrect comment.
* Shared/ios/InteractionInformationRequest.cpp: Added.
(WebKit::InteractionInformationRequest::encode):
(WebKit::InteractionInformationRequest::decode):
(WebKit::InteractionInformationRequest::isValidForRequest):
* Shared/ios/InteractionInformationRequest.h: Added.
(WebKit::InteractionInformationRequest::InteractionInformationRequest):
* WebKit2.xcodeproj/project.pbxproj:
Add InteractionInformationRequest, which encapsulates all of the
parameters required to generate an InteractionInformationAtPosition.
Previously, that was just a point, but now we have two new parameters:
whether we should generate a snapshot of the element, and whether
we should generate a TextIndicator if the element is a link.
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
(WebKit::InteractionInformationAtPosition::mergeCompatibleOptionalInformation):
Adopt InteractionInformationRequest.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::getPositionInformation):
(WebKit::WebPageProxy::requestPositionInformation):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
(-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
(-[WKActionSheetAssistant showImageSheet]):
(-[WKActionSheetAssistant showLinkSheet]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Adopt InteractionInformationRequest.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showAttachmentSheet]):
(-[WKContentView ensurePositionInformationIsUpToDate:]):
If we have a outstanding asynchronous position information request
for the current point, instead of sending a second separate request,
just wait for the async one to come in.
(-[WKContentView requestAsynchronousPositionInformationUpdate:]):
If asked to do an asynchronous request with more optional bits than
the current otherwise-valid response's request, update the position information.
(-[WKContentView gestureRecognizerShouldBegin:]):
The design of this mechanism is that during the highlight long press,
we do an async position information update, and then when we actually
begin a 3D Touch gesture, we hope to already have the requisite snapshots
ready (so that we can avoid synchronously blocking for them, there).
So, in the highlight long-press async request, ask for all the goodies.
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView pointIsInAssistedNode:]):
(-[WKContentView _didNotHandleTapAsClick:]):
(-[WKContentView _positionInformationDidChange:]):
If we get a position information update for the same point, but with less
goodies attached (the snapshot/link indicator), copy them over from the old
position information, so that we never accidentally "downgrade" our info.
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
(-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):
More adoption.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::commitPotentialTap):
Adopt InteractionInformationRequest.
(WebKit::WebPage::getPositionInformation):
(WebKit::WebPage::requestPositionInformation):
Copy the request into the response.
Only snapshot if the request wants a snapshot.
Only make a link indicator if the request wants one.
2016-12-06 Daniel Bates <dabates@apple.com>
Cleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style Guidelines
https://bugs.webkit.org/show_bug.cgi?id=165451
Reviewed by Alex Christensen.
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::didReceiveResponse):
2016-12-06 Daniel Bates <dabates@apple.com>
Remove unused InjectedBundle::overrideXSSAuditorEnabledForTestRunner()
https://bugs.webkit.org/show_bug.cgi?id=165408
Reviewed by Alex Christensen.
InjectedBundle::overrideXSSAuditorEnabledForTestRunner() is unused. This function was only
called by WKBundleOverrideXSSAuditorEnabledForTestRunner(), which was removed in r106005.
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideXSSAuditorEnabledForTestRunner): Deleted.
* WebProcess/InjectedBundle/InjectedBundle.h:
2016-12-04 Darin Adler <darin@apple.com>
Use ASCIICType more, and improve it a little bit
https://bugs.webkit.org/show_bug.cgi?id=165360
Reviewed by Sam Weinig.
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
2016-12-06 Dave Hyatt <hyatt@apple.com>
[CSS Parser] Turn on the new CSS parser
https://bugs.webkit.org/show_bug.cgi?id=165213
Reviewed by Zalan Bujtas.
* Shared/WebPreferencesDefinitions.h:
2016-12-06 Tomas Popela <tpopela@redhat.com>
[GTK] Process accelerated compositing env variables only if they are really enabled
https://bugs.webkit.org/show_bug.cgi?id=165300
Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
(eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).
Reviewed by Michael Catanzaro.
* UIProcess/gtk/WebPreferencesGtk.cpp:
(WebKit::WebPreferences::platformInitializeStore):
2016-12-06 Sam Weinig <sam@webkit.org>
[WebIDL] Add support for converting dictionaries to JS
https://bugs.webkit.org/show_bug.cgi?id=165367
Reviewed by Darin Adler and Alex Christensen.
* CMakeLists.txt:
Add missing directories to look in for headers.
2016-12-05 Tim Horton <timothy_horton@apple.com>
Try to fix the iOS Simulator build.
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
2016-12-03 Simon Fraser <simon.fraser@apple.com>
Minor reformat and renames in -didUpdateVisibleRect:
https://bugs.webkit.org/show_bug.cgi?id=165365
Reviewed by Dave Hyatt.
didUpdateVisibleRect:... has lots of parameters. Put one on each line.
Rename the rects to make it clear they are "content" rects (i.e. in document coordinates).
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2016-12-05 Tim Horton <timothy_horton@apple.com>
Adopt CAMachPort-as-layer-contents
https://bugs.webkit.org/show_bug.cgi?id=141687
<rdar://problem/19393233>
Reviewed by Darin Adler.
* Shared/mac/RemoteLayerBackingStore.h:
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::decode):
On the UI process side, instead of actually looking up the surface,
just keep the MachSendRight around, to later be turned into a CAMachPort.
(WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
Make a CAMachPort and leak our send right into it. CAMachPort
will adopt the port and destroy it when needed.
(WebKit::RemoteLayerBackingStore::setBufferVolatility):
Tiny style fix.
* Shared/mac/RemoteLayerTreePropertyApplier.h:
* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::applyPropertiesToLayer):
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::prepareForAppSuspension):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::prepareForAppSuspension):
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
(WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
Two supporting changes in order to fix the two regressions that this
caused when we tried to land it two years ago:
When an app is being suspended, resolve all CAMachPort backing store
into actual IOSurfaces. Otherwise, any live CAMachPorts will keep a
+1 on their respective IOSurface's use count, causing us to fail to
mark them volatile, keeping the app alive for more time (re-trying the
volatility change), and increasing the likelihood of background jetsam.
If the debugging tile map is enabled, do not use CAMachPort, because
we don't have a great way to plumb the same CAMachPort to two layers
(and it doesn't seem to work even if you do). Instead, just map the
IOSurface into the UI process like we used to.
2016-12-05 Dean Jackson <dino@apple.com>
pointer lock needs to be feature detectable
https://bugs.webkit.org/show_bug.cgi?id=165426
<rdar://problem/29486715>
Reviewed by Antoine Quint.
Set the RuntimeEnabledFeature as preferences
change.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPointerLockEnabled):
(WKPreferencesGetPointerLockEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-12-05 Andreas Kling <akling@apple.com>
[Cocoa] Add some memory usage related information to sysdiagnose state dumps
<https://webkit.org/b/165375>
<rdar://problem/29057243>
Reviewed by Darin Adler.
Add two new entries to the sysdiagnose state dumps for WebContent processes:
"Memory Usage Stats" and "JavaScript Object Counts".
The first category contains all the interesting stuff from task_info()
along with some WebCore and JavaScriptCore object/memory counters.
The second category contains a list of all the JS object types currently live
on the heap, along with a count.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::registerWithStateDumper): Add two new entries to the
state dictionary: "Memory Usage Stats" and "JavaScript Object Counts".
2016-12-05 Csaba Osztrogonác <ossy@webkit.org>
Unreviewed cmake buildfix after r209307.
* PlatformMac.cmake:
2016-12-03 Dan Bernstein <mitz@apple.com>
[Cocoa] Expose InjectedBundlePageEditorClient via the Objective-C bundle SPI
https://bugs.webkit.org/show_bug.cgi?id=165276
<rdar://problem/29467040>
Reviewed by Darin Adler.
Test: TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegate.mm
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject): Wrap InjectedBundleRangeHandle in WKWebProcessPlugInRangeHandle.
* WebKit2.xcodeproj/project.pbxproj: Added references to new files, making
WKWebProcessPlugInEditingDelegate.h and WKWebProcessPlugInRangeHandle.h private headers.
* WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: Added. An base class
based on InjectedBundlePageEditorClient.
(API::InjectedBundle::EditorClient::~EditorClient):
(API::InjectedBundle::EditorClient::shouldBeginEditing):
(API::InjectedBundle::EditorClient::shouldEndEditing):
(API::InjectedBundle::EditorClient::shouldInsertNode):
(API::InjectedBundle::EditorClient::shouldInsertText):
(API::InjectedBundle::EditorClient::shouldDeleteRange):
(API::InjectedBundle::EditorClient::shouldChangeSelectedRange):
(API::InjectedBundle::EditorClient::shouldApplyStyle):
(API::InjectedBundle::EditorClient::didBeginEditing):
(API::InjectedBundle::EditorClient::didEndEditing):
(API::InjectedBundle::EditorClient::didChange):
(API::InjectedBundle::EditorClient::didChangeSelection):
(API::InjectedBundle::EditorClient::willWriteToPasteboard):
(API::InjectedBundle::EditorClient::getPasteboardDataForRange):
(API::InjectedBundle::EditorClient::didWriteToPasteboard):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Added. Declares
the new delegate protocol, currently comprising three methods corresponding to
willWriteToPasteboard, getPasteboardDataForRange, and didWriteToPasteboard.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
(-[WKWebProcessPlugInFrame jsRangeForRangeHandle:inWorld:]): Added. Gets the JS wrapper for
the specified range handle.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: Added.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm: Added.
(-[WKWebProcessPlugInRangeHandle dealloc]): Call the InjectedBundleRangeHandle destructor.
(+[WKWebProcessPlugInRangeHandle rangeHandleWithJSValue:inContext:]): Get or create an
InjectedBundleRangeHandle for the specified object.
(-[WKWebProcessPlugInRangeHandle frame]): Return the range’s owner document’s frame.
(-[WKWebProcessPlugInRangeHandle _rangeHandle]): Return the InjectedBundleRangeHandle.
(-[WKWebProcessPlugInRangeHandle _apiObject]): Ditto.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h: Added.
(WebKit::wrapper):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetEditorClient): Updated for WebPage change.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _editingDelegate]): Added. Returns the
delegate.
(-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Added. Defines a
Client class, which derives from API::InjectedBundle::EditorClient, and invokes the
delegate methods. Instantiates a Client and sets it on the WebPage.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
Declared new _editingDelegate property.
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::document): Added. Returns an InjectedBundleNodeHandle
for the range’s owner document.
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
(WebKit::InjectedBundlePageEditorClient::InjectedBundlePageEditorClient): Added. Calls
initialize().
(WebKit::InjectedBundlePageEditorClient::shouldBeginEditing): Updated for type change.
(WebKit::InjectedBundlePageEditorClient::shouldEndEditing): Ditto.
(WebKit::InjectedBundlePageEditorClient::shouldInsertNode): Ditto.
(WebKit::InjectedBundlePageEditorClient::shouldInsertText): Ditto.
(WebKit::InjectedBundlePageEditorClient::shouldDeleteRange): Ditto.
(WebKit::InjectedBundlePageEditorClient::shouldChangeSelectedRange): Ditto.
(WebKit::InjectedBundlePageEditorClient::shouldApplyStyle): Ditto.
(WebKit::InjectedBundlePageEditorClient::didBeginEditing): Ditto.
(WebKit::InjectedBundlePageEditorClient::didEndEditing): Ditto.
(WebKit::InjectedBundlePageEditorClient::didChange): Ditto.
(WebKit::InjectedBundlePageEditorClient::didChangeSelection): Ditto.
(WebKit::InjectedBundlePageEditorClient::willWriteToPasteboard): Ditto.
(WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): Ditto.
(WebKit::InjectedBundlePageEditorClient::didWriteToPasteboard): Ditto.
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: Now derives from
API::InjectedBundle::EditorClient.
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::shouldDeleteRange): Ditto.
(WebKit::WebEditorClient::shouldBeginEditing): Ditto.
(WebKit::WebEditorClient::shouldEndEditing): Ditto.
(WebKit::WebEditorClient::shouldInsertNode): Ditto.
(WebKit::WebEditorClient::shouldInsertText): Ditto.
(WebKit::WebEditorClient::shouldChangeSelectedRange): Ditto.
(WebKit::WebEditorClient::shouldApplyStyle): Ditto.
(WebKit::WebEditorClient::didBeginEditing): Ditto.
(WebKit::WebEditorClient::respondToChangedContents): Ditto.
(WebKit::WebEditorClient::respondToChangedSelection): Ditto.
(WebKit::WebEditorClient::didEndEditing): Ditto.
(WebKit::WebEditorClient::didWriteSelectionToPasteboard): Ditto.
(WebKit::WebEditorClient::willWriteSelectionToPasteboard): Ditto.
(WebKit::WebEditorClient::getClientPasteboardDataForRange): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Initialize m_editorClient.
(WebKit::WebPage::setInjectedBundleEditorClient): Replaces
initializeInjectedBundleEditorClient and just sets m_editorClient.
(WebKit::WebPage::close): Resets m_editorClient.
* WebProcess/WebPage/WebPage.h: Changed m_editorClient to a unique_ptr.
2016-12-02 Said Abou-Hallawa <sabouhallawa@apple.com>
[iOS] Add a WebView private configuration for changing the WebContent update frequency
https://bugs.webkit.org/show_bug.cgi?id=165289
<rdar://problem/29472577>
Reviewed by Tim Horton.
Expose a preference which allows us to control the fps of web content updates.
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::contentUpdateFrequency):
(API::PageConfiguration::setContentUpdateFrequency):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _contentUpdateFrequency]):
(-[WKWebViewConfiguration _setContentUpdateFrequency:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
(WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency):
2016-12-02 Andy Estes <aestes@apple.com>
[Cocoa] Adopt the PRODUCT_BUNDLE_IDENTIFIER build setting
https://bugs.webkit.org/show_bug.cgi?id=164492
Reviewed by Dan Bernstein.
* Configurations/DatabaseService.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
$(PRODUCT_NAME).
* Configurations/NetworkService.xcconfig: Ditto.
* Configurations/PluginService.32.xcconfig: Ditto.
* Configurations/PluginService.64.xcconfig: Ditto.
* Configurations/WebContentService.xcconfig: Ditto.
* Configurations/WebKit.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
com.apple.$(PRODUCT_NAME:rfc1034identifier).
* DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist: Changed
CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}.
* Info.plist: Changed CFBundleIdentifier's value from com.apple.${PRODUCT_NAME} to
${PRODUCT_BUNDLE_IDENTIFIER}.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Changed
CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: Ditto.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist: Ditto.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Ditto.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Ditto.
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Ditto.
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Ditto.
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Ditto.
2016-12-02 Brent Fulgham <bfulgham@apple.com>
[Mac] Update sandbox profiles to use modern syntax and avoid duplication
https://bugs.webkit.org/show_bug.cgi?id=165332
<rdar://problem/26898991>
Reviewed by Anders Carlsson.
Update the Mac sandbox profiles to reflect that modern Cocoa applications
communicate with cfprefsd, rather than plists on disk (and have done so
for the past several releases).
Get rid of some duplicated rules, as well as old compatibility rules that
are never triggered under supported operating systems.
* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2016-12-02 Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
Fix build break when disabling some features.
https://bugs.webkit.org/show_bug.cgi?id=165254
The EFL port was broken if SPELLCHECK was disabled or
PLUGIN_ARCHITECTURE is not x11.
Reviewed by Michael Catanzaro.
* UIProcess/efl/TextCheckerEfl.cpp:
(WebKit::TextChecker::checkTextOfParagraph):
(WebKit::TextChecker::checkSpellingOfString):
Fix UNUSED_PARAM() usage if SPELLCHECK is disabled.
* UIProcess/efl/WebPageProxyEfl.cpp:
Isolate methods within #if PLUGIN_ARCHITECTURE(X11).
2016-12-01 Jiewen Tan <jiewen_tan@apple.com>
Add a runtime flag for SubtleCrypto
https://bugs.webkit.org/show_bug.cgi?id=164982
Reviewed by Brent Fulgham.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetSubtleCryptoEnabled):
(WKPreferencesGetSubtleCryptoEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-12-01 Saam Barati <sbarati@apple.com>
Rename CallFrame::callee() to CallFrame::jsCallee()
https://bugs.webkit.org/show_bug.cgi?id=165293
Reviewed by Keith Miller.
* WebProcess/Plugins/Netscape/JSNPMethod.cpp:
(WebKit::callMethod):
* WebProcess/Plugins/Netscape/JSNPObject.cpp:
(WebKit::callNPJSObject):
(WebKit::constructWithConstructor):
2016-12-01 Chris Dumez <cdumez@apple.com>
[iOS][WK2] Tapping an element generates a 'click' event that has 0 as timeStamp
https://bugs.webkit.org/show_bug.cgi?id=165270
<rdar://problem/29224355>
Reviewed by Simon Fraser.
Tapping an element generates a 'click' event that has 0 as timeStamp
instead of having a proper timeStamp value. This is breaking some
sites.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completeSyntheticClick):
2016-12-01 Tim Horton <timothy_horton@apple.com>
Try to fix the EFL/Gtk build
* UIProcess/efl/WebProcessPoolEfl.cpp:
(WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
2016-12-01 Tim Horton <timothy_horton@apple.com>
Every WKWebView initialization spends a few milliseconds hitting the disk
https://bugs.webkit.org/show_bug.cgi?id=165268
<rdar://problem/29010113>
Reviewed by Brady Eidson.
Every WKWebView init currently involves doing directory creation and
symlink resolution for a number of paths (to create sandbox extensions
for all of our storage directories), which means touching the disk a
lot during init. All of these paths are immutable per-WebProcessPool,
so, instead, cache them on WebProcessPool and create sandbox extensions
from the already-resolved paths. This is a sizable (~4x) speedup when
initializing subsequent web views.
* Shared/SandboxExtension.h:
(WebKit::SandboxExtension::createHandleWithoutResolvingPath):
Add createHandleWithoutResolvingPath, which makes a sandbox extension
handle without doing symlink resolution.
(WebKit::resolvePathForSandboxExtension):
(WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
Add two functions that do the same resolution that SandboxExtension::createHandle
and ::createHandleForReadWriteDirectory do, but just return the paths,
for later use with createHandleWithoutResolvingPath.
* Shared/mac/SandboxExtensionMac.mm:
(WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
(WebKit::resolvePathForSandboxExtension):
(WebKit::SandboxExtension::createHandleWithoutResolvingPath):
(WebKit::SandboxExtension::createHandle):
(WebKit::SandboxExtension::createHandleForReadWriteDirectory):
Implement the aforementioned functions, and reimplement the existing
createHandle{ForReadWriteDirectory} functions in terms of them.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformDefaultIconDatabasePath):
Stop wasting time generating and resolving a platform default icon
database path, since we don't actually use it for anything anymore except
to determine whether the icon database is enabled, and we only want to
enable it if the client has provided a path.
(WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::m_hiddenPageThrottlingTimer):
(WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
(WebKit::WebProcessPool::createNewWebProcess):
* UIProcess/WebProcessPool.h:
Resolve paths in resolvePathsForSandboxExtensions, and use the resolved
paths along with createHandleWithoutResolvingPath in order to effectively
cache the resolution operation.
2016-12-01 Antti Koivisto <antti@apple.com>
Revert r208931
https://bugs.webkit.org/show_bug.cgi?id=164924
PLT regression.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeCacheKey):
(WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::BlobStorage):
(WebKit::NetworkCache::BlobStorage::add):
(WebKit::NetworkCache::BlobStorage::get):
* NetworkProcess/cache/NetworkCacheBlobStorage.h:
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::computeSHA1):
(WebKit::NetworkCache::makeSalt): Deleted.
(WebKit::NetworkCache::readOrMakeSalt): Deleted.
* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::noPartitionString):
(WebKit::NetworkCache::Key::Key):
(WebKit::NetworkCache::Key::hasPartition):
(WebKit::NetworkCache::Key::computeHash):
(WebKit::NetworkCache::Key::hashAsString):
(WebKit::NetworkCache::Key::computePartitionHash): Deleted.
* NetworkProcess/cache/NetworkCacheKey.h:
(WebKit::NetworkCache::Key::hash):
(WebKit::NetworkCache::Key::partitionHash): Deleted.
(WebKit::NetworkCache::Key::hashAsString): Deleted.
(WebKit::NetworkCache::Key::partitionHashAsString): Deleted.
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::makeSubresourcesKey):
(WebKit::NetworkCache::constructRevalidationRequest):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::open):
(WebKit::NetworkCache::traverseRecordsFiles):
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
(WebKit::NetworkCache::decodeRecordHeader):
(WebKit::NetworkCache::Storage::readRecord):
(WebKit::NetworkCache::Storage::encodeRecord):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::makeSaltFilePath): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::salt): Deleted.
2016-11-30 Sam Weinig <sam@webkit.org>
[WebIDL] Remove custom bindings for File and Blob constructors
https://bugs.webkit.org/show_bug.cgi?id=165218
Reviewed by Darin Adler.
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURL):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:
Avoid copies of the BlobPart Vector.
2016-11-30 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
https://bugs.webkit.org/show_bug.cgi?id=164911
Reviewed by Michael Catanzaro.
The problem is that m_buffer is nullptr in Surface::prepareTextureForPainting() even though we have already an
image. We only use the buffer to get the image size, so we could save the image size when the image is created,
and then we don't need to care about the buffer anymore.
* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::Surface::prepareTextureForPainting):
(WebKit::WaylandCompositor::Surface::commit):
* UIProcess/gtk/WaylandCompositor.h:
2016-11-30 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Add an HTML comment flag to turn the feature on
https://bugs.webkit.org/show_bug.cgi?id=165226
Reviewed by Dean Jackson.
Add new methods to set the Modern Media Controls preference.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetModernMediaControlsEnabled):
(WKPreferencesGetModernMediaControlsEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
2016-11-30 Said Abou-Hallawa <sabouhallawa@apple.com>
Add separate settings and preferences to enable/disable async decoding for large images and animated images
https://bugs.webkit.org/show_bug.cgi?id=165177
Reviewed by Simon Fraser.
Hook up the async image decoding settings for WebKit2.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _largeImageAsyncDecodingEnabled]):
(-[WKPreferences _setLargeImageAsyncDecodingEnabled:]):
(-[WKPreferences _animatedImageAsyncDecodingEnabled]):
(-[WKPreferences _setAnimatedImageAsyncDecodingEnabled:]):
(-[WKPreferences _asyncImageDecodingEnabled]): Deleted.
(-[WKPreferences _setAsyncImageDecodingEnabled:]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-11-30 Chris Dumez <cdumez@apple.com>
[iOS][WK2] Turn on HTML interactive form validation feature
https://bugs.webkit.org/show_bug.cgi?id=165212
<rdar://problem/29444356>
Reviewed by Simon Fraser.
Turn on HTML interactive form validation feature on iOS WK2
now that we have a native UI.
* Shared/WebPreferencesDefinitions.h:
2016-11-30 Brent Fulgham <bfulgham@apple.com>
Correct plugin sandbox after r208611
https://bugs.webkit.org/show_bug.cgi?id=165187
<rdar://problem/29431165>
Reviewed by Alex Christensen.
In r208611 I removed the 'else' clause of a Scheme conditional
that was needed to properly run plugins (such as Flash Player).
This change retains the relevant current sandbox content, while
still stripping out the old code that is no longer needed.
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2016-11-29 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Database process should not initialize gtk
https://bugs.webkit.org/show_bug.cgi?id=165138
Reviewed by Sergio Villar Senin.
It doesn't use GTK+ at all.
* DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp:
(WebKit::DatabaseProcessMainUnix):
(): Deleted.
2016-11-29 Gavin Barraclough <barraclough@apple.com>
Remove WebPage::SetPageSuppressed
https://bugs.webkit.org/show_bug.cgi?id=165158
Unreviewed revert accidental change.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setActivityState):
2016-11-29 Gavin Barraclough <barraclough@apple.com>
Remove WebPage::SetPageSuppressed
https://bugs.webkit.org/show_bug.cgi?id=165158
Reviewed by Tim Horton.
This was scaffolding. We've now refactored to the point that the information driving throttling originates
from the UI process (so UI and web processes can have a consistent view of what should throttle), but we
don't need a separate message to handle this - necessary state to determine is provided in ActivityState.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateThrottleState):
- used to send SetPageSuppressed; no longer does.
* UIProcess/WebPageProxy.h:
- removed m_pageSuppressed (was used to avoid duplicated messages).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateThrottleState):
- compute throttle state based on m_activityState.
(WebKit::WebPage::setActivityState):
- update throttle state whenever activity state changes.
(WebKit::WebPage::updatePreferences):
- update throttle state whenever preferences change (throttling can be disabled via preference).
(WebKit::WebPage::setPageSuppressed): Deleted.
- Removed WebPage::SetPageSuppressed.
* WebProcess/WebPage/WebPage.h:
- Removed WebPage::SetPageSuppressed.
- Added m_processSuppressionEnabled, to cache preference state.
* WebProcess/WebPage/WebPage.messages.in:
- Removed WebPage::SetPageSuppressed.
2016-11-29 Andy Estes <aestes@apple.com>
[Cocoa] Enable two clang warnings recommended by Xcode
https://bugs.webkit.org/show_bug.cgi?id=164498
Reviewed by Mark Lam.
* Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.
2016-11-29 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context
https://bugs.webkit.org/show_bug.cgi?id=164760
<rdar://problem/29261266>
Reviewed by Youenn Fablet.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::FrameAuthorizationState::FrameAuthorizationState):
(WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice):
(WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice):
(WebKit::FrameAuthorizationState::reset):
(WebKit::FrameAuthorizationState::securityOriginsAreEqual):
(WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
(WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
(WebKit::FrameAuthorizationState::~FrameAuthorizationState):
(WebKit::FrameAuthorizationState::frameID):
* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::create):
(WebKit::UserMediaPermissionRequestProxy::frameID):
(WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
(WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps):
2016-11-29 Wenson Hsieh <wenson_hsieh@apple.com>
Scroll snapping on Mac should use AppKit animations
https://bugs.webkit.org/show_bug.cgi?id=147261
<rdar://problem/29395293>
Reviewed by Brent Fulgham.
Add some logic to plumb filtered wheel velocity over to WebCore in the case of mainframe scrolling. See
WebCore/ChangeLog for more details.
* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::wheelEvent):
2016-11-21 Brian Burg <bburg@apple.com>
Web Automation: add ObjC SPI to set whether a page is controlled by automation
https://bugs.webkit.org/show_bug.cgi?id=165001
<rdar://problem/29350432>
Reviewed by Dan Bernstein.
Add SPI property to WKWebViewConfiguration and plumb it through to
initialize WebPageProxy::m_controlledByAutomation. This is propagated
to the WebProcess on creation via WebPageCreationParameters.
* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::copy):
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::isControlledByAutomation):
(API::PageConfiguration::setControlledByAutomation):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _isControlledByAutomation]):
(-[WKWebViewConfiguration _setControlledByAutomation:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
2016-11-28 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
https://bugs.webkit.org/show_bug.cgi?id=164303
Reviewed by Michael Catanzaro.
Trap also BadDrawable and BadDamage X errors when creating the surface and damage.
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
(WebKit::AcceleratedBackingStoreX11::update):
2016-11-28 Chris Dumez <cdumez@apple.com>
[Mac][WK2] Enable HTML interactive form validation
https://bugs.webkit.org/show_bug.cgi?id=165123
<rdar://problem/28944652>
Reviewed by Simon Fraser.
Enable HTML interactive form validation now that we have a native UI
for it.
* Shared/WebPreferencesDefinitions.h:
2016-11-28 Brent Fulgham <bfulgham@apple.com>
Generated sandbox profile is not being put in the correct Resources directory
https://bugs.webkit.org/show_bug.cgi?id=165126
Reviewed by Tim Horton.
* WebKit2.xcodeproj/project.pbxproj: Copy the generated file to the 'PlugInSandboxProfiles'
sub-directory.
2016-11-28 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r209008.
This change appears to have caused two fast/mediastrem
LayoutTests to fail.
Reverted changeset:
"[MediaStream] Don't request user permission for a device if
it has already been granted in the current browsing context"
https://bugs.webkit.org/show_bug.cgi?id=164760
http://trac.webkit.org/changeset/209008
2016-11-28 Andrew Gold <agold@apple.com>
Support for HTML Media Capture API
https://bugs.webkit.org/show_bug.cgi?id=43239
Reviewed by Tim Horton.
In order to enable media capture on iOS, we must first use the AVFoundation API to
check/request capture permission from the user for Safari. Then, Safari must request
permission on behalf of the webpage to use the capture devices. Additionally, Safari
must present UI when the capture is taking place, so WebKit needs to notify the client
of a capture session beginning and ending. To do this, we added four methods to
WKUIDelegatePrivate to request permission from the user, check for permissions, notify
that a capture session has begun, and notify that a capture session has ended. Additionally,
we added a private method to WKWebView that allows the client to stop a capture session.
* UIProcess/API/APIUIClient.h:
(API::UIClient::didBeginCaptureSession): Notifies the client of a capture session beginning.
(API::UIClient::didEndCaptureSession): Notifies the client of a capture session ending.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added new delegate methods to request permission,
check for permission, notify of a capture session beginning, and notify of a capture session
ending.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _stopMediaCapture]): Cancels a media capture session.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate): Added the new delegate methods.
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
First checks if the user has authorized the client application access capture devices,
then uses the WKUIDelegate to request permission for a site from the user.
(WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): Checks the client
for permission to access capture devices.
(WebKit::UIDelegate::UIClient::didBeginCaptureSession): Notifies the client of a capture
session beginning.
(WebKit::UIDelegate::UIClient::didEndCaptureSession): Notifies the client of a capture
session ending.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange): Calls UIDelegate method to notify the
client of a capture session beginning/ending.
2016-11-28 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context
https://bugs.webkit.org/show_bug.cgi?id=164760
<rdar://problem/29261266>
Reviewed by Youenn Fablet.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::FrameAuthorizationState::FrameAuthorizationState):
(WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice):
(WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice):
(WebKit::FrameAuthorizationState::reset):
(WebKit::FrameAuthorizationState::securityOriginsAreEqual):
(WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
(WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
(WebKit::FrameAuthorizationState::~FrameAuthorizationState):
(WebKit::FrameAuthorizationState::frameID):
* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::create):
(WebKit::UserMediaPermissionRequestProxy::frameID):
(WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
(WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps):
2016-11-27 Dean Jackson <dino@apple.com>
Removed a WTFLogAlways I left in with a recent commit.
* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKAccessibilitySettingsObserver _settingsDidChange:]):
2016-11-27 Csaba Osztrogonác <ossy@webkit.org>
Fix unused-private-field build warning in WebKit2/Platform/SharedMemory.h
https://bugs.webkit.org/show_bug.cgi?id=165069
Reviewed by Darin Adler.
* Platform/SharedMemory.h:
2016-11-26 Simon Fraser <simon.fraser@apple.com>
Fix the iOS build.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::eventThrottlingDelay):
2016-11-26 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Import std::optional reference implementation as WTF::Optional
https://bugs.webkit.org/show_bug.cgi?id=164199
Reviewed by Saam Barati and Sam Weinig.
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::didReceiveResponse):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::responseHasExpired):
* NetworkProcess/cache/NetworkCacheCoders.h:
(WebKit::NetworkCache::Coder<std::optional<T>>::encode):
(WebKit::NetworkCache::Coder<std::optional<T>>::decode):
(WebKit::NetworkCache::Coder<Optional<T>>::encode): Deleted.
(WebKit::NetworkCache::Coder<Optional<T>>::decode): Deleted.
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::readOrMakeSalt):
* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
(WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
(WebKit::NetworkCache::Statistics::recordRetrievalFailure):
(WebKit::NetworkCache::Statistics::queryWasEverRequested):
* NetworkProcess/cache/NetworkCacheStatistics.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::storeBodyAsBlob):
(WebKit::NetworkCache::Storage::encodeRecord):
(WebKit::NetworkCache::Storage::dispatchWriteOperation):
* NetworkProcess/cache/NetworkCacheStorage.h:
* Platform/IPC/ArgumentCoders.h:
(IPC::ArgumentCoder<std::optional<T>>::encode):
(IPC::ArgumentCoder<std::optional<T>>::decode):
(IPC::ArgumentCoder<WTF::Optional<T>>::encode): Deleted.
(IPC::ArgumentCoder<WTF::Optional<T>>::decode): Deleted.
* Platform/IPC/Connection.h:
(IPC::Connection::sendWithReply):
* Platform/SharedMemory.h:
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::map):
* Scripts/webkit/messages.py:
(class_template_headers):
* Shared/API/APISecurityOrigin.h:
(API::SecurityOrigin::create):
* Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginGetPort):
* Shared/SessionState.h:
* Shared/WebPageCreationParameters.h:
* Shared/mac/ObjCObjectGraph.mm:
(WebKit::typeFromObject):
* Shared/mac/SecItemShim.cpp:
(WebKit::sendSecItemRequest):
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerGetStorageDetailsByOrigin):
* UIProcess/API/Cocoa/WKSecurityOrigin.mm:
(-[WKSecurityOrigin port]):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _navigationGestureDidEnd]):
* UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
(WebKit::toWebsiteDataType):
* UIProcess/API/efl/EwkView.cpp:
(EwkView::setCursor):
* UIProcess/API/mac/WKView.mm:
(toCoreScrollbarStyle):
(toAPIScrollbarStyle):
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKPaymentSummaryItem):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::webFrameIDForHandle):
(WebKit::WebAutomationSession::switchToBrowsingContext):
(WebKit::WebAutomationSession::evaluateJavaScriptFunction):
(WebKit::WebAutomationSession::resolveChildFrameHandle):
(WebKit::WebAutomationSession::resolveParentFrameHandle):
(WebKit::WebAutomationSession::computeElementLayout):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateViewExposedRect):
(WebKit::WebViewImpl::setOverlayScrollbarStyle):
(WebKit::WebViewImpl::overlayScrollbarStyle):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::setViewExposedRect):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::viewExposedRect):
* UIProcess/InspectorServer/WebSocketServerConnection.cpp:
(WebKit::WebSocketServerConnection::didReceiveSocketStreamData):
* UIProcess/InspectorServer/WebSocketServerConnection.h:
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingTree.h:
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::fileCreationTime):
(WebKit::fileModificationTime):
* UIProcess/Storage/LocalStorageDatabaseTracker.h:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::backForwardListState):
(WebKit::WebBackForwardList::restoreFromState):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::setOverlayScrollbarStyle):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::overlayScrollbarStyle):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebsiteData/WebsiteDataRecord.h:
* UIProcess/efl/WebView.cpp:
(WebKit::WebView::transformFromScene):
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
* UIProcess/gtk/WebPreferencesGtk.cpp:
(WebKit::WebPreferences::platformInitializeStore):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _scrollOffsetForEvent:]):
(-[WKContentView _interpretKeyEvent:isCharEvent:]):
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::encodeFormDataElement):
(WebKit::decodeFormDataElement):
(WebKit::decodeV1SessionHistory):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect):
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinator::completeShippingContactSelection):
(WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
* WebProcess/ApplePay/WebPaymentCoordinator.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetEventThrottlingBehaviorOverride):
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::convertFromPDFViewToRootView):
(WebKit::PDFPlugin::convertFromPDFViewToScreen):
(WebKit::PDFPlugin::boundsOnScreen):
(WebKit::PDFPlugin::geometryDidChange):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::geometryDidChange):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performFrameLoadURLRequest):
(WebKit::PluginView::evaluate):
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::pluginLoadClientPolicyForHost):
* WebProcess/Plugins/WebPluginInfoProvider.h:
* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFormData):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::certificateInfo):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
(WebKit::WebPage::setScrollbarOverlayStyle):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::scrollbarOverlayStyle):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
2016-11-26 Sam Weinig <sam@webkit.org>
Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
https://bugs.webkit.org/show_bug.cgi?id=164965
Reviewed by Simon Fraser.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetIntersectionObserverEnabled):
(WKPreferencesGetIntersectionObserverEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Add a preference, defaulting to off, for enabling IntersectionObserver.
2016-11-26 Simon Fraser <simon.fraser@apple.com>
Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
https://bugs.webkit.org/show_bug.cgi?id=164992
Reviewed by Darin Adler.
No more ugly conversion from seconds to milliseconds.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::eventThrottlingDelay):
2016-11-25 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Follow-up fixes to r208974
https://bugs.webkit.org/show_bug.cgi?id=164771
Unreviewed, implement Carlos's review feedback.
* UIProcess/API/gtk/WebKitNotification.cpp:
(webkit_notification_get_tag):
* UIProcess/API/gtk/WebKitNotificationProvider.cpp:
(WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
(WebKitNotificationProvider::show):
* UIProcess/API/gtk/WebKitNotificationProvider.h:
2016-11-24 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Notifications API does not expose or respect the "tag" attribute
https://bugs.webkit.org/show_bug.cgi?id=164771
Reviewed by Gustavo Noronha Silva.
Expose a tag property on WebKitNotification. Ensure that any previous notification with the
same tag is closed when showing a new notification with that tag.
* UIProcess/API/gtk/WebKitNotification.cpp:
(webkit_notification_class_init):
(webkitNotificationCreate):
(webkit_notification_get_tag):
* UIProcess/API/gtk/WebKitNotification.h:
* UIProcess/API/gtk/WebKitNotificationProvider.cpp:
(WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
(WebKitNotificationProvider::show):
* UIProcess/API/gtk/WebKitNotificationProvider.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2016-11-22 Sergio Villar Senin <svillar@igalia.com>
[GTK] Fix introspection warning
https://bugs.webkit.org/show_bug.cgi?id=165026
Reviewed by Michael Catanzaro.
This fixes an introspection annotation for a new API added in r208532.
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(webkit_web_page_class_init):
2016-11-21 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Simplify custom protocols handler implementation
https://bugs.webkit.org/show_bug.cgi?id=164922
Reviewed by Michael Catanzaro.
We are using too many classes for this and also the C API that is not needed, because both GTK+ and EFL have
their own APIs and this is not used by WTR at all.
* PlatformEfl.cmake: Remove files from compilation.
* PlatformGTK.cmake: Ditto.
* Shared/API/c/WKBase.h:
* Shared/API/c/soup/WKBaseSoup.h: Removed.
* UIProcess/API/APICustomProtocolManagerClient.h: Added.
(API::CustomProtocolManagerClient::~CustomProtocolManagerClient):
(API::CustomProtocolManagerClient::startLoading):
(API::CustomProtocolManagerClient::stopLoading):
(API::CustomProtocolManagerClient::invalidate):
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/soup/WKAPICastSoup.h: Removed.
* UIProcess/API/C/soup/WKContextSoup.h: Removed.
* UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: Removed.
* UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: Removed.
* UIProcess/API/C/soup/WKSoupRequestManager.h: Removed.
* UIProcess/API/efl/ewk_context.cpp: Remove unneeded include.
* UIProcess/API/efl/ewk_url_scheme_request.cpp: Use CustomProtocolManagerProxy instead of WKSoupCustomProtocolRequestManagerRef.
(EwkUrlSchemeRequest::EwkUrlSchemeRequest):
(EwkUrlSchemeRequest::finish):
(EwkUrlSchemeRequest::invalidate):
* UIProcess/API/efl/ewk_url_scheme_request_private.h:
(EwkUrlSchemeRequest::create):
(EwkUrlSchemeRequest::manager):
* UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp: Added.
(attachCustomProtocolManagerClientToContext):
* UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h.
* UIProcess/API/gtk/WebKitPrivate.h:
* UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Removed.
* UIProcess/API/gtk/WebKitRequestManagerClient.h: Removed.
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Use CustomProtocolManagerProxy instead of WebSoupCustomProtocolRequestManager.
(webkitURISchemeRequestCreate):
(webkitURISchemeRequestCancel):
(webkitURISchemeRequestGetManager):
(webkitURISchemeRequestInvalidate):
(webkitURISchemeRequestReadCallback):
(webkit_uri_scheme_request_finish_error):
* UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkitWebContextDispose):
(webkit_web_context_register_uri_scheme):
(webkitWebContextStartLoadingCustomProtocol):
(webkitWebContextInvalidateCustomProtocolRequests):
* UIProcess/API/gtk/WebKitWebContextPrivate.h:
* UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
* UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
(WebKit::CustomProtocolManagerProxy::processDidClose):
* UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
(WebKit::CustomProtocolManagerProxy::processDidClose): Invalidate the client.
(WebKit::CustomProtocolManagerProxy::startLoading): Notify the client.
(WebKit::CustomProtocolManagerProxy::stopLoading): Ditto.
(WebKit::CustomProtocolManagerProxy::didReceiveResponse): Notify the network process.
(WebKit::CustomProtocolManagerProxy::didLoadData): Ditto.
(WebKit::CustomProtocolManagerProxy::didFailWithError): Ditto.
(WebKit::CustomProtocolManagerProxy::didFinishLoading): Ditto.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: Removed.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: Removed.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: Removed.
* UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: Removed.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose): Notify the CustomProtocolManagerProxy.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool): Initialize the CustomProtocolManagerClient and remove the all supplement.
(WebKit::WebProcessPool::setCustomProtocolManagerClient):
(WebKit::WebProcessPool::registerSchemeForCustomProtocol): In case of soup cache the given protocol.
(WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): In case of soup delete the given protocol from the cache.
* UIProcess/WebProcessPool.h:
* UIProcess/efl/RequestManagerClientEfl.cpp: Do not use the C API, but API::CustomProtocolManagerClient.
(WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
(WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
* UIProcess/efl/RequestManagerClientEfl.h:
* UIProcess/efl/WebProcessPoolEfl.cpp:
* UIProcess/gtk/WebProcessPoolGtk.cpp:
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Use m_urlSchemesRegisteredForCustomProtocols to
build the list of custom protocols to send to the network process.
2016-11-21 Alex Christensen <achristensen@webkit.org>
Fix Sierra CMake build after r208452
https://bugs.webkit.org/show_bug.cgi?id=164437
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateMediaTouchBar):
I haven't enabled VIDEO_PRESENTATION_MODE in the CMake build yet.
It's needed for WebPlaybackSessionInterfaceMac to exist.
2016-11-21 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.2 release.
* gtk/NEWS: Add release notes for 2.15.2.
2016-11-21 Carlos Garcia Campos <cgarcia@igalia.com>
Remove m_customProtocolManagerProxy from WebProcessProxy
https://bugs.webkit.org/show_bug.cgi?id=164908
Reviewed by Andreas Kling.
Since the network process is mandatory, the custom protocol manager proxy of WebProcessProxy is unused and can
be removed.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
* UIProcess/WebProcessProxy.h:
2016-11-20 Zan Dobersek <zdobersek@igalia.com>
[EncryptedMedia] Make EME API runtime-enabled
https://bugs.webkit.org/show_bug.cgi?id=164927
Reviewed by Jer Noble.
Add the new EncryptedMediaAPI preference. Set the same feature
flag on the shared RuntimeEnabledFeatures object to the
corresponding value that's stored in the WebPreferencesStore.
InjectedBundle::overrideBoolPreferenceForTestRunner() does the
same when the 'WebKitEncryptedMediaAPIEnabled' preference is
overridden in WKTR for testing purposes.
* Shared/WebPreferencesDefinitions.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-11-19 Antti Koivisto <antti@apple.com>
Salt network cache hashes
https://bugs.webkit.org/show_bug.cgi?id=164924
Reviewed by Alex Christensen.
To enhance privacy make cache content unidentifiable from file names alone.
This is done by generating a unique persistent salt for each cache instance.
It is used when computing hashes used in file names.
The patch also replaces plain text partition directory names with salted hashes.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::makeCacheKey):
(WebKit::NetworkCache::makeCacheKey): Deleted.
* NetworkProcess/cache/NetworkCache.h:
Increment cache version.
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::BlobStorage):
(WebKit::NetworkCache::BlobStorage::add):
(WebKit::NetworkCache::BlobStorage::get):
Use salt for blob content hash.
* NetworkProcess/cache/NetworkCacheBlobStorage.h:
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::computeSHA1):
For simplicity all SHA1s are now salted.
(WebKit::NetworkCache::makeSalt):
(WebKit::NetworkCache::readOrMakeSalt):
Read salt if it exists, generate and persist it otherwise.
* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::Key::Key):
Remove the "No partition" string and just empty.
That was only needed to have a directory name of some sort.
(WebKit::NetworkCache::Key::computeHash):
Use salt for key hash.
(WebKit::NetworkCache::Key::computePartitionHash):
Separate hash for partition.
* NetworkProcess/cache/NetworkCacheKey.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::makeSubresourcesKey):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeSaltFilePath):
(WebKit::NetworkCache::Storage::open):
Cache can't be opened if we can't read or persist a salt.
(WebKit::NetworkCache::traverseRecordsFiles):
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
Use the partition hash in the directory name instead of a plain text name.
(WebKit::NetworkCache::decodeRecordHeader):
(WebKit::NetworkCache::Storage::readRecord):
(WebKit::NetworkCache::Storage::encodeRecord):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::salt):
2016-11-19 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing
https://bugs.webkit.org/show_bug.cgi?id=164855
Reviewed by Sam Weinig.
During UI-process panning and zooming, we send visible rect updates to the web process
with inStableState=false, and don't update GraphicsLayers until we get into a stable state.
This causes a problem where the web process has a stale notion of where the GraphicsLayers
for position:fixed elements are, but is then told to update tiling coverage with an up-to-date
visible rect. The existing "sync layer positions" path isn't useful to fix this, because it
breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints
in the scrolling tree.
To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used
only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions
are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to
reconcileViewportConstrainedLayerPositions).
Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingTree.h:
* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::flushPendingLayerChanges):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects): Always push the custom fixed position rect down, but send
ScrollingLayerPositionAction::SetApproximate if the state is not stable.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2016-11-18 Simon Fraser <simon.fraser@apple.com>
Make it possible to test non-stable-state scrolling on iOS
https://bugs.webkit.org/show_bug.cgi?id=164905
Reviewed by Dan Bernstein.
Make it possible for an iOS layout test to force every visible rect update
from the UI process to the web process to be in a non-stable state. This emulates
what happens during panning and zooming interactions, and allows us to test the
scrolling and layer trees in these transient states.
This is done by adding a testing property on WKWebView, _stableStateOverride, whose
getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView
consults the NSNumber's boolValue and uses it to override the stable state.
To facilitate this kind of testing, also add immediateScrollToOffset() and
immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate()
which provides a callback that fires after one trip to the web process and back.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
(-[WKWebView _stableStateOverride]):
(-[WKWebView _setStableStateOverride:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
2016-11-18 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
https://bugs.webkit.org/show_bug.cgi?id=164980
Reviewed by Chris Dumez.
WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
flag that impacts tile coverage.
During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().
Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetEventThrottlingBehaviorOverride):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::eventThrottlingDelay):
2016-11-18 Simon Fraser <simon.fraser@apple.com>
Remove use of std::chrono in WebPage and entrained code
https://bugs.webkit.org/show_bug.cgi?id=164967
Reviewed by Tim Horton.
Replace std::chrono with Seconds and Monotonic Time.
Use more C++11 initialization for WebPage data members.
* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::timestamp):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<MonotonicTime>::encode):
(IPC::ArgumentCoder<MonotonicTime>::decode):
(IPC::ArgumentCoder<Seconds>::encode):
(IPC::ArgumentCoder<Seconds>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/ios/WKContentView.mm:
(WebKit::HistoricalVelocityData::HistoricalVelocityData):
(WebKit::HistoricalVelocityData::velocityForNewData):
(WebKit::HistoricalVelocityData::append):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::eventThrottlingDelay):
* WebProcess/WebPage/ViewUpdateDispatcher.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::m_userActivityHysteresis):
(WebKit::WebPage::didFlushLayerTreeAtTime):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::eventThrottlingDelay):
(WebKit::WebPage::updateVisibleContentRects):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2016-11-18 Dean Jackson <dino@apple.com>
AX: "(inverted-colors)" media query only matches on page reload; should match on change
https://bugs.webkit.org/show_bug.cgi?id=163564
<rdar://problem/28807350>
Reviewed by Simon Fraser.
Listen for the appropriate notifications that accessibility settings
have changed. This is a single notification on macOS, which uses WebViewImpl,
and more fine-grained notifications on iOS, using WKWebView.
When we see the notification, send a message to the WebProcess which will
then tell the WebCore::Page.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _accessibilitySettingsDidChange:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKAccessibilitySettingsObserver initWithImpl:]):
(-[WKAccessibilitySettingsObserver dealloc]):
(-[WKAccessibilitySettingsObserver _settingsDidChange:]):
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::accessibilitySettingsDidChange):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::accessibilitySettingsDidChange):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::accessibilitySettingsDidChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2016-11-18 Jeremy Jones <jeremyj@apple.com>
USE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12))
https://bugs.webkit.org/show_bug.cgi?id=164962
Reviewed by Dean Jackson.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2016-11-18 Enrica Casucci <enrica@apple.com>
Refactor drag and drop for WebKit2 to encode DragData message exchange.
https://bugs.webkit.org/show_bug.cgi?id=164945
Reviewed by Tim Horton.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::performDragControllerAction):
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::willPerformDragDestinationAction):
(WebKit::WebDragClient::actionMaskForDrag):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2016-11-18 Jeremy Jones <jeremyj@apple.com>
Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
https://bugs.webkit.org/show_bug.cgi?id=163801
Reviewed by Simon Fraser.
Add SPI to notify client of pointer lock and for client to allow or deny.
Unlock pointer when view is not longer active.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::requestPointerLock):
(API::UIClient::didLosePointerLock):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
(WKPageDidAllowPointerLock):
(WKPageDidDenyPointerLock):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/API/C/WKPreferences.cpp:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::requestPointerLock):
(WebKit::UIDelegate::UIClient::didLosePointerLock):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::requestPointerLock):
(WebKit::WebPageProxy::didAllowPointerLock):
(WebKit::WebPageProxy::didDenyPointerLock):
(WebKit::WebPageProxy::requestPointerUnlock):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-11-17 Carlos Garcia Campos <cgarcia@igalia.com>
Downloads started by context menu actions should also have a web view associated
https://bugs.webkit.org/show_bug.cgi?id=164364
Reviewed by Michael Catanzaro.
When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to
associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls
WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case.
* UIProcess/API/gtk/WebKitDownload.cpp:
(webkitDownloadCreateForRequest): Deleted.
* UIProcess/API/gtk/WebKitDownloadPrivate.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download()
because the WebKitDownload could have already been created by the web view download handler at this point.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_download_uri): We no longer need to associate the web view to the download here.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify
the page client.
2016-11-17 Alex Christensen <achristensen@webkit.org>
REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=164631
Reviewed by Carlos Garcia Campos.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::convertToDownload):
I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION
by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload. m_networkLoad
was not being set to nullptr before it was being checked in NetworkResourceLoader::abort
2016-11-17 Alex Christensen <achristensen@webkit.org>
Fix CMake build after r208865
https://bugs.webkit.org/show_bug.cgi?id=164894
* PlatformMac.cmake:
Add new files.
2016-11-17 Ryosuke Niwa <rniwa@webkit.org>
WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled
https://bugs.webkit.org/show_bug.cgi?id=164857
<rdar://problem/27721742>
Reviewed by Wenson Hsieh.
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):
2016-11-17 John Wilander <wilander@apple.com>
Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed
https://bugs.webkit.org/show_bug.cgi?id=164659
Reviewed by Andy Estes.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
Consistent naming with 'remove' rather than 'delete'.
Now removes localStorage, IndexDB, disk cache, and memory cache too.
Updates statistics with number of times it has removed data records.
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
No longer checks whether it has enough data since the classification rules
are absolute, not relative.
(WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:
Consistent naming with 'remove' rather than 'delete'.
2016-11-17 Brady Eidson <beidson@apple.com>
Add _WKIconLoadingDelegate SPI.
https://bugs.webkit.org/show_bug.cgi?id=164894
Reviewed by Alex Christensen.
With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
For icons the app decides to load, WebKit will pass the data to the app without storing locally.
* UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
(API::IconLoadingClient::~IconLoadingClient):
(API::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _iconLoadingDelegate]):
(-[WKWebView _setIconLoadingDelegate:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
(-[_WKLinkIconParameters _initWithLinkIcon:]):
(-[_WKLinkIconParameters url]):
(-[_WKLinkIconParameters mimeType]):
(-[_WKLinkIconParameters size]):
(-[_WKLinkIconParameters iconType]):
* UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
(WebKit::IconLoadingDelegate::IconLoadingDelegate):
(WebKit::IconLoadingDelegate::~IconLoadingDelegate):
(WebKit::IconLoadingDelegate::createIconLoadingClient):
(WebKit::IconLoadingDelegate::delegate):
(WebKit::IconLoadingDelegate::setDelegate):
(WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
(WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
(WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setIconLoadingClient):
(WebKit::WebPageProxy::getLoadDecisionForIcon):
(WebKit::WebPageProxy::finishedLoadingIcon):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::iconLoadingClient):
* UIProcess/WebPageProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::useIconLoadingClient):
(WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
(WebKit::WebFrameLoaderClient::finishedLoadingIcon):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
(WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didGetLoadDecisionForIcon):
(WebKit::WebPage::setUseIconLoadingClient):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2016-11-17 Saam Barati <sbarati@apple.com>
Remove async/await compile time flag and enable tests
https://bugs.webkit.org/show_bug.cgi?id=164828
<rdar://problem/28639334>
Reviewed by Yusuke Suzuki.
* Configurations/FeatureDefines.xcconfig:
2016-11-17 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] WTF::TemporaryChange with WTF::SetForScope
https://bugs.webkit.org/show_bug.cgi?id=164761
Reviewed by Saam Barati.
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::initialize):
* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::didReceiveMessage):
(WebKit::WebProcessConnection::didReceiveSyncMessage):
* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(createEncodedObject):
(decodeObject):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateTextTouchBar):
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
* UIProcess/gtk/WebPasteboardProxyGtk.cpp:
(WebKit::WebPasteboardProxy::writeToClipboard):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::flushPendingLayerChanges):
(WebKit::CompositingCoordinator::purgeBackingStores):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::dispatchTouchEvent):
(WebKit::WebPage::setInitialFocus):
(WebKit::WebPage::insertTextAsync):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
* WebProcess/WebPage/mac/WebPageMac.mm:
2016-11-16 Brent Fulgham <bfulgham@apple.com>
Unreviewed build fix after r208589
The generated com.apple.WebKit.plugin-common.sb file was not getting copied into
the Resources folder, so was not deployed with WebKit. We need to treat it like
com.apple.WebProcess.sb and the other generated files.
* WebKit2.xcodeproj/project.pbxproj: Tell Xcode to include the generated file in
the framework Resources.
2016-11-16 Yusuke Suzuki <utatane.tea@gmail.com>
[ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
https://bugs.webkit.org/show_bug.cgi?id=164827
Reviewed by Ryosuke Niwa.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
Annotated ES6 Modules option with DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetES6ModulesEnabled):
(WKPreferencesGetES6ModulesEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-11-16 Simon Fraser <simon.fraser@apple.com>
Add logging support to VisibleContentRectUpdateInfo
https://bugs.webkit.org/show_bug.cgi?id=164825
Reviewed by Zalan Bujtas.
Add TextStream output to VisibleContentRectUpdateInfo. Just piping it into a logging
stream does single-line output, so also make a convenience dump() function that will
product multiline output. Result look like:
(VisibleContentRectUpdateInfo
(lastLayerTreeTransactionID 54)
(exposedContentRect (523.44,1258.63) width=676.20 height=901.60)
(unobscuredContentRect (523.44,1293.41) width=676.20 height=866.82)
(unobscuredRectInScrollViewCoordinates (0,39.50) width=768 height=984.50)
(customFixedPositionRect (219.64,935) width=980 height=1225)
(obscuredInset width=0 height=39.50)
(scale 1.14)
(inStableState 0)
(timestamp 736446.61)
(verticalVelocity -11.36))
* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::VisibleContentRectUpdateInfo::dump):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2016-11-15 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Scroll view scrolling and zooming animations can keep running across page loads
https://bugs.webkit.org/show_bug.cgi?id=164810
Reviewed by Tim Horton.
Scrolling and zooming animations can leak across page loads, which makes tests flakey,
and is unexpected by users.
Tested by scrollingcoordinator/ios/sync-layer-positions-after-scroll.html followed by
scrollingcoordinator/ios/ui-scrolling-tree.html
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLoadForMainFrame]):
2016-11-15 Jon Lee <jonlee@apple.com>
Report active video and audio capture devices separately
https://bugs.webkit.org/show_bug.cgi?id=164769
Reviewed by Eric Carlson.
Replace kWKMediaHasActiveCaptureDevice with kWKMediaHasActiveAudioCaptureDevice and
kWKMediaHasActiveVideoCaptureDevice
* UIProcess/API/C/WKPage.cpp:
(WKPageGetMediaState):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange): Update the mask to include the two
bits.
2016-11-14 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Implement support for visual viewports
https://bugs.webkit.org/show_bug.cgi?id=164765
Reviewed by Tim Horton.
Adopt the visual viewport scrolling model in iOS WK2.
Pass the parameters used for computing the layout viewport up to WK2 via RemoteLayerTreeTransaction.
These are stored on WebPageProxy. When they change, _didCommitLayerTree triggers a -_updateVisibleContentRects.
WebPageProxy::computeCustomFixedPositionRect() is the function that computes the "override" layout viewport.
It starts with the baseLayoutViewportSize from the web process (which is based on the initial containing block
size), then ensures that it's no smaller than the unobscured content rect, since it makes no sense for the
layout viewport to be smaller than the visual viewport. The static FrameView::computeLayoutViewportOrigin()
is then use to "push" the layout viewport around as the visual viewport changes.
* Shared/VisibleContentRectUpdateInfo.h:
* Shared/WebCoreArgumentCoders.cpp: Encode LayoutSize and LayoutPoint.
(IPC::ArgumentCoder<LayoutSize>::encode):
(IPC::ArgumentCoder<LayoutSize>::decode):
(IPC::ArgumentCoder<LayoutPoint>::encode):
(IPC::ArgumentCoder<LayoutPoint>::decode):
* Shared/WebCoreArgumentCoders.h:
* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::baseLayoutViewportSize):
(WebKit::RemoteLayerTreeTransaction::setBaseLayoutViewportSize):
(WebKit::RemoteLayerTreeTransaction::minStableLayoutViewportOrigin):
(WebKit::RemoteLayerTreeTransaction::setMinStableLayoutViewportOrigin):
(WebKit::RemoteLayerTreeTransaction::maxStableLayoutViewportOrigin):
(WebKit::RemoteLayerTreeTransaction::setMaxStableLayoutViewportOrigin):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
(WebKit::RemoteLayerTreeTransaction::description):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
(WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled): Accessor.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::customFixedPositionRect):
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView _didCommitLayerTree:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect): When visual viewports are enabled, compute
the layout viewport rect, taking the baseLayoutViewportSize and the current unobscured rect into account.
(WebKit::WebPageProxy::updateLayoutViewportParameters):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* WebProcess/WebPage/WebPage.cpp: Encode in the transaction the layout viewport parameters (with minor refactor).
(WebKit::WebPage::willCommitLayerTree):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects): This is where the web process receives the new override layout viewport
from the web process (with some logging).
2016-11-15 Jon Lee <jonlee@apple.com>
Remove HasMediaCaptureDevice
https://bugs.webkit.org/show_bug.cgi?id=164767
<rdar://problem/29263696>
Reviewed by Eric Carlson.
* UIProcess/API/C/WKPage.cpp: Remove kWKMediaHasCaptureDevice.
(WKPageGetMediaState):
* UIProcess/API/C/WKPagePrivate.h:
2016-11-15 Daniel Bates <dabates@apple.com>
Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
https://bugs.webkit.org/show_bug.cgi?id=164662
<rdar://problem/29268514>
Reviewed by Alex Christensen and Brady Eidson.
Make changes to NetworkDataTask similar to the changes made to ResourceHandle so as to
disallow non-default port HTTP 0.9 loads when using the ENABLE(NETWORK_SESSION) networking
code path in WebKit2.
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
Otherwise notify the client that we received a response.
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::resume): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
as the latter has been renamed to the former.
(WebKit::NetworkDataTaskBlob::getSizeForNext): Ditto.
(WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): Renamed from didReceiveResponse().
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::didReceiveResponse): Deleted.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::didSendRequest): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
as the latter has been renamed to the former.
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Renamed from didReceiveResponse(). Also
remove the local variable response and inline its value into the call to ResourceHandle::didReceiveResponse()
as this variable is used exactly once in this function and its name does not describe its purpose any more
than its value.
(WebKit::NetworkDataTaskSoup::didRequestNextPart): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
as the latter has been renamed to the former.
* NetworkProcess/soup/NetworkDataTaskSoup.h:
2016-11-14 Alex Christensen <achristensen@webkit.org>
Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
https://bugs.webkit.org/show_bug.cgi?id=164720
Reviewed by Brady Eidson.
* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::indexedDatabaseOrigins):
* DatabaseProcess/DatabaseProcess.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginCreateFromDatabaseIdentifier):
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::Entry::encode):
(WebKit::WebsiteData::Entry::decode):
* Shared/WebsiteData/WebsiteData.h:
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerGetStorageDetailsByOrigin):
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
(WebKit::LocalStorageDatabaseTracker::origins):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::exceededDatabaseQuota):
(WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
(WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchData):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::mediaKeyOrigins):
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetDatabaseQuota):
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
(WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
* WebProcess/Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::create):
(WebKit::StorageAreaImpl::StorageAreaImpl):
(WebKit::StorageAreaImpl::securityOrigin):
* WebProcess/Storage/StorageAreaImpl.h:
* WebProcess/Storage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
* WebProcess/Storage/StorageAreaMap.h:
(WebKit::StorageAreaMap::securityOrigin):
* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
(WebKit::StorageNamespaceImpl::storageArea):
* WebProcess/Storage/StorageNamespaceImpl.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exceededDatabaseQuota):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::fetchWebsiteData):
2016-11-14 Brent Fulgham <bfulgham@apple.com>
[Mac][iOS][WK2] Tighten permissions to change CapsLock delay
https://bugs.webkit.org/show_bug.cgi?id=164725
<rdar://problem/28970910>
Reviewed by Alexey Proskuryakov.
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Limit access
to the IOKit connection that actually needs it.
2016-11-14 Brent Fulgham <bfulgham@apple.com>
Unreviewed sandbox fix after r208702
Correct version check to avoid breaking users in Safari Technology Preview
or WebKit nightlies.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2016-11-14 Pranjal Jumde <pjumde@apple.com>
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.
https://bugs.webkit.org/show_bug.cgi?id=163710
<rdar://problem/24357468>
Reviewed by Darin Adler.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
2016-11-13 Darin Adler <darin@apple.com>
Remove many includes of ExceptionCode.h
https://bugs.webkit.org/show_bug.cgi?id=164706
Reviewed by Alex Christensen.
* WebProcess/Storage/StorageAreaImpl.cpp: Removed include of ExceptionCode.h.
2016-11-13 Darin Adler <darin@apple.com>
Fix exception handling in SQL database code, streamline and update code
https://bugs.webkit.org/show_bug.cgi?id=164685
Reviewed by Sam Weinig.
* UIProcess/API/efl/ewk_database_manager.cpp:
(EwkDatabaseManager::getDatabaseOrigins): Update for change to the
DatabaseTracker::origins function.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchData): Use DatabaseTracker.
(WebKit::WebsiteDataStore::removeData): Ditto.
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetDatabaseQuota): Ditto.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::processWillSuspendImminently): Ditto.
2016-11-12 Simon Fraser <simon.fraser@apple.com>
Add a way to get the UI-side scrolling tree as text via UIScriptController
https://bugs.webkit.org/show_bug.cgi?id=164697
Reviewed by Zalan Bujtas.
Add a property to WKWebView to retrieve the scrolling tree as text, for testing.
Expose it via the RemoteScrollingCoordinatorProxy.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _scrollingTreeAsText]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeAsText):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2016-11-12 Daniel Bates <dabates@apple.com>
Incorrect release log message emitted when waiting/not waiting for the WebProcess continue a load
https://bugs.webkit.org/show_bug.cgi?id=164605
Reviewed by Darin Adler.
Currently we emit a release log message of the form "didReceiveResponse: Should wait for
message from WebContent process ..." when we are not waiting for the WebProcess and emit
a message of the form "didReceiveResponse: Should not wait for message from WebContent
process" when we are waiting on the WebProcess. Invert these messages to reflect whether
we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponsewhether.
For the main resource NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::No
because we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponse
to continue the load. For a subresource we do not need to wait for the WebProcess to allow the load to continue
and hence NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::Yes.
* NetworkProcess/NetworkResourceLoader.cpp:
2016-11-12 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Share some code with Mac for post-async-scroll state reconciliation
https://bugs.webkit.org/show_bug.cgi?id=164694
Reviewed by Zalan Bujtas.
Rather than calling FrameView directly, call reconcileScrollingState() on the scrolling
coordinator.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):
2016-11-12 Brian Burg <bburg@apple.com>
Web Automation: terminate the automation session if the web process crashes
https://bugs.webkit.org/show_bug.cgi?id=164671
<rdar://problem/29028964>
Reviewed by Joseph Pecoraro.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::disconnect):
(WebKit::WebAutomationSession::terminate):
Factor out code that disconnects the remote, unpairs, and notifies the client.
Then, expose terminate() which can be called without a FrontendChannel.
Calling this causes the _WKAutomationDelegate to clear the local-side session in the
browser, and disconnecting from the remote will hang up the remote-side session.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidCrash):
Terminate the session.
2016-11-11 Alex Christensen <achristensen@webkit.org>
Use SecurityOriginData as keys in StorageManager
https://bugs.webkit.org/show_bug.cgi?id=159834
<rdar://problem/27346948>
Reviewed by Brady Eidson.
* Platform/IPC/HandleMessage.h:
(IPC::callMemberFunctionImpl):
Add a missing std::forward so we can use this callMemberFunctionImpl with rvalues.
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerGetApplicationCacheOrigins):
(WKApplicationCacheManagerDeleteEntriesForOrigin):
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerGetKeyValueStorageOrigins):
(WKKeyValueStorageManagerDeleteEntriesForOrigin):
* UIProcess/API/C/WKResourceCacheManager.cpp:
(WKResourceCacheManagerGetCacheOrigins):
(WKResourceCacheManagerClearCacheForOrigin):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/Databases/DatabaseProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getNetworkProcessConnection):
(WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Storage/LocalStorageDatabase.cpp:
(WebKit::LocalStorageDatabase::create):
(WebKit::LocalStorageDatabase::LocalStorageDatabase):
(WebKit::LocalStorageDatabase::openDatabase):
(WebKit::LocalStorageDatabase::close):
* UIProcess/Storage/LocalStorageDatabase.h:
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::databasePath):
(WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
(WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
(WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
(WebKit::LocalStorageDatabaseTracker::origins):
* UIProcess/Storage/LocalStorageDatabaseTracker.h:
* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::securityOrigin):
(WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::TransientLocalStorageNamespace::origins):
(WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::StorageManager::StorageArea::StorageArea):
(WebKit::StorageManager::StorageArea::clone):
(WebKit::StorageManager::StorageArea::items):
(WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
(WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
(WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
(WebKit::StorageManager::SessionStorageNamespace::origins):
(WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::StorageManager::SessionStorageNamespace::cloneTo):
(WebKit::StorageManager::getSessionStorageOrigins):
(WebKit::StorageManager::deleteSessionStorageOrigins):
(WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
(WebKit::StorageManager::getLocalStorageOrigins):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
(WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createTransientLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::getOrCreateLocalStorageNamespace):
(WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
(WebKit::StorageManager::StorageArea::create): Deleted.
(WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea): Deleted.
(WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea): Deleted.
* UIProcess/Storage/StorageManager.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataRecord.cpp:
(WebKit::WebsiteDataRecord::displayNameForOrigin):
(WebKit::WebsiteDataRecord::add):
* UIProcess/WebsiteData/WebsiteDataRecord.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchData):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::mediaKeyOrigins):
(WebKit::WebsiteDataStore::removeMediaKeys):
* UIProcess/WebsiteData/WebsiteDataStore.h:
Fewer SecurityOrigin uses in the UIProcess! Hooray!
2016-11-11 Ryosuke Niwa <rniwa@webkit.org>
Hovering over a slotted Text node clears hover state
https://bugs.webkit.org/show_bug.cgi?id=164002
<rdar://problem/29040471>
Reviewed by Simon Fraser.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performImmediateActionHitTestAtLocation):
2016-11-11 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
https://bugs.webkit.org/show_bug.cgi?id=164538
<rdar://problem/8418711>
Reviewed by Ryosuke Niwa.
Consult HTMLElement::autocorrect() and HTMLElement::autocapitalizeType() when assembling the assisted node
information for the currently assisted node.
* Shared/AssistedNodeInformation.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toUITextAutocapitalize):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):
2016-11-11 Beth Dakin <bdakin@apple.com>
Move to modern TouchBar methods
https://bugs.webkit.org/show_bug.cgi?id=164655
-and corresponding-
rdar://problem/29226911
Reviewed by Wenson Hsieh.
customizationDefaultItemIdentifiers -> defaultItemIdentifiers
itemIdentifiers -> defaultItemIdentifiers
defaultItems -> templateItems
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::plainTextTouchBarDefaultItemIdentifiers):
(WebKit::richTextTouchBarDefaultItemIdentifiers):
(WebKit::WebViewImpl::setUpTextTouchBar):
(WebKit::WebViewImpl::updateTextTouchBar):
(WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
(WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
2016-11-11 Brent Fulgham <bfulgham@apple.com>
Get rid of old sandbox rules for OS's we no longer support
https://bugs.webkit.org/show_bug.cgi?id=164638
Reviewed by Simon Fraser.
Clean up the various sandbox profiles to get rid of rules that applied to operating system
versions we no longer support, or were added in support of bugs that have long since been
fixed.
This should introduce no change in behavior.
* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb:
* WebProcess/com.apple.WebProcess.sb.in:
2016-11-11 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
https://bugs.webkit.org/show_bug.cgi?id=164641
Reviewed by Alex Christensen.
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2016-11-11 Eric Carlson <eric.carlson@apple.com>
[MediaStream] defer resolution of getUserMedia promise made in a background tab
https://bugs.webkit.org/show_bug.cgi?id=164643
<rdar://problem/29048317>
Reviewed by Brady Eidson.
Do not ask for user for access to capture devices when the document does not
allow media to play, wait until playback is allowed.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::mediaCanStart):
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::mediaCanStart):
* WebProcess/Plugins/PluginView.h:
2016-11-11 Darin Adler <darin@apple.com>
Move Node from ExceptionCode to ExceptionOr
https://bugs.webkit.org/show_bug.cgi?id=164515
Reviewed by Sam Weinig.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
(webkit_dom_html_select_element_remove): Updated exception handling.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
(webkit_dom_node_insert_before): Ditto.
(webkit_dom_node_replace_child): Ditto.
(webkit_dom_node_remove_child): Ditto.
(webkit_dom_node_append_child): Ditto.
(webkit_dom_node_clone_node_with_error): Ditto.
(webkit_dom_node_set_node_value): Ditto.
(webkit_dom_node_set_text_content): Ditto.
* WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
(-[WKDOMNode insertNode:before:]): Ditto.
(-[WKDOMNode appendChild:]): Ditto.
(-[WKDOMNode removeChild:]): Ditto.
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::PDFPlugin): Removed unneeded ASSERT_NO_EXCEPTION.
* WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
(WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): Ditto.
2016-11-11 Megan Gardner <megan_gardner@apple.com>
[Cocoa] Support wide gamut for Drag Image UI
https://bugs.webkit.org/show_bug.cgi?id=164490
Reviewed by Tim Horton.
Fixed an error in the gating for the new wide gamut support in ShareableBitmap.
We should always respect the flags straight out, and not make decisions later, it can lead to mismatched data and data storage.
Added support for wide gamut in createCGImage.
* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::bitmapInfo):
(WebKit::colorSpace):
(WebKit::ShareableBitmap::createGraphicsContext):
(WebKit::ShareableBitmap::createCGImage):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertImageToBitmap):
(WebKit::WebDragClient::startDrag):
2016-11-11 Beth Dakin <bdakin@apple.com>
Get touch bar code building for open source builds
https://bugs.webkit.org/show_bug.cgi?id=164610
Reviewed by Wenson Hsieh.
* config.h:
2016-11-10 Brent Fulgham <bfulgham@apple.com>
Remove unused FontService from sandbox profile
https://bugs.webkit.org/show_bug.cgi?id=164625
<rdar://problem/26899976>
Reviewed by Alex Christensen.
Part of some general sandbox profile gardening.
Convert the Plugin process sandbox into
* Configurations/WebKit.xcconfig: Add exclude for com.apple.WebKit.plugin-common.sb.in.
* DerivedSources.make: Update to generate com.apple.WebKit.plugin-common.sb from .in file
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Copied from Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb.
* Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Removed.
* WebKit2.xcodeproj/project.pbxproj: Update for new .in file.
* WebProcess/com.apple.WebProcess.sb.in: Remove com.apple.FontServer
from macOS Sierra and newer.
2016-11-10 Eric Carlson <eric.carlson@apple.com>
[MediaStream] apply constraints passed to getUserMedia()
https://bugs.webkit.org/show_bug.cgi?id=164561
Reviewed by Youenn Fablet.
<rdar://problem/29191384>
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2016-11-10 Alex Christensen <achristensen@webkit.org>
Move SecurityOrigin::databaseIdentifier() to SecurityOriginData
https://bugs.webkit.org/show_bug.cgi?id=164573
Reviewed by Brady Eidson.
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginCopyDatabaseIdentifier):
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::databasePath):
(WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
(WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeMediaKeys):
* WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
(WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCopyOriginsWithApplicationCache):
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
(WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectoryForOrigin):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exceededDatabaseQuota):
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2016-11-10 Alex Christensen <achristensen@webkit.org>
Remove unused CFURLCACHE code
https://bugs.webkit.org/show_bug.cgi?id=164551
Reviewed by Antti Koivisto.
WebKit2 doesn't use CFURLCache, but we still have some unused code that seems to use it.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
(WebKit::clearDiskCacheEntries):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::partitionName): Deleted.
(WebKit::NetworkProcess::cfURLCacheOrigins): Deleted.
(WebKit::NetworkProcess::clearCFURLCacheForOrigins): Deleted.
2016-11-10 Carlos Garcia Campos <cgarcia@igalia.com>
[Linux] Memory process values shown by the WebMemorySampler in linux are wrong
https://bugs.webkit.org/show_bug.cgi?id=164591
Reviewed by Michael Catanzaro.
It's parsing /proc/self/statm, and returning the values as if they were bytes, but they are number of pages, so
to get the bytes we need to take the page size into account. In r208534 I added a method to get /proc/self/statm
values in bytes to Platform layer, so we can simply use that instead.
* Shared/linux/WebMemorySamplerLinux.cpp:
(WebKit::WebMemorySampler::sampleWebKit): Use currentProcessMemoryStatus() and update the descriptions to
clarify that values are in bytes.
2016-10-14 Carlos Garcia Campos <cgarcia@igalia.com>
MemoryPressureHandler shouldn't know how to release WebCore memory
https://bugs.webkit.org/show_bug.cgi?id=160497
Reviewed by Michael Catanzaro.
Set the low memory handler before installing the memory pressure handler.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
2016-10-27 Sergio Villar Senin <svillar@igalia.com>
[GTK] New API to notify about dynamically added forms
https://bugs.webkit.org/show_bug.cgi?id=164050
Reviewed by Carlos Garcia Campos.
This new API exports the WebCore event didAssociateFormControls through the web extension
mechanism. This will help clients (mainly web browsers) to implement robust auto filling
mechanisms. It deals nicely with dynamically created forms (and form controls) as many JS
frameworks do nowadays.
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: Added a FormClient implementation of
API::InjectedBundle::FormClient.
(webkitWebPageFormControlsAssociated): Emit the new signal.
(webkit_web_page_class_init): Added the new signal "forms-controls-associated".
(webkitWebPageCreate): Set the WebPage as a FormClient.
2016-11-10 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK] Allow to use WebMemorySampler feature.
https://bugs.webkit.org/show_bug.cgi?id=164517
Reviewed by Carlos Garcia Campos.
Enable the WebMemorySampler with the environment variable WEBKIT_SAMPLE_MEMORY.
When enabled, it will dump the stats to /tmp each second.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):
2016-11-10 Philippe Normand <pnormand@igalia.com>
[WK2][GTK][GStreamer] Build fails when -plugins-base and -core headers are not installed in the same directory
https://bugs.webkit.org/show_bug.cgi?id=148894
Reviewed by Carlos Garcia Campos.
The pbutils (gst-plugins-base-utils) headers are needed in
WebKit2/GTK for the permission request API related with the
GStreamer codec installer. It builds fine in most cases without
explicitely requiring the pbutils include directory path because
usually all the GStreamer headers are installed in the same path,
excepted for some distributions, like NixOS.
* PlatformGTK.cmake: The GStreamer pbutils include directory was
missing in the header search path.
2016-11-09 Chris Dumez <cdumez@apple.com>
[WK2][!NETWORK_SESSION] Add support for downloading file backed blobs
https://bugs.webkit.org/show_bug.cgi?id=164522
Reviewed by Alex Christensen.
Add support for downloading file backed blobs for the non-NETWORK_SESSION
code path of WebKit2, which is still use on pre-Sierra macOS.
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::~Download):
* NetworkProcess/Downloads/Download.h:
(WebKit::Download::setBlobFileReferences):
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
(WebKit::DownloadManager::convertNetworkLoadToDownload):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::convertToDownload):
2016-11-09 Chris Dumez <cdumez@apple.com>
[WK2][NETWORK_SESSION] Add support for downloading file backed blobs
https://bugs.webkit.org/show_bug.cgi?id=164458
<rdar://problem/28905514>
Reviewed by Darin Adler.
Add support for downloading file backed blobs on WebKit2.
It previously wasn't working because we weren't calling
BlobDataFileReference::prepareForFileAccess() for each blob file before
starting the download, similarly to what is done in NetworkResourceLoader's
consumeSandboxExtensions().
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/Downloads/DownloadManager.h:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::startDownload):
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
(WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
(WebKit::NetworkDataTaskBlob::download):
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::downloadRequest):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/PingLoad.h:
2016-11-09 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkSession: Network process crash when converting main resource to download
https://bugs.webkit.org/show_bug.cgi?id=164220
Reviewed by Alex Christensen.
Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
created yet. That's not expected to happen and when the response completion handler is called in the
NetworkDataTask it tries to use either the client or the download and it crashes.
We need to cleanup and destroy the ResourceLoader as soon as it becomes a download, because that's the expected
behavior, but at the same time we need to keep the NetworkLoad alive until the NetworkDataTask finishes to become
a download. This patch creates a PendingDownload to take the ownership of the NetworkLoad, so that
ResourceLoader can be cleaned up and destroyed. The DownloadManager now will handle the PendingDownload as if it
was created by startDownload(), but ensuring it's deleted right before the final Download object is added to the
downloads map. That way NetworkDataTask will always have a valid client until the final Download is created,
first the ResourceLoader and then the PendingDownload. Since the DownloadManager is the owner of the
PendingDownload we no longer need the didBecomeDownload() callback to delete the NetworkLoad, because the
NetworkLoad will always be owned by the PendingDownload now that will be deleted by the DownloadManager.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::dataTaskBecameDownloadTask): Change the ASSERT because at this point we should always
have a PendingDownload, and then remove it from the map here before adding the final Download to the map.
(WebKit::DownloadManager::convertNetworkLoadToDownload): This replaces convertHandleToDownload, but it also now
used for the NetworkSession. It creates a PendingDownload for the given NetworkLoad.
(WebKit::DownloadManager::continueDecidePendingDownloadDestination): Do not take the PendingDownload from the
map here, just check it's present, because it will be removed from dataTaskBecameDownloadTask().
(WebKit::DownloadManager::convertHandleToDownload): Deleted.
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::PendingDownload): Add a constructor that receives a NetworkLoad.
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Just ask the ResourceLoader to be
converted to a download.
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::download): Do not call didBecomeDownload() and add an assert to ensure the client
has already been removed right after the final Download object is created.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad): Use a pointer for the client instead of a reference because now we need to
change the client when the load is converted to a download. We don't need to null check the client in any case
because the member is only updated internally and always from a passed reference.
(WebKit::NetworkLoad::sharedDidReceiveResponse):
(WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
(WebKit::NetworkLoad::convertTaskToDownload): This now receives a PendingDownload. It updates the client and no
longer sends DidStart, because the PendingDownload sends it now.
(WebKit::NetworkLoad::didReceiveChallenge):
(WebKit::NetworkLoad::didReceiveData):
(WebKit::NetworkLoad::didCompleteWithError):
(WebKit::NetworkLoad::didSendData):
(WebKit::NetworkLoad::wasBlocked):
(WebKit::NetworkLoad::cannotShowURL):
(WebKit::NetworkLoad::didReceiveBuffer):
(WebKit::NetworkLoad::didFinishLoading):
(WebKit::NetworkLoad::didFail):
(WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
(WebKit::NetworkLoad::didBecomeDownload): Deleted.
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h: Remove didBecomeDownload().
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::convertToDownload): This replaces didBecomeDownload() and
didConvertToDownload(). It transfers the NetworkLoad to the DownloadManager.
(WebKit::NetworkResourceLoader::abort): We don't need to check if the load was converted to a download here,
because m_networkLoad will always be null here in such case.
(WebKit::NetworkResourceLoader::didBecomeDownload): Deleted
(WebKit::NetworkResourceLoader::didConvertToDownload): Deleted
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/PingLoad.h: Remove didBecomeDownload().
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Ditto.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Ditto.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Do not call didBecomeDownload().
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::download): Do not call didBecomeDownload() and add an assert to ensure the client
has already been removed right after the final Download object is created.
2016-11-09 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r208438.
crashes
Reverted changeset:
"[WK2][NETWORK_SESSION] Add support for downloading file
backed blobs"
https://bugs.webkit.org/show_bug.cgi?id=164458
http://trac.webkit.org/changeset/208438
2016-11-04 Brent Fulgham <bfulgham@apple.com>
Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
https://bugs.webkit.org/show_bug.cgi?id=155185
<rdar://problem/11101440>
Reviewed by Brady Eidson.
Provide SPI to access the new quirk for localStorage. The quirk defaults to 'on'. When active, this
quirk says that localStorage access should be granted, without needing to grant universal file access.
If the quirk is turned off, then localStorage is blocked unless the WebKit client explicitly
grants universal file access.
Tested by existing TestWebKitAPI tests and WebKit2.LocalStorageQuirkTest
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetNeedsLocalStorageQuirk): Added.
(WKPreferencesGetNeedsLocalStorageQuirk): Added.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Honor the new localStorage quirk.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]): Honor the new localStorage quirk flag.
(-[WKWebViewConfiguration copyWithZone:]): Ditto.
(-[WKWebViewConfiguration _needsLocalStorageQuirk]): Added.
(-[WKWebViewConfiguration _setNeedsLocalStorageQuirk:]): Added.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetNeedsLocalStorageQuirk): Added.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setNeedsLocalStorageQuirk): Added.
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Honor the new localStorage quirk flag.
2016-11-09 Simon Fraser <simon.fraser@apple.com>
Implement visual-viewport based position:fixed handling for Mac async scrolling
https://bugs.webkit.org/show_bug.cgi?id=164495
Reviewed by Tim Horton.
Educate the scrolling tree about visual and layout viewports. This is runtime-switchable,
so we push the enable flag to via the root state node, then push the layout viewport,
and the min/max scroll position that contstrain it, through frame state nodes.
When a scroll happens, we compute a new layout viewport when the visual viewport hits
an edge, and push that down through setScrollLayerPosition() since it's used to position
fixed and sticky layers.
The iOS code is made to compile, but not work yet.
* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingTree.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition):
* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
2016-11-09 Beth Dakin <bdakin@apple.com>
More attempted build fix.
* UIProcess/Cocoa/WebViewImpl.mm:
2016-11-09 Alex Christensen <achristensen@webkit.org>
Clean up Storage code
https://bugs.webkit.org/show_bug.cgi?id=164562
Reviewed by Brady Eidson.
Use more Refs!
* NetworkProcess/CustomProtocols/CustomProtocolManager.h:
* Platform/IPC/Connection.cpp:
(IPC::Connection::addWorkQueueMessageReceiver):
* Platform/IPC/Connection.h:
* UIProcess/Storage/LocalStorageDatabase.cpp:
(WebKit::LocalStorageDatabase::create):
(WebKit::LocalStorageDatabase::LocalStorageDatabase):
* UIProcess/Storage/LocalStorageDatabase.h:
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::create):
(WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
* UIProcess/Storage/LocalStorageDatabaseTracker.h:
* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
(WebKit::StorageManager::StorageManager):
* UIProcess/Storage/StorageManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
* UIProcess/mac/SecItemShimProxy.cpp:
(WebKit::SecItemShimProxy::initializeConnection):
* WebProcess/Plugins/PluginProcessConnectionManager.cpp:
(WebKit::PluginProcessConnectionManager::initializeConnection):
* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::initializeConnection):
* WebProcess/WebPage/ViewUpdateDispatcher.cpp:
(WebKit::ViewUpdateDispatcher::initializeConnection):
2016-11-09 Beth Dakin <bdakin@apple.com>
Another attempted build fix.
* UIProcess/Cocoa/WebViewImpl.mm:
2016-11-09 Michael Catanzaro <mcatanzaro@igalia.com>
Experimental features should not be enabled by default
https://bugs.webkit.org/show_bug.cgi?id=164367
Reviewed by Darin Adler.
We have two classes of experimental features:
(1) Features that are unstable and should be off by default, except for the developers
currently working on them. This is straightforward to handle; the default value should
be false.
(2) Features that are still not ready for end users, but are stable enough for testing. We
want these features to be enabled in testing environments like the bots, MiniBrowser,
Safari Tech Preview, and so forth, but not in stable release builds.
Implement this. It is better than having all experimental features on unconditionally, and
expecting them to be disabled manually on release branches, which is not something we are
keen to do. An exception is Cocoa ports, which to my knowledge do not currently have any
concept of development builds. These ports seem happy to continue disabling features
manually in release branches, and should continue to do so at least for now.
We also have features that we wish to enumerate at runtime, yet have enabled by default
unconditionally. We do not currently have any infrastructure to support this and should not
abuse the experimental status for this purpose; it requires future work. All settings can
still be toggled at runtime by clients that know about them using the existing runtime
features API.
Lastly, the custom elements feature is ready to be enabled by default, so it's no longer
experimental and can graduate to the list of normal boolean features.
* Shared/WebPreferencesDefinitions.h:
2016-11-09 Beth Dakin <bdakin@apple.com>
Build fix.
* UIProcess/Cocoa/WebViewImpl.mm:
2016-11-09 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Encapsulate cursor iteration parameters for easy future expansion.
https://bugs.webkit.org/show_bug.cgi?id=164504
Reviewed by Darin Adler.
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::iterateCursor):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::iterateCursor):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2016-11-09 Darin Adler <darin@apple.com>
Move Range from ExceptionCode to ExceptionOr
https://bugs.webkit.org/show_bug.cgi?id=164457
Reviewed by Alex Christensen.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
(webkit_dom_range_set_start): Updated exception handling.
(webkit_dom_range_set_end): Ditto.
(webkit_dom_range_set_start_before): Ditto.
(webkit_dom_range_set_start_after): Ditto.
(webkit_dom_range_set_end_before): Ditto.
(webkit_dom_range_set_end_after): Ditto.
(webkit_dom_range_select_node): Ditto.
(webkit_dom_range_select_node_contents): Ditto.
(webkit_dom_range_compare_boundary_points): Ditto.
(webkit_dom_range_delete_contents): Ditto.
(webkit_dom_range_extract_contents): Ditto.
(webkit_dom_range_clone_contents): Ditto.
(webkit_dom_range_insert_node): Ditto.
(webkit_dom_range_surround_contents): Ditto.
(webkit_dom_range_create_contextual_fragment): Ditto.
(webkit_dom_range_compare_node): Ditto.
(webkit_dom_range_intersects_node): Ditto.
(webkit_dom_range_compare_point): Ditto.
(webkit_dom_range_is_point_in_range): Ditto.
(webkit_dom_range_expand): Ditto.
* WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
(-[WKDOMRange setStart:offset:]): Ditto.
(-[WKDOMRange setEnd:offset:]): Ditto.
(-[WKDOMRange selectNode:]): Ditto.
(-[WKDOMRange selectNodeContents:]): Ditto.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::contentsAsString): Ditto.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::rangeForWebSelectionAtPosition): Ditto.
(WebKit::WebPage::rangeForBlockAtPoint): Ditto.
(WebKit::WebPage::selectWithGesture): Ditto.
(WebKit::containsRange): Ditto.
(WebKit::unionDOMRanges): Ditto.
(WebKit::WebPage::switchToBlockSelectionAtPoint): Ditto.
(WebKit::WebPage::getPositionInformation): Ditto.
2016-11-09 Darin Adler <darin@apple.com>
Move EventTarget from ExceptionCode to ExceptionOr
https://bugs.webkit.org/show_bug.cgi?id=164465
Reviewed by Youenn Fablet.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
(webkit_dom_attr_dispatch_event): Updated exception handling.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
(webkit_dom_cdata_section_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
(webkit_dom_character_data_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
(webkit_dom_comment_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
(webkit_dom_dom_window_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
(webkit_dom_document_fragment_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
(webkit_dom_document_type_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
(webkit_dom_html_anchor_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
(webkit_dom_html_applet_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
(webkit_dom_html_area_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
(webkit_dom_html_br_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
(webkit_dom_html_base_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
(webkit_dom_html_body_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
(webkit_dom_html_button_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
(webkit_dom_html_canvas_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
(webkit_dom_html_d_list_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
(webkit_dom_html_directory_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
(webkit_dom_html_div_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
(webkit_dom_html_document_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
(webkit_dom_html_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
(webkit_dom_html_embed_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
(webkit_dom_html_field_set_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
(webkit_dom_html_font_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
(webkit_dom_html_form_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
(webkit_dom_html_frame_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
(webkit_dom_html_frame_set_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
(webkit_dom_html_hr_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
(webkit_dom_html_heading_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
(webkit_dom_html_head_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
(webkit_dom_html_html_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
(webkit_dom_html_iframe_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
(webkit_dom_html_image_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
(webkit_dom_html_input_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
(webkit_dom_html_li_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
(webkit_dom_html_label_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
(webkit_dom_html_legend_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
(webkit_dom_html_link_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
(webkit_dom_html_map_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
(webkit_dom_html_marquee_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
(webkit_dom_html_menu_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
(webkit_dom_html_meta_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
(webkit_dom_html_mod_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
(webkit_dom_html_o_list_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
(webkit_dom_html_object_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
(webkit_dom_html_opt_group_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
(webkit_dom_html_option_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
(webkit_dom_html_paragraph_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
(webkit_dom_html_param_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
(webkit_dom_html_pre_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
(webkit_dom_html_quote_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
(webkit_dom_html_script_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
(webkit_dom_html_select_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
(webkit_dom_html_style_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
(webkit_dom_html_table_caption_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
(webkit_dom_html_table_cell_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
(webkit_dom_html_table_col_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
(webkit_dom_html_table_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
(webkit_dom_html_table_row_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
(webkit_dom_html_table_section_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
(webkit_dom_html_text_area_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
(webkit_dom_html_title_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
(webkit_dom_html_u_list_element_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
(webkit_dom_node_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
(webkit_dom_processing_instruction_dispatch_event): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
(webkit_dom_text_dispatch_event): Ditto.
2016-11-08 Dean Jackson <dino@apple.com>
Rendering support for ExtendedColors
https://bugs.webkit.org/show_bug.cgi?id=164443
<rdar://problems/29123243>
Reviewed by Simon Fraser and Darin Adler.
Implement argument coders for Color.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<Color>::encode):
(IPC::ArgumentCoder<Color>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateScrollViewBackground]):
2016-11-09 Beth Dakin <bdakin@apple.com>
Build fix.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::~WebViewImpl):
2016-11-09 Chris Dumez <cdumez@apple.com>
[Mac] Stop using deprecated AppKit enumeration values
https://bugs.webkit.org/show_bug.cgi?id=164494
Reviewed by Darin Adler.
Stop using deprecated AppKit enumeration values.
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::stopNSAppRunLoop):
* Shared/mac/WebEventFactory.mm:
(WebKit::mouseButtonForEvent):
(WebKit::mouseEventTypeForEvent):
(WebKit::clickCountForEvent):
(WebKit::globalPointForEvent):
(WebKit::pointForEvent):
(WebKit::textFromEvent):
(WebKit::unmodifiedTextFromEvent):
(WebKit::isKeypadEvent):
(WebKit::isKeyUpEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::becomeFirstResponder):
(WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
(WebKit::WebViewImpl::viewDidMoveToWindow):
(WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
(WebKit::WebViewImpl::createFullScreenWindow):
(WebKit::WebViewImpl::sendToolTipMouseExited):
(WebKit::WebViewImpl::sendToolTipMouseEntered):
(WebKit::applicationFlagsForDrag):
(WebKit::WebViewImpl::setLastMouseDownEvent):
(WebKit::WebViewImpl::doneWithKeyEvent):
(WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
(WebKit::WebViewImpl::performKeyEquivalent):
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::beginModal):
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
* UIProcess/mac/WebInspectorProxyMac.mm:
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::populate):
(WebKit::WebPopupMenuProxyMac::showPopupMenu):
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::modifierFlagsFromWebEvent):
(WebKit::getEventTypeFromWebEvent):
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
(WebKit::cssAlignmentValueForNSTextAlignment):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertImageToBitmap):
2016-11-09 Beth Dakin <bdakin@apple.com>
Support TouchBar in WebKit
https://bugs.webkit.org/show_bug.cgi?id=164437
-and corresponding-
rdar://problem/28876524
Reviewed by Darin Adler.
* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView makeTouchBar]):
(-[WKWebView candidateListTouchBarItem]):
(-[WKWebView _web_didAddMediaControlsManager:]):
(-[WKWebView _web_didRemoveMediaControlsManager]):
(-[WKWebView _interactWithMediaControlsForTesting]):
(-[WKWebView _wantsMediaPlaybackControlsView]):
(-[WKWebView _setWantsMediaPlaybackControlsView:]):
(-[WKWebView _mediaPlaybackControlsView]):
(-[WKWebView _addMediaPlaybackControlsView:]):
(-[WKWebView _removeMediaPlaybackControlsView]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView makeTouchBar]):
(-[WKView candidateListTouchBarItem]):
(-[WKView _web_didAddMediaControlsManager:]):
(-[WKView _web_didRemoveMediaControlsManager]):
(-[WKView _wantsMediaPlaybackControlsView]):
(-[WKView _setWantsMediaPlaybackControlsView:]):
(-[WKView _mediaPlaybackControlsView]):
(-[WKView _addMediaPlaybackControlsView:]):
(-[WKView _removeMediaPlaybackControlsView]):
* UIProcess/Cocoa/WebViewImpl.h:
(WebKit::WebViewImpl::currentTouchBar):
(WebKit::WebViewImpl::clientWantsMediaPlaybackControlsView):
(WebKit::WebViewImpl::setClientWantsMediaPlaybackControlsView):
(WebKit::WebViewImpl::setIsCustomizingTouchBar):
* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKTextListTouchBarViewController initWithWebViewImpl:]):
(-[WKTextListTouchBarViewController didDestroyView]):
(-[WKTextListTouchBarViewController _selectList:]):
(-[WKTextListTouchBarViewController setCurrentListType:]):
(-[WKTextTouchBarItemController initWithWebViewImpl:]):
(-[WKTextTouchBarItemController didDestroyView]):
(-[WKTextTouchBarItemController touchBar:makeItemForIdentifier:]):
(-[WKTextTouchBarItemController itemForIdentifier:]):
(-[WKTextTouchBarItemController candidateListTouchBarItem:endSelectingCandidateAtIndex:]):
(-[WKTextTouchBarItemController candidateListTouchBarItem:changedCandidateListVisibility:]):
(-[WKTextTouchBarItemController textListTouchBarViewController]):
(-[WKTextTouchBarItemController setTextIsBold:]):
(-[WKTextTouchBarItemController setTextIsItalic:]):
(-[WKTextTouchBarItemController setTextIsUnderlined:]):
(-[WKTextTouchBarItemController _wkChangeTextStyle:]):
(-[WKTextTouchBarItemController setCurrentTextAlignment:]):
(-[WKTextTouchBarItemController _wkChangeTextAlignment:]):
(-[WKTextTouchBarItemController textColor]):
(-[WKTextTouchBarItemController setTextColor:]):
(-[WKTextTouchBarItemController _wkChangeColor:]):
(-[WKTextTouchBarItemController textListViewController]):
(WebKit::WebViewImpl::makeTouchBar):
(WebKit::WebViewImpl::candidateListTouchBarItem):
(WebKit::WebViewImpl::mediaPlaybackControlsView):
(WebKit::WebViewImpl::useMediaPlaybackControlsView):
(WebKit::WebViewImpl::dismissTextTouchBarPopoverItemWithIdentifier):
(WebKit::textTouchBarCustomizationAllowedIdentifiers):
(WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers):
(WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers):
(WebKit::touchBarDidExitCustomization):
(WebKit::touchBarWillEnterCustomization):
(WebKit::didChangeAutomaticTextCompletion):
(WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers):
(WebKit::WebViewImpl::setUpTextTouchBar):
(WebKit::WebViewImpl::isRichlyEditable):
(WebKit::WebViewImpl::textTouchBar):
(WebKit::WebViewImpl::updateTextTouchBar):
(WebKit::WebViewImpl::updateMediaTouchBar):
(WebKit::WebViewImpl::forceRequestCandidatesForTesting):
(WebKit::WebViewImpl::updateTouchBar):
(WebKit::WebViewImpl::shouldRequestCandidates):
(WebKit::WebViewImpl::showCandidates):
(WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView):
(WebKit::WebViewImpl::setEditableElementIsFocused):
(WebKit::WebViewImpl::becomeFirstResponder):
(WebKit::WebViewImpl::selectionDidChange):
(WebKit::WebViewImpl::videoControlsManagerDidChange):
(WebKit::WebViewImpl::updateWebViewImplAdditions): Deleted.
2016-11-09 Chris Dumez <cdumez@apple.com>
[WK2][NETWORK_SESSION] Add support for downloading file backed blobs
https://bugs.webkit.org/show_bug.cgi?id=164458
<rdar://problem/28905514>
Reviewed by Darin Adler.
Add support for downloading file backed blobs on WebKit2.
It previously wasn't working because we weren't calling
BlobDataFileReference::prepareForFileAccess() for each blob file before
starting the download, similarly to what is done in NetworkResourceLoader's
consumeSandboxExtensions().
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/Downloads/DownloadManager.h:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::startDownload):
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
(WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
(WebKit::NetworkDataTaskBlob::download):
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::downloadRequest):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/PingLoad.h:
2016-11-09 Chris Dumez <cdumez@apple.com>
[WK2] Network cache speculative revalidation can cause loads to hang
https://bugs.webkit.org/show_bug.cgi?id=164532
<rdar://problem/28519331>
Reviewed by Alex Christensen.
Network cache speculative revalidation could cause loads to hang when HTTP
authentication was involved because NetworkCacheSpeculativeLoad failed to
call NetworkLoad::continueCanAuthenticateAgainstProtectionSpace() in its
canAuthenticateAgainstProtectionSpaceAsync() callback.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2016-11-09 Csaba Osztrogonác <ossy@webkit.org>
URTBF after r208361.
* PlatformMac.cmake:
2016-11-09 Csaba Osztrogonác <ossy@webkit.org>
Unreviewed typo fix after r160616 to fix the build on case sensitive file systems.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2016-11-05 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Layout test http/tests/misc/authentication-redirect-3/authentication-sent-to-redirect-same-origin-with-location-credentials.html fails
https://bugs.webkit.org/show_bug.cgi?id=139358
Reviewed by Michael Catanzaro.
Stop putting the credentials in the URL unconditionally and ensure we only do that when provided by the URL
itself. Libsoup has its own cache of SoupAuth, so we don't need to pass user/pass in the URL for every single
request, libsoup will authenticate those automatically.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
2016-11-04 Filip Pizlo <fpizlo@apple.com>
WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows
https://bugs.webkit.org/show_bug.cgi?id=152045
Reviewed by Andy Estes.
* Platform/IPC/Connection.cpp:
(IPC::Connection::SyncMessageState::wait):
(IPC::Connection::sendMessage):
(IPC::Connection::timeoutRespectingIgnoreTimeoutsForTesting):
(IPC::Connection::waitForMessage):
(IPC::Connection::sendSyncMessage):
(IPC::Connection::waitForSyncReply):
* Platform/IPC/Connection.h:
(IPC::Connection::sendSync):
(IPC::Connection::waitForAndDispatchImmediately):
* Platform/IPC/MessageSender.h:
(IPC::MessageSender::sendSync):
* UIProcess/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::sendSync):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::applicationWillTerminate):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::sendProcessWillSuspendImminently):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(-[WKOneShotDisplayLinkHandler displayLinkFired:]):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
(WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::stringSelectionForPasteboard):
(WebKit::WebPageProxy::dataSelectionForPasteboard):
(WebKit::WebPageProxy::readSelectionFromPasteboard):
(WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
(WebKit::WebPageProxy::acceptsFirstMouse):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
(WebKit::WebChromeClient::runJavaScriptAlert):
(WebKit::WebChromeClient::runJavaScriptConfirm):
(WebKit::WebChromeClient::runJavaScriptPrompt):
(WebKit::WebChromeClient::print):
(WebKit::WebChromeClient::exceededDatabaseQuota):
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::postSynchronousMessageForTesting):
2016-11-04 Wenson Hsieh <wenson_hsieh@apple.com>
Safari does not emit composition end if blurred for dead key / Japanese IME
https://bugs.webkit.org/show_bug.cgi?id=164369
<rdar://problem/29050439>
Reviewed by Ryosuke Niwa.
Split WebPage::discardedComposition into two steps, where we first discard marked text and then update the
editor state. This allows the codepath where we cancel the composition early (before setting the selection) to
discard marked text without also forcing an editor state update at the same time. The editor state is later
updated in WebPage::didChangeSelection.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::compositionWasCanceled):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::canceledComposition):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didChangeSelection):
(WebKit::WebPage::discardedComposition):
(WebKit::WebPage::canceledComposition):
* WebProcess/WebPage/WebPage.h:
2016-11-04 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r208293.
asserts in API tests.
Reverted changeset:
"NetworkSession: Network process crash when converting main
resource to download"
https://bugs.webkit.org/show_bug.cgi?id=164220
http://trac.webkit.org/changeset/208293
2016-11-04 Said Abou-Hallawa <sabouhallawa@apple.com>
Add a setting and preferences to enable/disable async image decoding
https://bugs.webkit.org/show_bug.cgi?id=164417
Reviewed by Simon Fraser.
Hook up the asyncImageDecodingEnabled setting for WebKit2.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _asyncImageDecodingEnabled]):
(-[WKPreferences _setAsyncImageDecodingEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-11-04 Simon Fraser <simon.fraser@apple.com>
Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
https://bugs.webkit.org/show_bug.cgi?id=164420
Reviewed by Tim Horton.
Rename:
commitNewTreeState -> commitTreeState ("new" was redundant)
updateBeforeChildren -> commitStateBeforeChildren
updateAfterChildren -> commitStateAfterChildren
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
(WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): Deleted.
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren): Deleted.
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): Deleted.
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2016-11-04 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkSession: Add NetworkDataTask implementation for blobs
https://bugs.webkit.org/show_bug.cgi?id=163939
Reviewed by Alex Christensen.
Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
is enabled.
* CMakeLists.txt: Add new files to compilation.
* NetworkProcess/Downloads/BlobDownloadClient.cpp:
* NetworkProcess/Downloads/BlobDownloadClient.h:
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
reveices a NetworkDataTask and is used by Soup backend and blobs.
(WebKit::Download::~Download):
(WebKit::Download::start):
(WebKit::Download::startWithHandle):
(WebKit::Download::cancel):
(WebKit::Download::didReceiveAuthenticationChallenge):
(WebKit::Download::didReceiveData):
(WebKit::Download::didFinish):
(WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
* NetworkProcess/Downloads/Download.h:
(WebKit::Download::Download):
(WebKit::Download::suggestedName):
(WebKit::Download::request):
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
(WebKit::DownloadManager::continueDecidePendingDownloadDestination):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::platformCancelNetworkLoad):
* NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
using NetworkSession.
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
* NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
* NetworkProcess/NetworkDataTaskBlob.cpp: Added.
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
(WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
(WebKit::NetworkDataTaskBlob::clearStream):
(WebKit::NetworkDataTaskBlob::resume):
(WebKit::NetworkDataTaskBlob::suspend):
(WebKit::NetworkDataTaskBlob::cancel):
(WebKit::NetworkDataTaskBlob::invalidateAndCancel):
(WebKit::NetworkDataTaskBlob::getSizeForNext):
(WebKit::NetworkDataTaskBlob::didGetSize):
(WebKit::NetworkDataTaskBlob::seek):
(WebKit::NetworkDataTaskBlob::didReceiveResponse):
(WebKit::NetworkDataTaskBlob::read):
(WebKit::NetworkDataTaskBlob::readData):
(WebKit::NetworkDataTaskBlob::readFile):
(WebKit::NetworkDataTaskBlob::didOpen):
(WebKit::NetworkDataTaskBlob::didRead):
(WebKit::NetworkDataTaskBlob::consumeData):
(WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
(WebKit::NetworkDataTaskBlob::suggestedFilename):
(WebKit::NetworkDataTaskBlob::download):
(WebKit::NetworkDataTaskBlob::writeDownload):
(WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
(WebKit::NetworkDataTaskBlob::didFailDownload):
(WebKit::NetworkDataTaskBlob::didFinishDownload):
(WebKit::NetworkDataTaskBlob::didFail):
(WebKit::NetworkDataTaskBlob::didFinish):
* NetworkProcess/NetworkDataTaskBlob.h: Added.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
(WebKit::NetworkLoad::~NetworkLoad):
(WebKit::NetworkLoad::setDefersLoading):
(WebKit::NetworkLoad::cancel):
(WebKit::NetworkLoad::continueWillSendRequest):
(WebKit::NetworkLoad::continueDidReceiveResponse):
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
(WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::registerNetworkDataTask): Ditto.
(WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
because in Cocoa all tasks are invalidated and canceled by the network session.
* NetworkProcess/mac/NetworkLoadMac.mm:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::download):
* NetworkProcess/soup/NetworkDataTaskSoup.h:
* NetworkProcess/soup/NetworkSessionSoup.cpp:
* NetworkProcess/soup/NetworkSessionSoup.h:
* PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
* PlatformGTK.cmake: Ditto.
* WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
2016-11-03 Simon Fraser <simon.fraser@apple.com>
Give all the geometry classes a single-argument scale() function for consistency
https://bugs.webkit.org/show_bug.cgi?id=164400
Reviewed by Zalan Bujtas.
Use single-argument scale() functions.
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::paint):
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _takeViewSnapshot]):
(-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
(-[WKWebView _scrollByContentOffset:]):
(-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _didCommitLayerTree:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _updateTapHighlight]):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::scaledMagnificationOrigin):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::snapshot):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::scrollToPoint):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createSelectionSnapshot):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scalePageInViewCoordinates):
(WebKit::WebPage::scaleView):
(WebKit::WebPage::snapshotAtSize):
(WebKit::WebPage::snapshotNode):
(WebKit::WebPage::drawRectToImage):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::restorePageState):
2016-11-03 Chris Dumez <cdumez@apple.com>
[WK2][Cocoa] Implement user interface for HTML form validation
https://bugs.webkit.org/show_bug.cgi?id=164143
<rdar://problem/28944652>
Reviewed by Simon Fraser.
Implement the ValidationMessageClient in WebKit2 and have it display
a ValidationBubble on Cocoa. ValidationBubble is implemented using
native popovers on both Mac and iOS. As a result, Mac and iOS WK2
now use native popover for HTML form validation instead of the old
Shadow DOM based UI in WebCore.
The native popover shows at the bottom (or top) of the input and it
disapears as soon as the user starts typing or interacts with the
view (e.g. tap / scroll / zoom).
The feature is still disabled at runtime.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _keyboardWillShow:]):
(-[WKWebView _keyboardDidShow:]):
(-[WKWebView _contentsOfUserInterfaceItem:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleWheelEvent):
(WebKit::WebPageProxy::setPageZoomFactor):
(WebKit::WebPageProxy::setPageAndTextZoomFactors):
(WebKit::WebPageProxy::pageDidScroll):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::hideValidationMessage):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::validationBubble):
(WebKit::WebPageProxy::setIsKeyboardAnimatingIn):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createValidationBubble):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _willStartScrollingOrZooming]):
(-[WKContentView scrollViewWillStartPanOrPinchGesture]):
(-[WKContentView _didEndScrollingOrZooming]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::potentialTapAtPosition):
(WebKit::WebPageProxy::showValidationMessage):
(WebKit::WebPageProxy::setIsScrollingOrZooming):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createValidationBubble):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::showValidationMessage):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
(WebKit::WebValidationMessageClient::WebValidationMessageClient):
(WebKit::WebValidationMessageClient::~WebValidationMessageClient):
(WebKit::WebValidationMessageClient::showValidationMessage):
(WebKit::WebValidationMessageClient::hideValidationMessage):
(WebKit::WebValidationMessageClient::isValidationMessageVisible):
* WebProcess/WebCoreSupport/WebValidationMessageClient.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
2016-11-03 Tim Horton <timothy_horton@apple.com>
Printing to PDF should produce internal links when HTML has internal links
https://bugs.webkit.org/show_bug.cgi?id=112081
<rdar://problem/5955705>
Reviewed by Simon Fraser.
* UIProcess/mac/WKPrintingView.h:
* UIProcess/mac/WKPrintingView.mm:
(linkDestinationName):
(-[WKPrintingView _drawPDFDocument:page:atPoint:]):
Propagate link-to-destination annotations (and each page's destinations)
into the printed PDF.
Generate a unique destination name based on the page and position, because
we have lost the fragment name information.
(-[WKPrintingView drawRect:]):
Compute all of the destinations for every page, so that we can add them
to the context as we paint the pages (we need the page CTM in order to add them).
2016-11-03 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r208298.
https://bugs.webkit.org/show_bug.cgi?id=163939
caused asan crashes
Reverted changeset:
"NetworkSession: Add NetworkDataTask implementation for blobs"
https://bugs.webkit.org/show_bug.cgi?id=163939
http://trac.webkit.org/changeset/208298
2016-11-03 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208330.
This change appears to have caused two editing tests to fail
on macOS.
Reverted changeset:
"Reduce PassRefPtr use in WebKit2"
https://bugs.webkit.org/show_bug.cgi?id=164360
http://trac.webkit.org/changeset/208330
2016-11-03 Dan Bernstein <mitz@apple.com>
WKWebView’s _observedRenderingProgressEvents not restored after web process crash
https://bugs.webkit.org/show_bug.cgi?id=164368
<rdar://problem/29091954>
Reviewed by Anders Carlsson.
Test: TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode): Encode new observedLayoutMilestones member.
(WebKit::WebPageCreationParameters::decode): Decode it.
* Shared/WebPageCreationParameters.h: Declared new observedLayoutMilestones member variable.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Removed initializer for
m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
(WebKit::WebPageProxy::listenForLayoutMilestones): Update new m_observedLayoutMilestones
member variable. Don’t update m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
(WebKit::WebPageProxy::creationParameters): Set the observedLayoutMilestones member in the
creation parameters.
* UIProcess/WebPageProxy.h: Declared new member variable, deleted
m_wantsSessionRestorationRenderTreeSizeThresholdEvent declaration.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCommitLayerTree): Rather than using
m_wantsSessionRestorationRenderTreeSizeThresholdEvent, use m_observedLayoutMilestones.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Add the observed layout milestones from the creation parameters.
2016-11-02 Alex Christensen <achristensen@webkit.org>
Reduce PassRefPtr use in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=164360
Reviewed by Tim Horton.
* Shared/API/APISecurityOrigin.h:
(API::SecurityOrigin::SecurityOrigin):
* Shared/API/APISerializedScriptValue.h:
(API::SerializedScriptValue::create):
(API::SerializedScriptValue::SerializedScriptValue):
* Shared/API/c/WKSharedAPICast.h:
(WebKit::ProxyingRefPtr::ProxyingRefPtr):
(WebKit::toAPI):
* Shared/APIWebArchive.h:
* Shared/APIWebArchive.mm:
(API::WebArchive::create):
(API::WebArchive::WebArchive):
* UIProcess/API/APIHitTestResult.cpp:
(API::HitTestResult::create):
* UIProcess/API/APIHitTestResult.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::createNewPage):
* UIProcess/API/C/WKPage.cpp:
(WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
(WebKit::RunBeforeUnloadConfirmPanelResultListener::RunBeforeUnloadConfirmPanelResultListener):
(WebKit::RunJavaScriptAlertResultListener::create):
(WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
(WebKit::RunJavaScriptConfirmResultListener::create):
(WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
(WebKit::RunJavaScriptPromptResultListener::create):
(WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
(WKPageSetPageUIClient):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPage):
* UIProcess/ios/WKGeolocationProviderIOS.mm:
(-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _webHitTestResult]):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(contextMenuItems):
(WKBundlePageCopyContextMenuItems):
(WKBundlePageCopyContextMenuAtPointInWindow):
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserMessageHandlerDescriptorProxy::create):
* WebProcess/WebPage/WebUndoStep.cpp:
(WebKit::WebUndoStep::create):
* WebProcess/WebPage/WebUndoStep.h:
(WebKit::WebUndoStep::WebUndoStep):
2016-11-01 Gavin Barraclough <barraclough@apple.com>
Remove PageThrottler & all related code
https://bugs.webkit.org/show_bug.cgi?id=164302
Reviewed by Ryosuke Niwa.
All relevant information now available from the ActivityState.
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::PluginProcess):
(WebKit::PluginProcess::createWebProcessConnection):
(WebKit::PluginProcess::audioHardwareDidBecomeActive): Deleted.
(WebKit::PluginProcess::audioHardwareDidBecomeInactive): Deleted.
* PluginProcess/PluginProcess.h:
(): Deleted.
* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::audioHardwareDidBecomeActive): Deleted.
(WebKit::WebProcessConnection::audioHardwareDidBecomeInactive): Deleted.
* PluginProcess/WebProcessConnection.h:
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::evaluate):
* WebProcess/Plugins/Plugin.h:
(WebKit::Plugin::audioHardwareActivity): Deleted.
* WebProcess/Plugins/PluginProcessConnection.cpp:
(WebKit::PluginProcessConnection::PluginProcessConnection):
(WebKit::PluginProcessConnection::didReceiveMessage):
(WebKit::PluginProcessConnection::audioHardwareDidBecomeActive): Deleted.
(WebKit::PluginProcessConnection::audioHardwareDidBecomeInactive): Deleted.
* WebProcess/Plugins/PluginProcessConnection.h:
(WebKit::PluginProcessConnection::supportsAsynchronousPluginInitialization):
(WebKit::PluginProcessConnection::audioHardwareActivity): Deleted.
* WebProcess/Plugins/PluginProcessConnection.messages.in:
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::audioHardwareActivity): Deleted.
* WebProcess/Plugins/PluginProxy.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::audioHardwareActivity): Deleted.
* WebProcess/Plugins/PluginView.h:
* WebProcess/WebPage/WebPage.cpp:
2016-11-03 Dan Bernstein <mitz@apple.com>
REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
https://bugs.webkit.org/show_bug.cgi?id=164340
<rdar://problem/29074344>
Reviewed by Tim Horton.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper
function that sends the message to the UI process and resets
m_pendingNewlyReachedLayoutMilestones.
(WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the
pending milestones and send them to the UI process. This way we don’t miss milestones that
fire during the commit.
2016-11-02 David Kilzer <ddkilzer@apple.com>
Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
<https://webkit.org/b/164333>
<rdar://problem/29072727>
Reviewed by Alex Christensen.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
Add private method to log diagnostic message.
(WebKit::WebProcess::networkProcessConnectionClosed):
Call logDiagnosticMessageForNetworkProcessCrash().
* WebProcess/WebProcess.h:
(WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
Declare new method.
2016-11-02 Alex Christensen <achristensen@webkit.org>
Remove Battery Status API from the tree
https://bugs.webkit.org/show_bug.cgi?id=164213
Reviewed by Sam Weinig.
* CMakeLists.txt:
* PlatformEfl.cmake:
* Shared/API/APIObject.h:
* Shared/API/c/WKBase.h:
* Shared/WebBatteryStatus.cpp: Removed.
* Shared/WebBatteryStatus.h: Removed.
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKBatteryManager.cpp: Removed.
* UIProcess/API/C/WKBatteryManager.h: Removed.
* UIProcess/API/C/WKBatteryStatus.cpp: Removed.
* UIProcess/API/C/WKBatteryStatus.h: Removed.
* UIProcess/API/C/WKContext.cpp:
(WKContextGetBatteryManager): Deleted.
* UIProcess/API/C/WKContext.h:
* UIProcess/API/efl/ewk_context.cpp:
(EwkContext::EwkContext):
* UIProcess/API/efl/ewk_context_private.h:
* UIProcess/API/efl/ewk_main.cpp:
(WebKit::EwkMain::initialize):
(WebKit::EwkMain::finalize):
(WebKit::EwkMain::shutdownInitializedEFLModules):
* UIProcess/API/gtk/WebKitBatteryProvider.cpp: Removed.
* UIProcess/API/gtk/WebKitBatteryProvider.h: Removed.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):
* UIProcess/WebBatteryManagerProxy.cpp: Removed.
* UIProcess/WebBatteryManagerProxy.h: Removed.
* UIProcess/WebBatteryManagerProxy.messages.in: Removed.
* UIProcess/WebBatteryProvider.cpp: Removed.
* UIProcess/WebBatteryProvider.h: Removed.
* UIProcess/WebProcessPool.cpp:
(WebKit::m_hiddenPageThrottlingTimer):
* UIProcess/efl/BatteryProvider.cpp: Removed.
* UIProcess/efl/BatteryProvider.h: Removed.
* WebProcess/Battery: Removed.
* WebProcess/Battery/WebBatteryManager.cpp: Removed.
* WebProcess/Battery/WebBatteryManager.h: Removed.
* WebProcess/Battery/WebBatteryManager.messages.in: Removed.
* WebProcess/WebCoreSupport/WebBatteryClient.cpp: Removed.
* WebProcess/WebCoreSupport/WebBatteryClient.h: Removed.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
* WebProcess/WebProcess.cpp:
(WebKit::m_resourceLoadStatisticsStorage):
2016-11-02 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkSession: Add NetworkDataTask implementation for blobs
https://bugs.webkit.org/show_bug.cgi?id=163939
Reviewed by Alex Christensen.
Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
is enabled.
* CMakeLists.txt: Add new files to compilation.
* NetworkProcess/Downloads/BlobDownloadClient.cpp:
* NetworkProcess/Downloads/BlobDownloadClient.h:
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
reveices a NetworkDataTask and is used by Soup backend and blobs.
(WebKit::Download::~Download):
(WebKit::Download::start):
(WebKit::Download::startWithHandle):
(WebKit::Download::cancel):
(WebKit::Download::didReceiveAuthenticationChallenge):
(WebKit::Download::didReceiveData):
(WebKit::Download::didFinish):
(WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
* NetworkProcess/Downloads/Download.h:
(WebKit::Download::Download):
(WebKit::Download::suggestedName):
(WebKit::Download::request):
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
(WebKit::DownloadManager::continueDecidePendingDownloadDestination):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::platformCancelNetworkLoad):
* NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
using NetworkSession.
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
* NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
* NetworkProcess/NetworkDataTaskBlob.cpp: Added.
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
(WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
(WebKit::NetworkDataTaskBlob::clearStream):
(WebKit::NetworkDataTaskBlob::resume):
(WebKit::NetworkDataTaskBlob::suspend):
(WebKit::NetworkDataTaskBlob::cancel):
(WebKit::NetworkDataTaskBlob::invalidateAndCancel):
(WebKit::NetworkDataTaskBlob::getSizeForNext):
(WebKit::NetworkDataTaskBlob::didGetSize):
(WebKit::NetworkDataTaskBlob::seek):
(WebKit::NetworkDataTaskBlob::didReceiveResponse):
(WebKit::NetworkDataTaskBlob::read):
(WebKit::NetworkDataTaskBlob::readData):
(WebKit::NetworkDataTaskBlob::readFile):
(WebKit::NetworkDataTaskBlob::didOpen):
(WebKit::NetworkDataTaskBlob::didRead):
(WebKit::NetworkDataTaskBlob::consumeData):
(WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
(WebKit::NetworkDataTaskBlob::suggestedFilename):
(WebKit::NetworkDataTaskBlob::download):
(WebKit::NetworkDataTaskBlob::writeDownload):
(WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
(WebKit::NetworkDataTaskBlob::didFailDownload):
(WebKit::NetworkDataTaskBlob::didFinishDownload):
(WebKit::NetworkDataTaskBlob::didFail):
(WebKit::NetworkDataTaskBlob::didFinish):
* NetworkProcess/NetworkDataTaskBlob.h: Added.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
(WebKit::NetworkLoad::~NetworkLoad):
(WebKit::NetworkLoad::setDefersLoading):
(WebKit::NetworkLoad::cancel):
(WebKit::NetworkLoad::continueWillSendRequest):
(WebKit::NetworkLoad::continueDidReceiveResponse):
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
(WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::registerNetworkDataTask): Ditto.
(WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
because in Cocoa all tasks are invalidated and canceled by the network session.
* NetworkProcess/mac/NetworkLoadMac.mm:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::download):
* NetworkProcess/soup/NetworkDataTaskSoup.h:
* NetworkProcess/soup/NetworkSessionSoup.cpp:
* NetworkProcess/soup/NetworkSessionSoup.h:
* PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
* PlatformGTK.cmake: Ditto.
* WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
2016-11-02 Andy Estes <aestes@apple.com>
REGRESSION (r199558): File paths selected for upload are stored using the wrong string encoding
https://bugs.webkit.org/show_bug.cgi?id=164311
<rdar://problem/26995374>
Reviewed by Tim Horton.
-[NSURL fileSystemRepresentation] returns a char* in file system representation, which on
iOS is UTF-8, but we were implicitly converting it to a String, which assumes a char* is
Latin-1 encoded.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Changed to use fromUTF8() to
convert fileURL.fileSystemRepresentation to a String.
2016-11-02 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkSession: Network process crash when converting main resource to download
https://bugs.webkit.org/show_bug.cgi?id=164220
Reviewed by Alex Christensen.
Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
created yet. That's not expected to happen and when the response completion handler is called in the
NetworkDataTask it tries to use either the client or the download and it crashes.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): Update ASSERT, because abort doesn't cleanup the
resource loader in case it's becoming a download.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
(WebKit::NetworkResourceLoader::isBecomingDownload): Helper method to check if the resource load was converted to a
download, but didBecomeDownload() hasn't been called yet.
(WebKit::NetworkResourceLoader::abort): If the resource load is becoming a download do not call cleanup()
because it will be called by didBecomeDownload() later.
* NetworkProcess/NetworkResourceLoader.h:
2016-11-02 David Kilzer <ddkilzer@apple.com>
Add logging for "WebKit encountered an internal error" messages
<https://webkit.org/b/164272>
<rdar://problem/28546064>
Reviewed by Alex Christensen.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResource):
- Add logging for various internalError() events.
2016-11-02 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
https://bugs.webkit.org/show_bug.cgi?id=164303
Reviewed by Michael Catanzaro.
This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap
BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error.
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
(WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
(WebKit::AcceleratedBackingStoreX11::update):
2016-11-02 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
https://bugs.webkit.org/show_bug.cgi?id=164315
Reviewed by Michael Catanzaro.
* Shared/gtk/ProcessExecutablePathGtk.cpp:
(WebKit::getExecutablePath):
(WebKit::findWebKitProcess):
* UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp:
(API::WebsiteDataStore::defaultNetworkCacheDirectory):
(API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
(API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkit_web_context_set_favicon_database_directory):
(webkit_web_context_set_additional_plugins_directory):
(webkit_web_context_set_disk_cache_directory):
* UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
(webkitWebsiteDataManagerGetDataStore):
* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::PluginInfoCache::PluginInfoCache):
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::platformDefaultIconDatabasePath):
* WebProcess/gtk/WebGtkExtensionManager.cpp:
(WebKit::parseUserData):
2016-11-02 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Enable creation of ReadableByteStreamController
https://bugs.webkit.org/show_bug.cgi?id=164014
Reviewed by Youenn Fablet.
Added flag for the byte stream part of Readable Streams API.
* Configurations/FeatureDefines.xcconfig:
2016-11-02 Carlos Garcia Campos <cgarcia@igalia.com>
PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
https://bugs.webkit.org/show_bug.cgi?id=164103
Reviewed by Michael Catanzaro.
Follow symlinks when scanning plugins to avoid duplicates.
* UIProcess/Plugins/gtk/PluginInfoCache.cpp: Bump the cache version to ensure duplicated plugins are removed
from the cache.
* UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
(WebKit::PluginInfoStore::pluginPathsInDirectory): Use realpath() to always return the actual file path.
2016-11-02 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Plugin process crash in WebKit::NetscapePluginX11::visibilityDidChange with evince browser plugin
https://bugs.webkit.org/show_bug.cgi?id=164204
Reviewed by Michael Catanzaro.
Check the platform plugin widget is embedded before trying to get its socket window.
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
(WebKit::NetscapePluginX11::geometryDidChange):
(WebKit::NetscapePluginX11::visibilityDidChange):
2016-11-01 Wenson Hsieh <wenson_hsieh@apple.com>
Turn the Input Events runtime flag on by default
https://bugs.webkit.org/show_bug.cgi?id=164297
Reviewed by Ryosuke Niwa.
* Shared/WebPreferencesDefinitions.h:
2016-11-01 Jaehun Lim <ljaehun.lim@samsung.com>
Unreviewed, EFL build fix after r208225
Rename ViewState to ActivityState
* UIProcess/efl/WebView.cpp:
(WebKit::WebView::setActive):
(WebKit::WebView::setFocused):
(WebKit::WebView::setVisible):
2016-11-01 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* PlatformMac.cmake:
2016-11-01 Ryosuke Niwa <rniwa@webkit.org>
Remove CUSTOM_ELEMENTS build flag
https://bugs.webkit.org/show_bug.cgi?id=164267
Reviewed by Antti Koivisto.
Removed the build flag.
* Configurations/FeatureDefines.xcconfig:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-11-01 Eric Carlson <eric.carlson@apple.com>
[MediaStream] restrict media capture secure connections
https://bugs.webkit.org/show_bug.cgi?id=164234
<rdar://problem/28944906>
Reviewed by Alex Christensen.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetMediaCaptureRequiresSecureConnection):
(WKPreferencesGetMediaCaptureRequiresSecureConnection):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Drive by
fix: remove some unused parameters in a lambda call.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-11-01 Gavin Barraclough <barraclough@apple.com>
Add IsAudible, IsLoading to ActivityState
https://bugs.webkit.org/show_bug.cgi?id=164286
Reviewed by Geoff Garen.
By computing these values in the UIProcess and passing them to WebContent we can
more closely unify iOS & macOS throttling, and remove the PageThrottler class.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateActivityState):
- Added update for IsAudible, IsLoading flags.
(WebKit::WebPageProxy::updateThrottleState):
- Read IsAudible, IsLoading flags from ActivityState.
(WebKit::WebPageProxy::setMuted):
- call activityStateDidChange to trigger update.
(WebKit::WebPageProxy::isPlayingMediaDidChange):
- call activityStateDidChange to trigger update.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isLoadingChanged):
- call activityStateDidChange to trigger update.
2016-10-31 Gavin Barraclough <barraclough@apple.com>
Rename ViewState to ActivityState
https://bugs.webkit.org/show_bug.cgi?id=164254
Reviewed by Andreas Kling.
We plan to add a couple more flags to ViewState that aren't directly related to the view
itself - whether there is an ongoing page load, and whether whether there is audio playback.
This will allow viewState (now activityState) to fully drive throttling decisions.
Renaming this bitfield accordingly.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView didMoveToWindow]):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
(_WebKitWebViewBasePrivate::updateActivityStateTimerFired):
(webkitWebViewBaseScheduleUpdateActivityState):
(toplevelWindowFocusInEvent):
(toplevelWindowFocusOutEvent):
(toplevelWindowStateEvent):
(webkitWebViewBaseSetToplevelOnScreenWindow):
(webkitWebViewBaseMap):
(webkitWebViewBaseUnmap):
(webkitWebViewBaseSetFocus):
(webkitWebViewBaseIsInWindowActive):
(webkitWebViewBaseIsFocused):
(webkitWebViewBaseIsVisible):
(webkitWebViewBaseIsInWindow):
(_WebKitWebViewBasePrivate::updateViewStateTimerFired): Deleted.
(webkitWebViewBaseScheduleUpdateViewState): Deleted.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::becomeFirstResponder):
(WebKit::WebViewImpl::resignFirstResponder):
(WebKit::WebViewImpl::windowDidOrderOffScreen):
(WebKit::WebViewImpl::windowDidOrderOnScreen):
(WebKit::WebViewImpl::windowDidBecomeKey):
(WebKit::WebViewImpl::windowDidResignKey):
(WebKit::WebViewImpl::windowDidMiniaturize):
(WebKit::WebViewImpl::windowDidDeminiaturize):
(WebKit::WebViewImpl::windowDidChangeOcclusionState):
(WebKit::WebViewImpl::viewDidMoveToWindow):
(WebKit::WebViewImpl::viewDidHide):
(WebKit::WebViewImpl::viewDidUnhide):
(WebKit::WebViewImpl::activeSpaceDidChange):
(WebKit::WebViewImpl::endDeferringViewInWindowChanges):
(WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
(WebKit::WebViewImpl::prepareForMoveToWindow):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::DrawingAreaProxy::waitForDidUpdateViewState): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::setSuppressVisibilityUpdates):
(WebKit::WebPageProxy::updateActivityState):
(WebKit::WebPageProxy::activityStateDidChange):
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::updateThrottleState):
(WebKit::WebPageProxy::waitForDidUpdateActivityState):
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
(WebKit::WebPageProxy::updateViewState): Deleted.
(WebKit::WebPageProxy::viewStateDidChange): Deleted.
(WebKit::WebPageProxy::dispatchViewStateChange): Deleted.
(WebKit::WebPageProxy::waitForDidUpdateViewState): Deleted.
(WebKit::WebPageProxy::installViewStateChangeCompletionHandler): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isInWindow):
(WebKit::WebPageProxy::didUpdateActivityState):
(WebKit::WebPageProxy::isViewVisible):
(WebKit::WebPageProxy::didUpdateViewState): Deleted.
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::windowServerConnectionStateChanged):
* UIProcess/efl/WebView.cpp:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _applicationDidEnterBackground]):
(-[WKContentView _applicationWillEnterForeground]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _applicationDidEnterBackground]):
(-[WKPDFView _applicationWillEnterForeground]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
(WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::activityStateDidChange):
(WebKit::PluginView::viewStateDidChange): Deleted.
* WebProcess/Plugins/PluginView.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::activityStateDidChange):
(WebKit::AcceleratedDrawingArea::viewStateDidChange): Deleted.
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::activityStateDidChange):
(WebKit::DrawingArea::viewStateDidChange): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::updateIsInWindow):
(WebKit::WebPage::setActivityState):
(WebKit::WebPage::setViewState): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::isVisible):
(WebKit::WebPage::isVisibleOrOccluded):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
(WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Deleted.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
(WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
(WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): Deleted.
(WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): Deleted.
2016-10-31 Jaehun Lim <ljaehun.lim@samsung.com>
Unreviewed, CMake build fix
Adds #include <WebCore/IDBGetAllRecordsData.h>
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Add basic visual/layout viewport support for fixed position layout
https://bugs.webkit.org/show_bug.cgi?id=164261
Reviewed by Dean Jackson.
Don't make visualViewportEnabled an experimental feature, because I don't want it enabled
by default in WebKitTestRunner (and therefore mismatching DumpRenderTree).
* Shared/WebPreferencesDefinitions.h:
2016-10-29 Filip Pizlo <fpizlo@apple.com>
JSC should support SharedArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=163986
Reviewed by Keith Miller.
Adds some small things we need for SharedArrayBuffer.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::createWebDataFromUint8Array):
2016-10-31 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
<rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
Reviewed by Darin Adler.
- Handle moving "Get All" requests to and from the DatabaseProcess.
- Handle the additional task of creating/passing Sandbox Extensions for
referenced files when necessary.
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::handleGetResult):
(WebKit::WebIDBConnectionToClient::didGetAllRecords):
(WebKit::WebIDBConnectionToClient::getAllRecords):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
* Shared/WebCoreArgumentCoders.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::getAllRecords):
(WebKit::preregisterSandboxExtensionsIfNecessary):
(WebKit::WebIDBConnectionToServer::didGetAllRecords):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2016-10-31 Wenson Hsieh <wenson_hsieh@apple.com>
[WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
https://bugs.webkit.org/show_bug.cgi?id=164236
<rdar://problem/28747712>
Reviewed by Beth Dakin.
See WebCore ChangeLog for more detail. Removes m_isGettingDictionaryPopupInfo from the WebPage in favor of
keeping track of the same state in Editor, so that both the WK1 and WK2 cases can share the same codepath.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didChangeSelection):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::dictionaryPopupInfoForRange):
2016-10-31 Simon Fraser <simon.fraser@apple.com>
Implement IntersectionObserver
https://bugs.webkit.org/show_bug.cgi?id=159475
Reviewed by Ryosuke Niwa.
Add ENABLE_INTERSECTION_OBSERVER, enabled by default.
* Configurations/FeatureDefines.xcconfig:
2016-10-31 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r208154.
This change caused an assertion failure during API tests on
macOS.
Reverted changeset:
"NetworkSession: Network process crash when converting main
resource to download"
https://bugs.webkit.org/show_bug.cgi?id=164220
http://trac.webkit.org/changeset/208154
2016-10-28 Brent Fulgham <bfulgham@apple.com>
Do a better job of protecting Frame objects in the context of JavaScript calls
https://bugs.webkit.org/show_bug.cgi?id=164163
<rdar://problem/28955249>
Reviewed by Darin Adler.
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertTextAsync): Ditto.
(WebKit::WebPage::setComposition): Ditto.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::insertDictatedTextAsync): Ditto.
2016-10-31 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkSession: Network process crash when converting main resource to download
https://bugs.webkit.org/show_bug.cgi?id=164220
Reviewed by Alex Christensen.
Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
created yet. That's not expected to happen and when the response completion handler is called in the
NetworkDataTask it tries to use either the client or the download and it crashes.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
(WebKit::NetworkResourceLoader::abort): If we still have a network load that was converted to a download, do not
call cleanup() because it will be called by didBecomeDownload() later.
2016-10-31 Darin Adler <darin@apple.com>
Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
https://bugs.webkit.org/show_bug.cgi?id=164214
Reviewed by Alex Christensen.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_query_selector): Updated exception handling.
(webkit_dom_document_query_selector_all): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
(webkit_dom_document_fragment_query_selector): Ditto.
(webkit_dom_document_fragment_query_selector_all): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_query_selector): Ditto.
(webkit_dom_element_query_selector_all): Ditto.
2016-10-31 Darin Adler <darin@apple.com>
Convert Document from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164212
Reviewed by Alex Christensen.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_create_element): Updated exception handling.
(webkit_dom_document_create_cdata_section): Ditto.
(webkit_dom_document_create_processing_instruction): Ditto.
(webkit_dom_document_create_attribute): Ditto.
(webkit_dom_document_import_node): Ditto.
(webkit_dom_document_create_element_ns): Ditto.
(webkit_dom_document_create_attribute_ns): Ditto.
(webkit_dom_document_adopt_node): Ditto.
(webkit_dom_document_create_event): Ditto.
(webkit_dom_document_set_xml_version): Ditto.
(webkit_dom_document_get_cookie): Ditto.
(webkit_dom_document_set_cookie): Ditto.
(webkit_dom_document_set_body): Ditto.
* WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
(-[WKDOMDocument createElement:]): Ditto.
2016-10-31 Wenson Hsieh <wenson_hsieh@apple.com>
Holding down a key to choose an accented character should fire "insertReplacementText" input events
https://bugs.webkit.org/show_bug.cgi?id=164209
<rdar://problem/29019305>
Reviewed by Darin Adler.
When replacing text, call Editor::insertText with the correct TextEventInputType so that WebCore will know to
use EditActionInsertReplacement when creating and applying the corresponding TypingCommand. Additional minor
changes in order to support testing replacement text insertion.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _insertText:replacementRange:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertTextAsync):
2016-10-30 Darin Adler <darin@apple.com>
Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164206
Reviewed by Chris Dumez.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
(webkit_dom_named_node_map_set_named_item): Updated exception handling.
(webkit_dom_named_node_map_remove_named_item): Ditto.
(webkit_dom_named_node_map_set_named_item_ns): Ditto.
(webkit_dom_named_node_map_remove_named_item_ns): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_set_attribute): Ditto.
(webkit_dom_element_set_attribute_node): Ditto.
(webkit_dom_element_remove_attribute_node): Ditto.
(webkit_dom_element_set_attribute_ns): Ditto.
(webkit_dom_element_set_attribute_node_ns): Ditto.
(webkit_dom_element_matches): Ditto.
(webkit_dom_element_closest): Ditto.
(webkit_dom_element_webkit_matches_selector): Ditto.
(webkit_dom_element_insert_adjacent_element): Ditto.
(webkit_dom_element_insert_adjacent_html): Ditto.
(webkit_dom_element_insert_adjacent_text): Ditto.
(webkit_dom_element_set_inner_html): Ditto.
(webkit_dom_element_set_outer_html): Ditto.
* WebProcess/InjectedBundle/API/mac/WKDOMElement.mm:
(-[WKDOMElement setAttribute:value:]): Ditto.
2016-10-30 Yusuke Suzuki <utatane.tea@gmail.com>
[DOM] Introduce WebCore::jsDynamicDowncast
https://bugs.webkit.org/show_bug.cgi?id=164137
Reviewed by Darin Adler.
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::elementForNodeHandle):
2016-10-29 Darin Adler <darin@apple.com>
Convert more of DOM from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=164173
Reviewed by Ryosuke Niwa.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
(webkit_dom_character_data_substring_data): Updated since this
now uses ExceptionOr.
(webkit_dom_character_data_insert_data): Ditto.
(webkit_dom_character_data_delete_data): Ditto.
(webkit_dom_character_data_replace_data): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
(webkit_dom_text_replace_whole_text): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
(webkit_dom_text_split_text): Ditto.
2016-10-28 Darin Adler <darin@apple.com>
Move all classes in the HTML directory from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163876
Reviewed by Sam Weinig.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
(webkit_dom_dom_token_list_add): Updated exception handling.
(webkit_dom_dom_token_list_remove): Ditto.
(webkit_dom_dom_token_list_toggle): Ditto.
(webkit_dom_dom_token_list_replace): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_remove): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
(webkit_dom_html_element_set_inner_text): Ditto.
(webkit_dom_html_element_set_outer_text): Ditto.
(webkit_dom_html_element_set_content_editable): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
(webkit_dom_html_input_element_set_max_length): Ditto.
(webkit_dom_html_input_element_set_size): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
(webkit_dom_html_select_element_set_length): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
(webkit_dom_html_table_element_insert_row): Ditto.
(webkit_dom_html_table_element_delete_row): Ditto.
(webkit_dom_html_table_element_set_caption): Ditto.
(webkit_dom_html_table_element_set_t_head): Ditto.
(webkit_dom_html_table_element_set_t_foot): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
(webkit_dom_html_table_row_element_insert_cell): Ditto.
(webkit_dom_html_table_row_element_delete_cell): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
(webkit_dom_html_table_section_element_insert_row): Ditto.
(webkit_dom_html_table_section_element_delete_row): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState): Removed ASSERT_NO_EXCEPTION.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setAssistedNodeValueAsNumber): Removed ASSERT_NO_EXCEPTION.
* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionManager::seekableRangesChanged):
Changed the code to use a different interface to TimeRange that does
not involve exceptions.
2016-10-28 Wenson Hsieh <wenson_hsieh@apple.com>
iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
https://bugs.webkit.org/show_bug.cgi?id=164077
<rdar://problem/28987810>
Reviewed by Simon Fraser.
Small tweak to mark text insertion when autocorrecting as such, as opposed to regular keyboard input.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::syncApplyAutocorrection):
2016-10-28 Megan Gardner <megan_gardner@apple.com>
Rename SharedMemoryMac to SharedMemoryCocoa
https://bugs.webkit.org/show_bug.cgi?id=164156
Reviewed by Alex Christensen.
Renamed SharedMemoryMac to SharedMemoryCocoa, as it runs on all cocoa platforms, not exclusively just mac, and
thus should be named to reflect that reality.
* Platform/cocoa: Added.
* Platform/cocoa/SharedMemoryCocoa.cpp: Copied from Source/WebKit2/Platform/mac/SharedMemoryMac.cpp.
* Platform/mac/SharedMemoryMac.cpp: Removed.
* WebKit2.xcodeproj/project.pbxproj:
2016-10-28 Antti Koivisto <antti@apple.com>
Enable CFNetwork connection cache fast lane for WebKit2
https://bugs.webkit.org/show_bug.cgi?id=164129
Reviewed by Andreas Kling.
The idea of this feature is keep a connection free for higher priority requests so low-priority
image loads can't take all the available connections.
We have this enabled on WK1 but not on WK2. See what enabling it does for performance in bots.
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::initializeNetworkSettings):
Based on code inspection setting kHTTPMinimumFastLanePriority is not sufficient to enable this feature,
kHTTPNumFastLanes needs also be set to a non-zero value. Use the same constants as WK1.
Also enable this on Mac to unify behavior.
2016-10-27 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] New stable DOM API headers should be included from webkitdom.h
https://bugs.webkit.org/show_bug.cgi?id=164069
Reviewed by Carlos Garcia Campos.
* WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
2016-10-27 Simon Fraser <simon.fraser@apple.com>
Fix when building against the MacOSX10.12.sdk where "macos" is not recognized
in the availability macros.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
2016-10-27 Megan Gardner <megan_gardner@apple.com>
Add support for wide gamut for ShareableBitmap for image popovers
https://bugs.webkit.org/show_bug.cgi?id=164001
Reviewed by Simon Fraser.
Added suppport for wide gamut in ShareableBitmap. SharableBitmaps now know the size of their pixels,
and that data is passed back and forth between the processes. The callers of SharedBitmap will determine
if their image should support wide gamut, but ShareableBitmap will override a set flag on a device that
is incapbable of supporting a wide gamut image.
This makes it possible to show wide gamut images in image popovers on iOS.
This is currently untestable, so no tests added.
* Platform/IPC/Decoder.cpp:
(IPC::Decoder::decode):
* Platform/IPC/Decoder.h:
* Platform/IPC/Encoder.cpp:
(IPC::Encoder::encode):
* Platform/IPC/Encoder.h:
* Shared/ShareableBitmap.cpp:
(WebKit::bytesPerPixel):
(WebKit::ShareableBitmap::Handle::encode):
(WebKit::ShareableBitmap::Handle::decode):
(WebKit::ShareableBitmap::Handle::clear):
(WebKit::ShareableBitmap::create):
(WebKit::ShareableBitmap::createShareable):
(WebKit::ShareableBitmap::createHandle):
(WebKit::ShareableBitmap::ShareableBitmap):
* Shared/ShareableBitmap.h:
(WebKit::ShareableBitmap::numBytesForSize):
(WebKit::ShareableBitmap::sizeInBytes):
* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::bitmapInfo):
(WebKit::ShareableBitmap::createGraphicsContext):
(WebKit::ShareableBitmap::createCGImage):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
2016-10-27 Wenson Hsieh <wenson_hsieh@apple.com>
Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163948
<rdar://problem/28921433>
Reviewed by Darin Adler.
Add support for new drag and drop-related EditAction enum values.
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):
2016-10-26 Chris Dumez <cdumez@apple.com>
Replace IDBKeyPath with a WTF::Variant
https://bugs.webkit.org/show_bug.cgi?id=163909
Reviewed by Darin Adler.
Add coders to encode / decode IDBKeyPath type for IPC.
* Shared/Databases/IndexedDB/WebIDBResult.cpp:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<IDBKeyPath>::encode):
(IPC::ArgumentCoder<IDBKeyPath>::decode):
* Shared/WebCoreArgumentCoders.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2016-10-26 Brian Burg <bburg@apple.com>
Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
https://bugs.webkit.org/show_bug.cgi?id=164046
Reviewed by Joseph Pecoraro.
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::sendMessageToFrontend):
* WebProcess/WebPage/WebInspector.h:
2016-10-26 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add "has capture device" bit to media state flags
https://bugs.webkit.org/show_bug.cgi?id=163952
Unreviewed fix after r207839.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setMuted): Take an MutedStateFlags, not a bool.
* WebProcess/WebPage/WebPage.h:
2016-10-26 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.1 release.
* gtk/NEWS: Add release notes for 2.15.1.
2016-10-26 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r206505) [GTK] Build broken with GTK+ 3.14
https://bugs.webkit.org/show_bug.cgi?id=162776
Reviewed by Xabier Rodriguez-Calvar.
Do not use gtk_widget_get_action_group() when GTK+ < 3.16, use g_object_set instead to attach the action group
to the menu widget.
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::append):
(WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
(WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
2016-10-25 Alex Christensen <achristensen@webkit.org>
CMake build fix.
* PlatformMac.cmake:
* Shared/WebHitTestResultData.cpp:
(WebKit::WebHitTestResultData::WebHitTestResultData):
Explicitly call AtomicString::string to make the String constructor no longer ambiguous.
It couldn't decide whether to use operator const String& or operator NSString*.
2016-10-25 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Network process assertion in NetworkDataTask::continueHTTPRedirection
https://bugs.webkit.org/show_bug.cgi?id=163941
Reviewed by Michael Catanzaro.
equalLettersIgnoringASCIICase() expects the second argument to be the letters to compare in lowercase, so use
"get" instead of "GET".
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
2016-10-25 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add "has capture device" bit to media state flags
https://bugs.webkit.org/show_bug.cgi?id=163952
Reviewed by Sam Weinig.
* UIProcess/API/C/WKPage.cpp:
(WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
* UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
2016-10-25 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207827 and r207828.
https://bugs.webkit.org/show_bug.cgi?id=163965
Caused LayoutTest webaudio/web-audio-is-playing.html to time
out on macOS. (Requested by ryanhaddad on #webkit).
Reverted changesets:
"[MediaStream] Add "has capture device" bit to media state
flags"
https://bugs.webkit.org/show_bug.cgi?id=163952
http://trac.webkit.org/changeset/207827
"[MediaStream] Add "has capture device" bit to media state
flags"
https://bugs.webkit.org/show_bug.cgi?id=163952
http://trac.webkit.org/changeset/207828
2016-10-25 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add "has capture device" bit to media state flags
https://bugs.webkit.org/show_bug.cgi?id=163952
Reviewed by Sam Weinig.
* UIProcess/API/C/WKPage.cpp:
(WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
* UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
2016-10-25 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r207494.
iOS SDK has been updated on the bots now so rollout the
rollout
Reverted changeset:
"Unreviewed, rolling out r207413."
https://bugs.webkit.org/show_bug.cgi?id=163547
http://trac.webkit.org/changeset/207494
2016-10-25 Jonathan Bedard <jbedard@apple.com>
Unreviewed build fix.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _fullscreenDelegate]): Removed unneeded parenthesis.
2016-10-19 Jer Noble <jer.noble@apple.com>
Add WKWebView fullscreen delegate SPI
https://bugs.webkit.org/show_bug.cgi?id=163674
Reviewed by Anders Carlsson.
Add a new SPI property to WKWebView allowing clients to be notified when fullscreen mode enters and exits.
* UIProcess/API/APIFullscreenClient.h: Added.
(API::FullscreenClient::~FullscreenClient):
(API::FullscreenClient::willEnterFullscreen):
(API::FullscreenClient::didEnterFullscreen):
(API::FullscreenClient::willExitFullscreen):
(API::FullscreenClient::didExitFullscreen):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _setFullscreenDelegate:]):
(-[WKWebView _fullscreenDelegate]):
(-[WKWebView _isInFullscreen]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added.
* UIProcess/Cocoa/FullscreenClient.h: Added.
(WebKit::FullscreenClient::~FullscreenClient):
* UIProcess/Cocoa/FullscreenClient.mm: Added.
(WebKit::FullscreenClient::FullscreenClient):
(WebKit::FullscreenClient::delegate):
(WebKit::FullscreenClient::setDelegate):
(WebKit::FullscreenClient::willEnterFullscreen):
(WebKit::FullscreenClient::didEnterFullscreen):
(WebKit::FullscreenClient::willExitFullscreen):
(WebKit::FullscreenClient::didExitFullscreen):
* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::willExitFullScreen):
(WebKit::WebFullScreenManagerProxy::didExitFullScreen):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setFullscreenClient):
(WebKit::WebPageProxy::fullScreenManager): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::fullscreenClient):
* WebKit2.xcodeproj/project.pbxproj:
2016-10-25 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix timeouts in 12 GTK+ unit tests after r207812.
* NetworkProcess/NetworkProcessCreationParameters.h: Initialize loadThrottleLatency.
2016-10-25 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix Soup based ports debug build after r207813.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::authenticateCallback):
(WebKit::NetworkDataTaskSoup::requestStartedCallback):
2016-10-25 Andreas Kling <akling@apple.com>
More PassRefPtr purging in WebCore.
<https://webkit.org/b/163895>
Reviewed by Antti Koivisto.
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::createScrollbar):
2016-10-25 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkSession: switch to use subclasses for NetworkSession and NetworkDataTask implementations
https://bugs.webkit.org/show_bug.cgi?id=163777
Reviewed by Alex Christensen.
The subclass model allows us to choose the implementation at run time, so we could add other implementations
like a mock network class to measure performance, and even one for blobs and finally get rid of ResourceHandle
in WebKit2.
* CMakeLists.txt: Add new files to compilation.
* NetworkProcess/NetworkDataTask.cpp: Added.
(WebKit::NetworkDataTask::create): Create a NetworkDataTaskCocoa or NetworkDataTaskSoup.
(WebKit::NetworkDataTask::NetworkDataTask): Move common code from NetworkDataTaskCocoa and NetworkDataTaskSoup
here to handle the early failures.
(WebKit::NetworkDataTask::~NetworkDataTask):
(WebKit::NetworkDataTask::scheduleFailure):
(WebKit::NetworkDataTask::failureTimerFired):
* NetworkProcess/NetworkDataTask.h: Remove platform specific members.
(WebKit::NetworkDataTask::setPendingDownloadLocation): Make it virtual and set the m_pendingDownloadLocation.
(WebKit::NetworkDataTask::suggestedFilename): Make it virtual and const with a default implementation.
(WebKit::NetworkDataTask::setSuggestedFilename): Ditto.
(WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost): Ditto.
* NetworkProcess/NetworkLoad.cpp: Include NetworkDataTaskCocoa.h.
* NetworkProcess/NetworkLoad.h: Include NetworkDataTask.h instead of NetworkSession.h.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess): Use NetworkSessionCocoa.
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::create): Create a NetworkSessionCocoa or NetworkSessionSoup.
(WebKit::NetworkSession::defaultSession): In case of cocoa use NetworkSessionCocoa::defaultSession() because of
the custom protocol manager, otherwise simply create a default session.
(WebKit::NetworkSession::networkStorageSession): Move common code from NetworkSessionCocoa and
NetworkSessionSoup here.
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::~NetworkSession):
* NetworkProcess/NetworkSession.h: Remove platform specific members.
(WebKit::NetworkSession::invalidateAndCancel): Make it virtual.
(WebKit::NetworkSession::clearCredentials): Ditto.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: Include NetworkSession.h.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Added.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::didSendData):
(WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
(WebKit::NetworkDataTaskCocoa::didCompleteWithError):
(WebKit::NetworkDataTaskCocoa::didReceiveResponse):
(WebKit::NetworkDataTaskCocoa::didReceiveData):
(WebKit::NetworkDataTaskCocoa::didBecomeDownload):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCocoa::setPendingDownloadLocation):
(WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
(WebKit::NetworkDataTaskCocoa::transferSandboxExtensionToDownload):
(WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
(WebKit::NetworkDataTaskCocoa::suggestedFilename):
(WebKit::NetworkDataTaskCocoa::cancel):
(WebKit::NetworkDataTaskCocoa::resume):
(WebKit::NetworkDataTaskCocoa::suspend):
(WebKit::NetworkDataTaskCocoa::state):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.h: Added.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
(WebKit::configurationForSessionID):
(WebKit::NetworkSessionCocoa::setCustomProtocolManager):
(WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData):
(WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier):
(WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
(WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType):
(WebKit::NetworkSessionCocoa::create):
(WebKit::NetworkSessionCocoa::defaultSession):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
(WebKit::NetworkSessionCocoa::~NetworkSessionCocoa):
(WebKit::NetworkSessionCocoa::invalidateAndCancel):
(WebKit::NetworkSessionCocoa::clearCredentials):
(WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
(WebKit::NetworkSessionCocoa::addDownloadID):
(WebKit::NetworkSessionCocoa::downloadID):
(WebKit::NetworkSessionCocoa::takeDownloadID):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::suggestedFilename):
(WebKit::NetworkDataTaskSoup::setPendingDownloadLocation):
(WebKit::NetworkDataTaskSoup::createRequest):
(WebKit::NetworkDataTaskSoup::clearRequest):
(WebKit::NetworkDataTaskSoup::resume):
(WebKit::NetworkDataTaskSoup::suspend):
(WebKit::NetworkDataTaskSoup::cancel):
(WebKit::NetworkDataTaskSoup::invalidateAndCancel):
(WebKit::NetworkDataTaskSoup::state):
(WebKit::NetworkDataTaskSoup::timeoutFired):
(WebKit::NetworkDataTaskSoup::startTimeout):
(WebKit::NetworkDataTaskSoup::stopTimeout):
(WebKit::NetworkDataTaskSoup::sendRequestCallback):
(WebKit::NetworkDataTaskSoup::didSendRequest):
(WebKit::NetworkDataTaskSoup::didReceiveResponse):
(WebKit::NetworkDataTaskSoup::tlsErrorsChangedCallback):
(WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
(WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
(WebKit::NetworkDataTaskSoup::authenticateCallback):
(WebKit::NetworkDataTaskSoup::authenticate):
(WebKit::NetworkDataTaskSoup::continueAuthenticate):
(WebKit::NetworkDataTaskSoup::skipInputStreamForRedirectionCallback):
(WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
(WebKit::NetworkDataTaskSoup::didFinishSkipInputStreamForRedirection):
(WebKit::NetworkDataTaskSoup::shouldStartHTTPRedirection):
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
(WebKit::NetworkDataTaskSoup::readCallback):
(WebKit::NetworkDataTaskSoup::read):
(WebKit::NetworkDataTaskSoup::didRead):
(WebKit::NetworkDataTaskSoup::didFinishRead):
(WebKit::NetworkDataTaskSoup::requestNextPartCallback):
(WebKit::NetworkDataTaskSoup::requestNextPart):
(WebKit::NetworkDataTaskSoup::didRequestNextPart):
(WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
(WebKit::NetworkDataTaskSoup::gotHeadersCallback):
(WebKit::NetworkDataTaskSoup::didGetHeaders):
(WebKit::NetworkDataTaskSoup::wroteBodyDataCallback):
(WebKit::NetworkDataTaskSoup::didWriteBodyData):
(WebKit::NetworkDataTaskSoup::download):
(WebKit::NetworkDataTaskSoup::writeDownloadCallback):
(WebKit::NetworkDataTaskSoup::writeDownload):
(WebKit::NetworkDataTaskSoup::didWriteDownload):
(WebKit::NetworkDataTaskSoup::didFinishDownload):
(WebKit::NetworkDataTaskSoup::didFailDownload):
(WebKit::NetworkDataTaskSoup::cleanDownloadFiles):
(WebKit::NetworkDataTaskSoup::didFail):
(WebKit::NetworkDataTaskSoup::networkEventCallback):
(WebKit::NetworkDataTaskSoup::networkEvent):
(WebKit::NetworkDataTaskSoup::startingCallback):
(WebKit::NetworkDataTaskSoup::requestStartedCallback):
(WebKit::NetworkDataTaskSoup::didStartRequest):
(WebKit::NetworkDataTaskSoup::restartedCallback):
(WebKit::NetworkDataTaskSoup::didRestart):
* NetworkProcess/soup/NetworkDataTaskSoup.h: Added.
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup):
(WebKit::NetworkSessionSoup::~NetworkSessionSoup):
(WebKit::NetworkSessionSoup::soupSession):
(WebKit::NetworkSessionSoup::invalidateAndCancel):
* NetworkProcess/soup/NetworkSessionSoup.h: Added.
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
* PlatformEfl.cmake: Add new files to compilation.
* PlatformGTK.cmake: Ditto.
* WebKit2.xcodeproj/project.pbxproj: Ditto.
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Ditto.
2016-10-25 Antti Koivisto <antti@apple.com>
Add support for introducing simulated latency in network process
https://bugs.webkit.org/show_bug.cgi?id=163902
Reviewed by Alex Christensen.
For testing purposes it is useful to have a mechanism for simulating high latency.
This patch adds a basic mechanism that introduces a delay to each response in network
process. In Safari it can be used with
defaults write com.apple.Safari WebKitNetworkLoadThrottleLatencyMilliseconds 200
Setting the delay to 0 disables the feature.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::Throttle::Throttle):
(WebKit::NetworkLoad::didReceiveResponseNetworkSession):
(WebKit::NetworkLoad::notifyDidReceiveResponse):
(WebKit::NetworkLoad::didReceiveData):
(WebKit::NetworkLoad::didCompleteWithError):
(WebKit::NetworkLoad::throttleDelayCompleted):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::loadThrottleLatency):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
2016-10-24 Dan Bernstein <mitz@apple.com>
REGRESSION (r206410): Sandbox violations beneath WebProcessProxy::platformIsBeingDebugged
https://bugs.webkit.org/show_bug.cgi?id=163879
<rdar://problem/28728735>
Reviewed by Darin Adler.
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::platformIsBeingDebugged): Check if the current process, which is
the UI process, is sandboxed before trying to find out if the Web process is being
debugged.
2016-10-21 Alex Christensen <achristensen@webkit.org>
URL::port should return Optional<uint16_t>
https://bugs.webkit.org/show_bug.cgi?id=163806
Reviewed by Darin Adler.
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::overrideSystemProxies):
* Shared/API/APISecurityOrigin.h:
(API::SecurityOrigin::create):
* Shared/API/APIURL.h:
(API::URL::protocol):
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginGetPort):
* UIProcess/API/Cocoa/WKSecurityOrigin.mm:
(-[WKSecurityOrigin port]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::canHandleRequest):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::origin):
2016-10-24 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Separate media capture and audio playback muting
https://bugs.webkit.org/show_bug.cgi?id=163855
<rdar://problem/28827186>
Reviewed by Darin Adler.
* Shared/WebPageCreationParameters.h: Change 'muted' from bool to MutedStateFlags.
* UIProcess/API/C/WKPage.cpp: Change parameter from bool to WKMediaMutedState.
(WKPageSetMuted):
* UIProcess/API/C/WKPagePrivate.h: Define WKMediaMutedState.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setMuted): m_muted -> m_mutedState.
(WebKit::WebPageProxy::creationParameters): Ditto.
* UIProcess/WebPageProxy.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::isMuted): page.isMuted -> page.mutedState.
* WebProcess/WebPage/WebPage.messages.in: Change SetMuted parameter.
2016-10-24 Youenn Fablet <youenn@apple.com>
Activate WEB_RTC compilation flags for Mac bots
https://bugs.webkit.org/show_bug.cgi?id=163886
Reviewed by Eric Carlson.
* Configurations/FeatureDefines.xcconfig:
2016-10-24 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBIndex name assignment.
<rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
Reviewed by Alex Christensen.
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::didRenameIndex):
(WebKit::WebIDBConnectionToClient::renameIndex):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::renameIndex):
(WebKit::WebIDBConnectionToServer::didRenameIndex):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2016-10-23 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Remove DO NOT MODIFY headers from files that are no longer autogenerated
https://bugs.webkit.org/show_bug.cgi?id=163867
Reviewed by Darin Adler.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttrPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlobPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASectionPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleListPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRulePrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclarationPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheetPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterDataPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCommentPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementationPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelectionPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenListPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowUnstable.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentUnstable.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentTypePrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentUnstable.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementUnstable.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileListPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFilePrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollectionPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocumentPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementUnstable.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollectionPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElementPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEventPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaListPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEventPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMapPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIteratorPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeListPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstructionPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangePrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangeUnstable.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetListPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTextPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalkerPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEventPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEventPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpressionPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolverPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResultPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
* WebProcess/InjectedBundle/API/gtk/DOM/webkitdomautocleanups.h:
* WebProcess/InjectedBundle/API/gtk/DOM/webkitdomdefines.h:
2016-10-23 Chris Dumez <cdumez@apple.com>
Another unreviewed attempt to fix the WatchOS / TvOS build after r207585.
<rdar://problem/28902292>
Disable USE_CFURLCONNECTION on newer WatchOS / TvOS.
* config.h:
2016-10-23 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix WatchOS / TvOS build after r207585.
<rdar://problem/28902292>
Enable NETWORK_SESSION on those platforms.
* config.h:
2016-10-22 Dan Bernstein <mitz@apple.com>
[iOS] _webViewWillEndNavigationGesture:withNavigationToBackForwardListItem: is never called
https://bugs.webkit.org/show_bug.cgi?id=163758
Reviewed by Darin Adler.
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture): Don’t reset the interactive update
handler.
2016-10-21 David Kilzer <ddkilzer@apple.com>
Bug 163762: IntSize::area() should used checked arithmetic
<https://webkit.org/b/163762>
Reviewed by Darin Adler.
* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::create): Add overflow check and return
nullptr on overflow.
(WebKit::ShareableBitmap::createShareable): Ditto.
(WebKit::ShareableBitmap::create): Change debug assert for
adequate buffer size check into release check.
* Shared/ShareableBitmap.h:
(WebKit::ShareableBitmap::numBytesForSize): Change to return a
Checked<unsigned, RecordOverflow> value.
(WebKit::ShareableBitmap::sizeInBytes):
* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::numBytesForSize): Ditto.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]): Call unsafeGet().
2016-10-21 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Dynamically generate media capture sandbox extensions
https://bugs.webkit.org/show_bug.cgi?id=154861
<rdar://problem/24909411>
Reviewed by Tim Horton.
* Shared/SandboxExtension.h:
(WebKit::SandboxExtension::createHandleForGenericExtension):
* Shared/mac/SandboxExtensionMac.mm:
(WebKit::wkSandboxExtensionType): Add case for generic handle.
(WebKit::SandboxExtension::createHandleForGenericExtension): New.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Clear the list of extensions granted.
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Extend the web
process sandbox as necessary.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Revoke all
sandbox extensions.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Consume
sandbox extensions.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Pass-through to user media manager.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Add GrantUserMediaDevicesSandboxExtension.
* WebProcess/com.apple.WebProcess.sb.in: Add rules, defines, and a macro to allow dynamic extensions
for media capture devices.
2016-10-21 Gavin Barraclough <barraclough@apple.com>
WebPageProxy should not need PageActivityState
https://bugs.webkit.org/show_bug.cgi?id=163821
Reviewed by Geoff Garen.
The PageActivityState is currently plumbed back from WebCore up to the UI process, to
determine whether to enabled process suppression. However the information it contains
(whether a page load is ongoing, whether audio is playing) is already available via
other means. Remove this use of PageActivityState.
* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::commitChanges):
- PageLoadState notifies WebPageProxy when loading state changes.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateThrottleState):
- Now relies on info from PageLoadState, setMuted, isPlayingMediaDidChange.
(WebKit::WebPageProxy::setMuted):
(WebKit::WebPageProxy::isPlayingMediaDidChange):
- If audio playback state changes we may need to update the throttle state.
(WebKit::WebPageProxy::setPageActivityState): Deleted.
- removed PageActivityState from WK2.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isLoadingChanged):
- PageLoadState notifies WebPageProxy when loading state changes.
* UIProcess/WebPageProxy.messages.in:
- removed PageActivityState from WK2.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::setPageActivityState): Deleted.
- removed PageActivityState from WK2.
* WebProcess/WebCoreSupport/WebChromeClient.h:
- removed PageActivityState from WK2.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setPageActivityState): Deleted.
- removed PageActivityState from WK2.
* WebProcess/WebPage/WebPage.h:
- removed PageActivityState from WK2.
2016-10-21 Gavin Barraclough <barraclough@apple.com>
WebPage should take UserActivity directly for user input
https://bugs.webkit.org/show_bug.cgi?id=163813
Reviewed by Anders Carlsson.
When we receive mouse/keyboard events in a page, we want to prevent AppNap. We currently do so
via the PageThrottler. This patch is to just make the WebPage drive the UserActivity directly.
Two reasons to do so: (1) to cleanup & simplify for further refactoring. (2) The current code
isn't really achieving the desired effect. The page setting the flag in the throttler to get
the activity to be set is now a less effective way of achieving this goal, since the
PageActivityState bounces back across to the UI process & then messages back to the WebContent
process to take the UserActivity. These extra hops defeat the purpose of making sure the boost
from the initial message isn't lost.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userActivityHysteresis):
- m_userActivityHysteresis triggers updateUserActivity.
(WebKit::WebPage::setPageSuppressed):
- setPageSuppressed starts/stops m_userActivityHysteresis.
(WebKit::WebPage::updateUserActivity):
- update UserActivity based on state of m_userActivityHysteresis.
(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::wheelEvent):
(WebKit::WebPage::keyEvent):
- input events impulse m_userActivityHysteresis.
* WebProcess/WebPage/WebPage.h:
2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents
https://bugs.webkit.org/show_bug.cgi?id=163460
<rdar://problem/28784142>
Reviewed by Darin Adler.
Handle new EditAction types for inserting/deleting pending/final compositions.
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):
2016-10-21 Jeremy Jones <jeremyj@apple.com>
Implement basic pointer lock behavior for WebKit and WebKit2.
https://bugs.webkit.org/show_bug.cgi?id=162745
Reviewed by Simon Fraser.
Enable basic pointer lock functionality by plumbing requests through WebPage IPC.
Pass through mouse movement deltas.
Unlock pointer when view is no longer visible.
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): Pass along mouse movement.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchViewStateChange): Unlock pointer when page is not visible.
(WebKit::WebPageProxy::requestPointerLock): Hide and disassociate pointer.
(WebKit::WebPageProxy::requestPointerUnlock): Show and associate pointer.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in: Add methods.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::requestPointerLock): Pass along to web page.
(WebKit::WebChromeClient::requestPointerUnlock): Ditto.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didAcquirePointerLock): Forward to PointerLockController.
(WebKit::WebPage::didNotAcquirePointerLock): Ditto.
(WebKit::WebPage::didLosePointerLock): Ditto.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Add methods.
2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com>
Implement InputEvent.getTargetRanges() for the input events spec
https://bugs.webkit.org/show_bug.cgi?id=162947
<rdar://problem/28853079>
Reviewed by Darin Adler.
Boilerplate change to add a runtime guard for InputEvents-related IDL interfaces. See WebCore ChangeLog entry
for more details.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Configures but fails to link with ENABLE_OPENGL=OFF
https://bugs.webkit.org/show_bug.cgi?id=163449
Reviewed by Michael Catanzaro.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER and also ensure the current
display is X11.
(webkitWebViewBaseUnrealize): Ditto.
(webkitWebViewBaseDidRelaunchWebProcess): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER.
(webkitWebViewBasePageClosed): Ditto.
* UIProcess/AcceleratedDrawingAreaProxy.cpp:
(WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState): Ditto.
(WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): Check EGL is enabled before
trying to use the WaylandCompositor.
* UIProcess/AcceleratedDrawingAreaProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess): Ditto.
* UIProcess/gtk/AcceleratedBackingStore.cpp:
(WebKit::AcceleratedBackingStore::create): Ditto.
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
* UIProcess/gtk/WaylandCompositor.cpp:
* UIProcess/gtk/WaylandCompositor.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER.
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/LayerTreeHost.h:
2016-10-20 Chris Dumez <cdumez@apple.com>
"Download Linked File" context menu action should use 'download' attribute as suggested filename
https://bugs.webkit.org/show_bug.cgi?id=163742
<rdar://problem/28840734>
Reviewed by Darin Adler.
Update "Download Linked File" context menu action to use the anchor
element's 'download' attribute as suggested filename for the download.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::downloadRequest):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Shared/WebHitTestResultData.cpp:
(WebKit::WebHitTestResultData::WebHitTestResultData):
(WebKit::WebHitTestResultData::encode):
(WebKit::WebHitTestResultData::decode):
* Shared/WebHitTestResultData.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::contextMenuItemSelected):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::download):
* UIProcess/WebProcessPool.h:
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
(WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
[macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
https://bugs.webkit.org/show_bug.cgi?id=163374
Reviewed by Darin Adler.
* Configurations/FeatureDefines.xcconfig:
2016-10-20 Brady Eidson <beidson@apple.com>
IndexedDB 2.0: Support IDBObjectStore name assignment.
<rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749
Reviewed by Alex Christensen.
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::didRenameObjectStore):
(WebKit::WebIDBConnectionToClient::renameObjectStore):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::renameObjectStore):
(WebKit::WebIDBConnectionToServer::didRenameObjectStore):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Avoid strstr() when checking (E)GL extensions
https://bugs.webkit.org/show_bug.cgi?id=161958
Reviewed by Žan Doberšek.
Use GLContext::isExtensionSupported() instead of strstr().
* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::initializeEGL):
2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com>
Wrong use of EGL_DEPTH_SIZE
https://bugs.webkit.org/show_bug.cgi?id=155536
Reviewed by Michael Catanzaro.
Use XErrorTrapper class instead of the custom XErrorHandler.
* PluginProcess/unix/PluginProcessMainUnix.cpp:
(WebKit::PluginProcessMainUnix):
2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Add NetworkSession implementation and switch to use it
https://bugs.webkit.org/show_bug.cgi?id=163597
Reviewed by Alex Christensen.
Basically move the ResourceHandle implementation to the network process, but modernized, cleaned up, and adapted
to the NetworkSession model.
* CMakeLists.txt: Add new files to compilation.
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::Download): Use the same code for all ports using NetworkSession and add missing
initialization of m_sessionID.
* NetworkProcess/Downloads/Download.h:
(WebKit::Download::Download): Define PlatformDownloadTaskRef on every platform to make the constructor common to
all ports using NetworkSession.
* NetworkProcess/Downloads/soup/DownloadSoup.cpp:
(WebKit::Download::cancelNetworkLoad):
(WebKit::Download::platformDidFinish):
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::pendingDownloadID): Make const.
(WebKit::NetworkDataTask::pendingDownload): Ditto.
(WebKit::NetworkDataTask::pendingDownloadLocation): Ditto.
(WebKit::NetworkDataTask::isDownload): Helper to check if the task is a download.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::didReceiveResponseNetworkSession): Use NetworkDataTask::isDownload().
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess): NetworkSession::setCustomProtocolManager() is Cocoa only.
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSession::networkStorageSession): Make const.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp: Added.
(WebKit::NetworkDataTask::NetworkDataTask):
(WebKit::NetworkDataTask::~NetworkDataTask):
(WebKit::NetworkDataTask::scheduleFailure):
(WebKit::NetworkDataTask::failureTimerFired):
(WebKit::NetworkDataTask::suggestedFilename):
(WebKit::NetworkDataTask::setSuggestedFilename):
(WebKit::NetworkDataTask::setPendingDownloadLocation):
(WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost):
(WebKit::NetworkDataTask::createRequest):
(WebKit::NetworkDataTask::clearRequest):
(WebKit::NetworkDataTask::resume):
(WebKit::NetworkDataTask::suspend):
(WebKit::NetworkDataTask::cancel):
(WebKit::NetworkDataTask::invalidateAndCancel):
(WebKit::NetworkDataTask::state):
(WebKit::NetworkDataTask::timeoutFired):
(WebKit::NetworkDataTask::startTimeout):
(WebKit::NetworkDataTask::stopTimeout):
(WebKit::NetworkDataTask::sendRequestCallback):
(WebKit::NetworkDataTask::didSendRequest):
(WebKit::NetworkDataTask::didReceiveResponse):
(WebKit::NetworkDataTask::tlsErrorsChangedCallback):
(WebKit::NetworkDataTask::tlsErrorsChanged):
(WebKit::NetworkDataTask::applyAuthenticationToRequest):
(WebKit::NetworkDataTask::authenticateCallback):
(WebKit::isAuthenticationFailureStatusCode):
(WebKit::NetworkDataTask::authenticate):
(WebKit::NetworkDataTask::continueAuthenticate):
(WebKit::NetworkDataTask::skipInputStreamForRedirectionCallback):
(WebKit::NetworkDataTask::skipInputStreamForRedirection):
(WebKit::NetworkDataTask::didFinishSkipInputStreamForRedirection):
(WebKit::shouldRedirectAsGET):
(WebKit::NetworkDataTask::shouldStartHTTPRedirection):
(WebKit::NetworkDataTask::continueHTTPRedirection):
(WebKit::NetworkDataTask::readCallback):
(WebKit::NetworkDataTask::read):
(WebKit::NetworkDataTask::didRead):
(WebKit::NetworkDataTask::didFinishRead):
(WebKit::NetworkDataTask::requestNextPartCallback):
(WebKit::NetworkDataTask::requestNextPart):
(WebKit::NetworkDataTask::didRequestNextPart):
(WebKit::NetworkDataTask::didFinishRequestNextPart):
(WebKit::NetworkDataTask::gotHeadersCallback):
(WebKit::NetworkDataTask::didGetHeaders):
(WebKit::NetworkDataTask::wroteBodyDataCallback):
(WebKit::NetworkDataTask::didWriteBodyData):
(WebKit::NetworkDataTask::download):
(WebKit::NetworkDataTask::writeDownloadCallback):
(WebKit::NetworkDataTask::writeDownload):
(WebKit::NetworkDataTask::didWriteDownload):
(WebKit::NetworkDataTask::didFinishDownload):
(WebKit::NetworkDataTask::didFailDownload):
(WebKit::NetworkDataTask::cleanDownloadFiles):
(WebKit::NetworkDataTask::didFail):
(WebKit::NetworkDataTask::networkEventCallback):
(WebKit::NetworkDataTask::networkEvent):
(WebKit::NetworkDataTask::startingCallback):
(WebKit::NetworkDataTask::requestStartedCallback):
(WebKit::NetworkDataTask::didStartRequest):
(WebKit::NetworkDataTask::restartedCallback):
(WebKit::NetworkDataTask::didRestart):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSession::create):
(WebKit::NetworkSession::defaultSession):
(WebKit::NetworkSession::networkStorageSession):
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::~NetworkSession):
(WebKit::NetworkSession::soupSession):
(WebKit::NetworkSession::invalidateAndCancel):
(WebKit::NetworkSession::clearCredentials):
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Add implementation matching
WebFrameNetworkingContext::ensurePrivateBrowsingSession().
(WebKit::RemoteNetworkingContext::storageSession): Do not always return the default session if the given one is
in the global map.
* PlatformEfl.cmake: Ad new files to compilation.
* PlatformGTK.cmake: Ditto.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Also create a NetworkSession.
* config.h: Enable NetworkSession unconditionally for Soup based ports.
2016-10-19 Alex Christensen <achristensen@webkit.org>
Revert r207151
https://bugs.webkit.org/show_bug.cgi?id=163675
Reviewed by Brent Fulgham.
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/mac/DownloadMac.mm:
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/mac/NetworkLoadMac.mm:
(WebKit::NetworkLoad::willCacheResponseAsync):
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::receivedCredential):
(WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
(WebKit::AuthenticationManager::receivedCancellation):
(WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
(WebKit::AuthenticationManager::receivedChallengeRejection):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
* WebKit2.xcodeproj/project.pbxproj:
2016-10-19 Chris Dumez <cdumez@apple.com>
[WK2] Expose suggested filename via WKBundleHitTestResult API
https://bugs.webkit.org/show_bug.cgi?id=163693
<rdar://problem/28840734>
Reviewed by Anders Carlsson.
Expose suggested filename via WKBundleHitTestResult API. The implementation
currently relies on the 'download' attribute on anchor / area elements
that we recently started supporting.
* WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
(WKBundleHitTestResultCopyLinkSuggestedFilename):
* WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
(WebKit::InjectedBundleHitTestResult::create):
(WebKit::InjectedBundleHitTestResult::mediaType):
(WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
(WebKit::InjectedBundleHitTestResult::imageRect):
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
2016-10-19 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207557.
This change caused animations/font-variations tests to time
out on pre-Sierra Macs.
Reverted changeset:
"[macOS] [iOS] Disable variation fonts on macOS El Capitan and
iOS 9"
https://bugs.webkit.org/show_bug.cgi?id=163374
http://trac.webkit.org/changeset/207557
2016-10-19 Andy Estes <aestes@apple.com>
Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
https://bugs.webkit.org/show_bug.cgi?id=163476
<rdar://problem/26941395>
Reviewed by Andreas Kling.
When custom content providers are registered and a response has a null MIME type, WebPage
will pass a null String to HashSet::contains(). This results in a null pointer dereference,
since the String hash functions do not support null Strings and unconditionally dereference
their StringImpls. Fixed by checking that Strings are non-null before calling
HashSet::contains() on m_mimeTypesWithCustomContentProviders.
New API test: WebKit2.LoadDataWithNilMIMEType.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::shouldUseCustomContentProviderForResponse): Checked if mimeType is null
before calling m_mimeTypesWithCustomContentProviders.contains().
(WebKit::WebPage::canShowMIMEType): Ditto.
* WebProcess/WebPage/WebPage.h: Made private the declaration of canPluginHandleResponse().
2016-10-19 Chris Dumez <cdumez@apple.com>
Move HTML Interactive Form Validation behind an experimental flag
https://bugs.webkit.org/show_bug.cgi?id=163673
Reviewed by Daniel Bates.
Move HTML Interactive Form Validation behind an experimental feature flag
and disable by default until by have a better UI.
* Shared/WebPreferencesDefinitions.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2016-10-19 Damian Kaleta <dkaleta@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=163292
Reviewed by Brady Eidson.
Added ability to display context menu asynchronously.
* Shared/API/APIObject.h: Added ContextMenuListener.
* Shared/API/c/WKBase.h: Added WKContextMenuListenerRef struct.
* UIProcess/API/APIContextMenuClient.h:
(API::ContextMenuClient::getContextMenuFromProposedMenuAsync): New method that allows showing context menu asynchronously.
* UIProcess/API/C/WKAPICast.h: Added a new mapping for WebContextMenuListenerProxy.
* UIProcess/API/C/WKContextMenuListener.cpp: Added. New class that allow a client to return results asynchronously.
(WKContextMenuListenerGetTypeID):
(WKContextMenuListenerUseContextMenuItems):
* UIProcess/API/C/WKContextMenuListener.h: Added.
* UIProcess/API/C/WKPage.cpp: Added WKPageContextMenuClientV4.
(WKPageSetPageContextMenuClient):
* UIProcess/API/C/WKPageContextMenuClient.h:
* UIProcess/WebContextMenuListenerProxy.cpp: Copied from Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h.
(WebKit::WebContextMenuListenerProxy::WebContextMenuListenerProxy):
(WebKit::WebContextMenuListenerProxy::~WebContextMenuListenerProxy):
(WebKit::WebContextMenuListenerProxy::useContextMenuItems): Passes items to m_contextMenuMac.
(WebKit::WebContextMenuListenerProxy::invalidate):
* UIProcess/WebContextMenuListenerProxy.h: Copied from Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h.
(WebKit::WebContextMenuListenerProxy::create):
* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::showContextMenuWithItems): Shows context menu.
(WebKit::WebContextMenuProxyMac::showContextMenu): Extracted some logic to showContextMenuWithItems().
* WebKit2.xcodeproj/project.pbxproj:
2016-10-19 Myles C. Maxfield <mmaxfield@apple.com>
[macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
https://bugs.webkit.org/show_bug.cgi?id=163374
Reviewed by Darin Adler.
* Configurations/FeatureDefines.xcconfig:
2016-10-19 Darin Adler <darin@apple.com>
Move XPath from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163656
Reviewed by Chris Dumez.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_create_expression): Use ExceptionOr.
(webkit_dom_document_evaluate): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
(webkit_dom_xpath_expression_evaluate): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
(webkit_dom_xpath_result_iterate_next): Ditto.
(webkit_dom_xpath_result_snapshot_item): Ditto.
(webkit_dom_xpath_result_get_number_value): Ditto.
(webkit_dom_xpath_result_get_string_value): Ditto.
(webkit_dom_xpath_result_get_boolean_value): Ditto.
(webkit_dom_xpath_result_get_single_node_value): Ditto.
(webkit_dom_xpath_result_get_snapshot_length): Ditto.
2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkSession: updatedRequest parameter of NetworkProcess::findPendingDownloadLocation is unused since r206988
https://bugs.webkit.org/show_bug.cgi?id=163588
Reviewed by Alex Christensen.
The parameter was used only for the DownloadProxy::DidStart message that is no longer sent from
findPendingDownloadLocation since r206988.
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::currentRequest): Removed since it's unused now.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::convertTaskToDownload): Update the m_currentRequest and pass it to DidStart message.
(WebKit::NetworkLoad::didReceiveResponseNetworkSession):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::findPendingDownloadLocation):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Remove currentRequest() implementation.
2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK+ build after r207522.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
(webkit_dom_dom_window_webkit_message_handlers_post_message): Use new exceptions.
2016-10-19 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK+ build after r207497.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
(webkit_dom_html_select_element_add): Update implementation since add() now takes a Variant.
2016-10-18 Simon Fraser <simon.fraser@apple.com>
Add a MiniBrowser menu item to apply page scale in WK1 and WK2
https://bugs.webkit.org/show_bug.cgi?id=163627
Reviewed by Dean Jackson.
New SPI to set and retrieve page scale.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setPageScale:withOrigin:]):
(-[WKWebView _pageScale]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
2016-10-18 Dean Jackson <dino@apple.com>
Remove CSS_SHAPES feature definition. This should always be on.
https://bugs.webkit.org/show_bug.cgi?id=163628
<rdar://problem/28834613>
Reviewed by Tim Horton.
* Configurations/FeatureDefines.xcconfig:
2016-10-18 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r207413.
This change broke iOS builds.
Reverted changeset:
"[iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to
_UIWebTouchPoint.majorRadiusInScreenCoordinates"
https://bugs.webkit.org/show_bug.cgi?id=163547
http://trac.webkit.org/changeset/207413
2016-10-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r207443.
https://bugs.webkit.org/show_bug.cgi?id=163616
"Caused 5% PLT regression" (Requested by krollin on #webkit).
Reverted changeset:
"Crash in ASCIICaseInsensitiveHash::hash() when a response has
a null MIME type"
https://bugs.webkit.org/show_bug.cgi?id=163476
http://trac.webkit.org/changeset/207443
2016-10-18 Megan Gardner <megan_gardner@apple.com>
Fix build for platforms where HAVE(LINK_PREVIEW) is false
https://bugs.webkit.org/show_bug.cgi?id=163607
Reviewed by Tim Horton.
Added needed # for link preview
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _contentsOfUserInterfaceItem:]):
2016-10-18 Joseph Pecoraro <pecoraro@apple.com>
Remote Web Inspector: Timeline UI not updating while recording
https://bugs.webkit.org/show_bug.cgi?id=163582
<rdar://problem/28766837>
Reviewed by Timothy Hatcher.
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::frontendLoaded):
Local inspector windows keep the web view alive and toggle the
WebInspector.visible state depending on whether or not an inspector is
open. Remote Inspector windows go away when closed, so they can always
be marked as open. This matches earlier remote inspector behavior.
2016-10-18 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Resolve constraints and enumerate devices in the UI process
https://bugs.webkit.org/show_bug.cgi?id=162147
<rdar://problem/28803569>
Reviewed by Darin Adler.
Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
access happens in the UI process.
* Scripts/webkit/messages.py:
(headers_for_type): Special case MediaConstraintsData.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::encodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap encoder.
(IPC::ArgumentCoder<MediaConstraintsData>::encode): MediaConstraintsData encoder.
(IPC::decodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap decoder.
(IPC::ArgumentCoder<MediaConstraintsData>::decode): MediaConstraintsData decoder.
(IPC::ArgumentCoder<CaptureDevice>::encode): CaptureDevice enoder.
(IPC::ArgumentCoder<CaptureDevice>::decode): CaptureDevice decoder.
* Shared/WebCoreArgumentCoders.h:
* UIProcess/API/APIUIClient.h: Remove UserMediaPermissionCheckProxy forward declaration.
* UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
(toWK): Translate UserMediaPermissionRequestDenialReason to UserMediaAccessDenialReason.
(WKUserMediaPermissionRequestDeny): Add "reason" parameter.
* UIProcess/API/C/WKUserMediaPermissionRequest.h:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Invalidate pending device requests.
(WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Make private.
(WebKit::toWebCore): Map from UserMediaAccessDenialReason to MediaAccessDenialReason, cast to
uint64_t to pass to web process.
(WebKit::UserMediaPermissionRequestManagerProxy::denyRequest): Send to web process.
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Validate
constraints and make sure gUM is enabled before prompting user.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): New.
(WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Send
results of device enumeration to web process.
(WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision): Deleted.
(WebKit::UserMediaPermissionRequestManagerProxy::createUserMediaPermissionCheck): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::UserMediaPermissionRequestProxy::allow):
(WebKit::UserMediaPermissionRequestProxy::deny): Take "reason" parameter.
* UIProcess/UserMediaPermissionRequestProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
(WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
(WebKit::WebPageProxy::checkUserMediaPermissionForFrame): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): userMediaAccessDenied -> deny.
Pass the audio and video constraints to the UI process.
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): Send the enumeration request
to the UI process.
(WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
(WebKit::UserMediaPermissionRequestManager::didCompleteMediaDeviceEnumeration):
(WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision): Deleted.
(WebKit::UserMediaPermissionRequestManager::startUserMediaPermissionCheck): Deleted.
(WebKit::UserMediaPermissionRequestManager::cancelUserMediaPermissionCheck): Deleted.
(WebKit::UserMediaPermissionRequestManager::didCompleteUserMediaPermissionCheck): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
(WebKit::WebUserMediaClient::enumerateMediaDevices): New.
(WebKit::WebUserMediaClient::cancelMediaDevicesEnumerationRequest): New.
(WebKit::WebUserMediaClient::checkUserMediaPermission): Deleted.
(WebKit::WebUserMediaClient::cancelUserMediaPermissionCheck): Deleted.
* WebProcess/WebCoreSupport/WebUserMediaClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::userMediaAccessWasGranted): New.
(WebKit::WebPage::userMediaAccessWasDenied): Ditto.
(WebKit::WebPage::didCompleteMediaDeviceEnumeration):
(WebKit::WebPage::didReceiveUserMediaPermissionDecision): Deleted.
(WebKit::WebPage::didCompleteUserMediaPermissionCheck): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2016-10-17 Antti Koivisto <antti@apple.com>
Rename setNeedsStyleRecalc to invalidateStyle
https://bugs.webkit.org/show_bug.cgi?id=163542
Reviewed by Darin Adler.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::didInitializePlugin):
(WebKit::PluginView::pluginProcessCrashed):
2016-10-17 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkSession: PendingDownload is leaked if canceled before willDecidePendingDownloadDestination
https://bugs.webkit.org/show_bug.cgi?id=163545
Reviewed by Alex Christensen.
If a download started by DownloadManager::startDownload() is cancelled before
DownloadManager::willDecidePendingDownloadDestination() is called, DownloadManager::cancelDownload() does
nothing, because the Download hasn't been created yet and m_downloadsWaitingForDestination map doesn't contain
the download ID, and the PendingDownload is never removed from the m_pendingDownloads map.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::cancelDownload): Always take the PendingDownload from m_pendingDownloads map. Then, if
the download was already in m_downloadsWaitingForDestination map, get the network data task to properly cancel
it and then call the completion handler to ignore the request. Otherwise cancel the pending download if exists.
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::cancel): Cancel the network load and notify the UI process that the download was canceled.
* NetworkProcess/Downloads/PendingDownload.h:
2016-10-17 Megan Gardner <megan_gardner@apple.com>
Add test and infrastructure for link popover
https://bugs.webkit.org/show_bug.cgi?id=163406
Reviewed by Simon Fraser.
Add infrastructure to see when a link popover appears, and what URL it has loaded.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView didShowForcePressPreview]):
(-[WKWebView didDismissForcePressPreview]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _contentsOfUserInterfaceItem:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):
(-[WKContentView _previewItemController:didDismissPreview:committing:]):
(-[WKContentView _previewItemControllerDidCancelPreview:]):
2016-10-17 Tim Horton <timothy_horton@apple.com>
REGRESSION (r169805): WKWebView canGoBack returning YES when nothing is in the back-forward list after restoring session state
https://bugs.webkit.org/show_bug.cgi?id=163573
<rdar://problem/28744549>
Reviewed by Dan Bernstein.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::restoreFromSessionState):
Update PageLoadState's canGoBack/canGoForward bits when restoring from
session state, because in the don't-navigate case, nothing else will make this happen,
and it will remain stale.
2016-10-17 Andy Estes <aestes@apple.com>
Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
https://bugs.webkit.org/show_bug.cgi?id=163476
<rdar://problem/26941395>
Reviewed by Tim Horton.
When custom content providers are registered and a response has a null MIME type, WebPage
will pass a null String to HashSet::contains(). This results in a null pointer dereference,
since the String hash functions do not support null Strings and unconditionally dereference
their StringImpls. Fixed by checking that Strings are non-null before calling
HashSet::contains() on m_mimeTypesWithCustomContentProviders.
Rearranging WebPage::shouldUseCustomContentProviderForResponse() to call
canPluginHandleResponse() before checking m_mimeTypesWithCustomContentProviders uncovered a
crash in existing layout tests where WebPage::m_mainFrame can be NULL during WebPage
construction (m_mainFrame isn't yet initialized). Fixed this by passing the main Frame to
canPluginHandleResponseInFrame() instead of relying on m_mainFrame.
New API test: WebKit2.LoadDataWithNilMIMEType.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): Passed
m_frame->coreFrame() to shouldUseCustomContentProviderForResponse().
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::canPluginHandleResponse): Added a mainFrame parameter and used it instead
of m_mainFrame->coreFrame().
(WebKit::WebPage::shouldUseCustomContentProviderForResponse): Passed mainFrame to
canPluginHandleResponse(), and checked if mimeType is null before calling
m_mimeTypesWithCustomContentProviders.contains().
(WebKit::WebPage::canShowMIMEType): Checked if MIMEType is null before calling
m_mimeTypesWithCustomContentProviders.contains().
* WebProcess/WebPage/WebPage.h: Made canPluginHandleResponse() a private declaration.
2016-10-17 Chris Dumez <cdumez@apple.com>
[WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked
https://bugs.webkit.org/show_bug.cgi?id=163569
<rdar://problem/28810836>
Reviewed by Antti Koivisto.
PendingFrameLoad objects are created to track frame loads and added to
the m_pendingFrameLoads hash map. These objects are supposed to remove
themselves from the hash map once they detect that the page load has
finished by calling PendingFrameLoad::m_loadCompletionHandler().
PendingFrameLoad::m_loadCompletionHandler() is called from
markLoadAsCompleted() when we detect that the page load has finished
via the m_loadHysteresisActivity HysteresisActivity. We call impulse()
on the HysteresisActivity every time a subresource is loaded in the
frame. The issue is that if no subresource is ever loaded, then we
never call impulse() on the HysteresisActivity, which is therefore
never started. If it nevers starts, then it nevers stops and never
calls markLoadAsCompleted(). To address the problem, we now call
impulse() on the HysteresisActivity as soon as we construct it.
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2016-10-17 Jeremy Jones <jeremyj@apple.com>
Enable keyboard in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=163146
Reviewed by Jer Noble.
Allow keyboard in fullscreen.
* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::supportsFullScreen):
2016-10-17 Chris Dumez <cdumez@apple.com>
Move form.reportValidity() behind InteractiveFormValidation setting
https://bugs.webkit.org/show_bug.cgi?id=163550
Reviewed by Darin Adler.
Enable InteractiveFormValidation setting by default and link it to
RuntimeEnabledFeatures so we can use it in the IDL.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-10-17 Gavin Barraclough <barraclough@apple.com>
UIProcess should determine throttle state for WebContent process
https://bugs.webkit.org/show_bug.cgi?id=163556
Reviewed by Anders Carlsson.
This is a step towards merging page/process throttling code for mac & iOS.
Previously WebPage determined whether to start a UserActivity based on page activity,
visibility and the preference to disable. Now WebPage passes the activity state across
to WebPageProxy, which makes the decision & explicitly instructs WebPage to start/stop
the UserActivity.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
- updateActivityToken + updateProccessSuppressionState -> updateThrottleState
(WebKit::WebPageProxy::reattachToWebProcess):
- updateActivityToken -> updateThrottleState
(WebKit::WebPageProxy::dispatchViewStateChange):
- updateActivityToken -> updateThrottleState
(WebKit::WebPageProxy::setPageActivityState):
- Record activity state passed from WebPage, and update.
(WebKit::WebPageProxy::preferencesDidChange):
- updateProccessSuppressionState -> updateThrottleState
(WebKit::WebPageProxy::updateActivityToken): Deleted.
(WebKit::WebPageProxy::updateProccessSuppressionState): Deleted.
(WebKit::WebPageProxy::updateThrottleState):
- Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
- Compute whether page should be suppressed, and send SetPageSuppressed message accordingly.
* UIProcess/WebPageProxy.h:
- Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
- Added setPageActivityState/m_activityState to report/record page activity.
- Added m_pageSuppressed to prevent redundant message sends.
* UIProcess/WebPageProxy.messages.in:
- Expose SetPageActivityState message (called by WebPage).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
- removed m_processSuppressionEnabled
- updateUserActivity -> setPageSuppressed - explicitly set the page to not be suppressed, until WebPageProxy tells us to do so.
(WebKit::WebPage::setPageActivityState):
- post activity state on to WebPageProxy.
(WebKit::WebPage::setPageSuppressed):
- Start/stop USerActivity accordingly.
(WebKit::WebPage::setViewState):
- No longer need to monitor ViewState changes on the WebProcess side.
(WebKit::WebPage::updatePreferences):
- No longer need to monitor preference changes on the WebProcess side.
(WebKit::WebPage::updateUserActivity): Deleted.
- Only updated on reciept of setPageSuppressed message.
* WebProcess/WebPage/WebPage.h:
- Removed m_activityState, m_processSuppressionEnabled, updateUserActivity.
- Added setPageSuppressed message.
* WebProcess/WebPage/WebPage.messages.in:
- Added SetPageSuppressed message.
2016-10-17 Michael Catanzaro <mcatanzaro@igalia.com>
REGRESSION(r206189): logs error statements when API::URLRequest is canceled
https://bugs.webkit.org/show_bug.cgi?id=163393
Reviewed by Antti Koivisto.
Print this case at normal logging level, not as an error.
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResource):
2016-10-17 Chris Dumez <cdumez@apple.com>
[iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
https://bugs.webkit.org/show_bug.cgi?id=163547
Reviewed by Darin Adler.
Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
now that it is available in UIKit.
* Platform/spi/ios/UIKitSPI.h:
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::extractWebTouchPoint):
2016-10-17 Konstantin Tokarev <annulen@yandex.ru>
Eleminate code duplication between ResourceRequest encoding/decoding implementations
https://bugs.webkit.org/show_bug.cgi?id=163507
Reviewed by Carlos Garcia Campos.
ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
ditto for decoding implementations.
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2016-10-17 Michael Catanzaro <mcatanzaro@igalia.com>
Move user agent quirks to cross-platform location
https://bugs.webkit.org/show_bug.cgi?id=163508
Reviewed by Carlos Garcia Campos.
#include <WebCore/UserAgent.h> instead of <WebCore/UserAgentGtk.h>.
* UIProcess/API/gtk/WebKitSettings.cpp:
* UIProcess/efl/WebPageProxyEfl.cpp:
* UIProcess/gtk/WebPageProxyGtk.cpp:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
2016-10-17 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Downloads should always sniff contents
https://bugs.webkit.org/show_bug.cgi?id=163538
Reviewed by Michael Catanzaro.
It's quite common that downloads have weird filenames with no extension, so it would be better if the loader
sniff the contents to guess the mime type.
* NetworkProcess/Downloads/soup/DownloadSoup.cpp:
(WebKit::Download::startNetworkLoad): Pass true for shouldContentSniff parameter of ResourceHandle::create().
2016-10-17 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Switch to use API::DownloadClient instead of the C API client
https://bugs.webkit.org/show_bug.cgi?id=163537
Reviewed by Michael Catanzaro.
The code is simpler and we avoid all the toImpl/toAPI.
* UIProcess/API/gtk/WebKitDownloadClient.cpp:
(attachDownloadClientToContext):
(didStart):
(didReceiveResponse):
(didReceiveData):
(decideDestinationWithSuggestedFilename):
(didCreateDestination):
(didFail):
(didCancel):
(didFinish):
2016-10-17 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Disable CSS Grid Layout runtime flag by default
https://bugs.webkit.org/show_bug.cgi?id=163432
Reviewed by Darin Adler.
It was enabled in r201042, but now Safari Technology Preview
has a UI to switch runtime flags so it doesn't need to be enabled
by default anymore.
* Shared/WebPreferencesDefinitions.h: Disable grid layout runtime flag
by default.
2016-10-16 Darin Adler <darin@apple.com>
Move CSS classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163494
Reviewed by Sam Weinig.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
(webkit_dom_css_rule_set_css_text): Updated for ExceptionOr.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
(webkit_dom_css_style_declaration_remove_property): Ditto.
(webkit_dom_css_style_declaration_set_property): Ditto.
(webkit_dom_css_style_declaration_set_css_text): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
(webkit_dom_css_style_sheet_insert_rule): Ditto.
(webkit_dom_css_style_sheet_delete_rule): Ditto.
(webkit_dom_css_style_sheet_add_rule): Ditto.
(webkit_dom_css_style_sheet_remove_rule): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
(webkit_dom_css_value_set_css_text): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
(webkit_dom_media_list_delete_medium): Ditto.
(webkit_dom_media_list_append_medium): Ditto.
(webkit_dom_media_list_set_media_text): Ditto.
2016-10-16 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Default WebKitWebsiteDataManager is always leaked in WebKitWebContext
https://bugs.webkit.org/show_bug.cgi?id=163443
Reviewed by Michael Catanzaro.
Adopt the reference returned by webkitWebsiteDataManagerCreate().
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):
2016-10-16 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] WebKitWebPage URI not updated after URI is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
https://bugs.webkit.org/show_bug.cgi?id=163389
Reviewed by Michael Catanzaro.
Update the page URI also when the load is committed.
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(getDocumentLoaderURL):
(didStartProvisionalLoadForFrame):
(didReceiveServerRedirectForProvisionalLoadForFrame):
(didCommitLoadForFrame):
(webkitWebPageCreate):
(getProvisionalURLForFrame): Deleted.
2016-10-15 Simon Fraser <simon.fraser@apple.com>
Sort the project file.
* WebKit2.xcodeproj/project.pbxproj:
2016-10-14 Anders Carlsson <andersca@apple.com>
Fix Mac build.
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2016-10-14 Anders Carlsson <andersca@apple.com>
Pass on networking settings to the PKPaymentRequest
https://bugs.webkit.org/show_bug.cgi?id=163462
rdar://problem/28567629
Reviewed by Dan Bernstein.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKPaymentRequest):
* UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2016-10-14 Anders Carlsson <andersca@apple.com>
Clean up BackForwardClient
https://bugs.webkit.org/show_bug.cgi?id=163454
Reviewed by Sam Weinig.
Remove empty iOS only stubs.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebBackForwardListProxy.h:
* WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Removed.
2016-10-14 Brady Eidson <beidson@apple.com>
Enable Gamepads by default in WK2.
https://bugs.webkit.org/show_bug.cgi?id=163447
Rubberstamped by Sam Weinig.
* Shared/WebPreferencesDefinitions.h:
2016-10-14 Gavin Barraclough <barraclough@apple.com>
Add API to restrict WebKit processes to background priority
https://bugs.webkit.org/show_bug.cgi?id=163363
Reviewed by Anders Carlson.
Add API on _WKProcessPoolConfiguration to flag a process pool as 'alwaysRunsAtBackgroundPriority'.
WebContent and Networking processes associated with that pool will only run a background priority,
when they otherwise would have run at foreground priority.
* UIProcess/API/APIProcessPoolConfiguration.h:
- Add m_alwaysRunsAtBackgroundPriority flag to pool configuration object.
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration alwaysRunsAtBackgroundPriority]):
(-[_WKProcessPoolConfiguration setAlwaysRunsAtBackgroundPriority:]):
- Expose new configuration property through API.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::alwaysRunsAtBackgroundPriority):
* UIProcess/Network/NetworkProcessProxy.h:
- Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set.
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::assertionState):
- When determining whether to take a foreground exception check alwaysRunsAtBackgroundPriority.
* UIProcess/ProcessThrottlerClient.h:
- Add interface to access alwaysRunsAtBackgroundPriority state of WebProcess of NetworkProcess.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
* UIProcess/WebProcessPool.h:
- Add m_alwaysRunsAtBackgroundPriority, set by configuration.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::alwaysRunsAtBackgroundPriority):
* UIProcess/WebProcessProxy.h:
- Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set.
2016-10-14 Youenn Fablet <youenn@apple.com>
Make NetworkCache aware of fetch cache mode
https://bugs.webkit.org/show_bug.cgi?id=163332
Reviewed by Antti Koivisto.
Adding explicit serialization of ResourceRequest cachePolicy since it does no longer map to platform request cache policy.
Added support for:
- Bypassing entirely the network cache in case cache mode is NoStore.
- requiring revalidation in case of cache hit and cache mode is NoCache.
- Not using any entry if cache mode is Reload (but cache can still be updated)
Also made sure that the ResourceRequest::cachePolicy remains the same throughout redirections.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::canUseCache):
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::continueWillSendRequest):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::cachePolicyAllowsExpired):
(WebKit::NetworkCache::makeRetrieveDecision):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2016-10-13 Tim Horton <timothy_horton@apple.com>
Rename the SPI added in r207292 due to post-landing review comments
https://bugs.webkit.org/show_bug.cgi?id=163364
<rdar://problem/28012494>
Reviewed by Simon Fraser.
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::waitsForPaintAfterViewDidMoveToWindow):
(API::PageConfiguration::setWaitsForPaintAfterViewDidMoveToWindow):
(API::PageConfiguration::shouldWaitForPaintAfterViewDidMoveToWindow): Deleted.
(API::PageConfiguration::setShouldWaitForPaintAfterViewDidMoveToWindow): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _waitsForPaintAfterViewDidMoveToWindow]):
(-[WKWebViewConfiguration _setWaitsForPaintAfterViewDidMoveToWindow:]):
(-[WKWebViewConfiguration _shouldWaitForPaintAfterViewDidMoveToWindow]): Deleted.
(-[WKWebViewConfiguration _setShouldWaitForPaintAfterViewDidMoveToWindow:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::dispatchViewStateChange):
* UIProcess/WebPageProxy.h:
2016-10-13 Jonathan Bedard <jbedard@apple.com>
GTK and EFL on Mac fail to compile WebTextChecker due to missing definition of WKTextCheckerClientBase
https://bugs.webkit.org/show_bug.cgi?id=163346
Reviewed by Daniel Bates.
* UIProcess/API/C/WKTextChecker.cpp: Fixed #ifdefs for GTK and EFL builds on Darwin machines.
* UIProcess/API/C/WKTextChecker.h: Ditto.
2016-10-13 Tim Horton <timothy_horton@apple.com>
Expose SPI to disable synchronously blocking on painting after parenting a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=163364
<rdar://problem/28012494>
Reviewed by Geoff Garen.
Some clients may not want the default WKWebView behavior where we synchronously
block on the Web process after the first time a WKWebView is re-added to the window,
because they are e.g. parenting re-used WKWebViews while scrolling.
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::shouldSynchronizeInitialPaintAfterMovingToWindow):
(API::PageConfiguration::setShouldSynchronizeInitialPaintAfterMovingToWindow):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _shouldSynchronizeInitialPaintAfterMovingToWindow]):
(-[WKWebViewConfiguration _setShouldSynchronizeInitialPaintAfterMovingToWindow:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
Add and plumb a new WKWebView configuration parameter.
(WebKit::WebPageProxy::dispatchViewStateChange):
If the new configuration parameter is set, don't block the main thread when
a view is reparented.
2016-10-12 Chris Dumez <cdumez@apple.com>
[Web IDL] Drop support for legacy [ConstructorConditional=*]
https://bugs.webkit.org/show_bug.cgi?id=163368
Reviewed by Ryosuke Niwa.
Drop ENABLE_DOM4_EVENTS_CONSTRUCTOR compiler flag.
* Configurations/FeatureDefines.xcconfig:
2016-10-12 Alex Christensen <achristensen@webkit.org>
Fix assertion after switching to URLParser
https://bugs.webkit.org/show_bug.cgi?id=163350
rdar://problem/28739938
Reviewed by Brady Eidson.
Covered by a new API test.
* UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
(-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
The { } here is not understood by the compiler to mean WebCore::URL(), but rather the empty constructor for the enum ParsedURLStringTag.
We used to be unsafely trusting that the URL was valid and canonicalized, but with URLParser we are canonicalizing it,
and the assertion (url == m_string) in URL.cpp was failing.
2016-10-12 Anders Carlsson <andersca@apple.com>
Remove an unused function
https://bugs.webkit.org/show_bug.cgi?id=163341
Reviewed by Dan Bernstein.
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::isActive): Deleted.
* WebProcess/WebPage/WebBackForwardListProxy.h:
2016-10-11 Gyuyoung Kim <gyuyoung.kim@navercorp.com>
[EFL] Update API tests which are passed or failed
https://bugs.webkit.org/show_bug.cgi?id=163322
Unreviewed, simple on/off API test.
*ewk_favicon_database_clear* has been crashed for a long time, however
*ewk_cookie_manager_permanent_storage* is fine now. So the passing test
is enabled again, and disable the failure tests.
* UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
(TEST_F):
* UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
(TEST_F):
2016-10-11 Daniel Bates <dabates@apple.com>
Attempt to fix the Apple Internal Mac build following r207159
(https://bugs.webkit.org/show_bug.cgi?id=163244)
* UIProcess/API/Cocoa/WKWebView.mm:
(shouldRequireUserGestureToLoadVideo):
2016-10-11 Anders Carlsson <andersca@apple.com>
Clean up WebPageGroup somewhat
https://bugs.webkit.org/show_bug.cgi?id=163299
Reviewed by Tim Horton.
* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKPageGroupCopyIdentifier):
Move this here from WKPageGroup.
(WKPageGroupAddUserContentFilter):
(WKPageGroupRemoveUserContentFilter):
(WKPageGroupRemoveAllUserContentFilters):
Just call directly into the user content controller.
* UIProcess/API/C/WKPageGroup.cpp:
(WKPageGroupAddUserStyleSheet):
(WKPageGroupRemoveAllUserStyleSheets):
(WKPageGroupAddUserScript):
(WKPageGroupRemoveAllUserScripts):
Just call directly into the user content controller.
* UIProcess/API/C/WKPageGroup.h:
* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::addUserStyleSheet): Deleted.
(WebKit::WebPageGroup::addUserScript): Deleted.
(WebKit::WebPageGroup::removeAllUserStyleSheets): Deleted.
(WebKit::WebPageGroup::removeAllUserScripts): Deleted.
(WebKit::WebPageGroup::removeAllUserContent): Deleted.
(WebKit::WebPageGroup::addUserContentExtension): Deleted.
(WebKit::WebPageGroup::removeUserContentExtension): Deleted.
(WebKit::WebPageGroup::removeAllUserContentExtensions): Deleted.
Get rid of these, all their callers just call into the user content controller now.
* UIProcess/WebPageGroup.h:
(WebKit::WebPageGroup::identifier): Deleted.
(WebKit::WebPageGroup::sendToAllProcessesInGroup): Deleted.
Remove unused code.
2016-10-11 Daniel Bates <dabates@apple.com>
[iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
https://bugs.webkit.org/show_bug.cgi?id=163244
<rdar://problem/27250015>
Reviewed by Jer Noble.
Enable or disable the Setting::requiresUserGestureToLoadVideo() in WebKit depending on the
version of iOS SDK that the app was linked against. We require a user gesture to begin
loading a video as of iOS 10.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(shouldRequireUserGestureToLoadVideo): Added.
(-[WKWebView _initializeWithConfiguration:]): Set the requiresUserGestureToLoadVideo preference.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Modified to pass the WebKit requiresUserGestureToLoadVideo
preference to WebCore.
2016-10-11 Alex Christensen <achristensen@webkit.org>
Remove dead networking code
https://bugs.webkit.org/show_bug.cgi?id=163263
Reviewed by Daniel Bates.
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed.
* NetworkProcess/Downloads/mac/DownloadMac.mm:
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/mac/NetworkLoadMac.mm:
(WebKit::NetworkLoad::willCacheResponseAsync): Deleted.
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::receivedCredential):
(WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
(WebKit::AuthenticationManager::receivedCancellation):
(WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
(WebKit::AuthenticationManager::receivedChallengeRejection):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
* WebKit2.xcodeproj/project.pbxproj:
2016-10-11 Anders Carlsson <andersca@apple.com>
Move no longer used functions to WKDeprecatedFunctions.cpp
https://bugs.webkit.org/show_bug.cgi?id=163290
Reviewed by Dan Bernstein.
* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKPageGroupAddUserContentFilter):
(WKPageGroupRemoveUserContentFilter):
(WKPageGroupRemoveAllUserContentFilters):
(WKContextSetProcessModel): Deleted.
* UIProcess/API/C/WKPageGroup.cpp:
(WKPageGroupRemoveAllUserScripts):
(WKPageGroupAddUserContentFilter): Deleted.
(WKPageGroupRemoveUserContentFilter): Deleted.
(WKPageGroupRemoveAllUserContentFilters): Deleted.
* UIProcess/API/C/WKPageGroup.h:
2016-10-11 Konstantin Tokarev <annulen@yandex.ru>
Use modern for loops for iterating supplement maps
https://bugs.webkit.org/show_bug.cgi?id=163274
Reviewed by Alex Christensen.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::initializeConnection):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::~WebProcessPool):
(WebKit::WebProcessPool::networkProcessCrashed):
(WebKit::WebProcessPool::databaseProcessCrashed): Iterate by values()
like in other places.
2016-10-11 Wenson Hsieh <wenson_hsieh@apple.com>
The "Input Events" experimental feature runtime flag should not be on by default
https://bugs.webkit.org/show_bug.cgi?id=163278
Reviewed by Zalan Bujtas.
This was intended to be off by default.
* Shared/WebPreferencesDefinitions.h:
2016-10-10 Zan Dobersek <zdobersek@igalia.com>
Add ENABLE_ENCRYPTED_MEDIA configuration option
https://bugs.webkit.org/show_bug.cgi?id=163219
Reviewed by Darin Adler.
* Configurations/FeatureDefines.xcconfig:
Add the ENABLE_ENCRYPTED_MEDIA configuration option. It will be used
to enable or disable the new EME implementation at build-time.
2016-10-10 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkSession: NetworkDataTask is leaked if download finishes in didReceiveResponse completion handler
https://bugs.webkit.org/show_bug.cgi?id=163204
Reviewed by Alex Christensen.
After the completion handler a reference of the NetworkDataTask is saved in m_downloadsAfterDestinationDecided.
If the download failed or was canceled DownloadManager::dataTaskBecameDownloadTask is never called and the data
task is kept in the download manager forever. This patch exposes NSURLSessionTask state property in
NetworkDataTask, so that the download manager can check the task state after the completion handler and return
early if the download finished or was cancelled.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::continueDecidePendingDownloadDestination):
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTask::state):
2016-10-10 Konstantin Tokarev <annulen@yandex.ru>
Added final specifier to WebInspectorServer and to its overridden methods
https://bugs.webkit.org/show_bug.cgi?id=163228
Reviewed by Darin Adler.
* UIProcess/InspectorServer/WebInspectorServer.h:
2016-10-10 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] 2.14.0 Compile Errors: GTK 3.22.1
https://bugs.webkit.org/show_bug.cgi?id=163190
Reviewed by Alex Christensen.
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp: Include gtk.h since we are using gtk_widget_queue_draw().
2016-10-10 Gyuyoung Kim <gyuyoung.kim@navercorp.com>
[EFL] ewk_context_preferred_languages has been failed since r206949
https://bugs.webkit.org/show_bug.cgi?id=163211
Reviewed by Chris Dumez.
r206949 changed to return value of navigator.language from en-us to en-US
in order to match other browsers and w3c spec. So ewk_context_preferred_languages
needs to change the expected result as well.
* UIProcess/API/efl/tests/test_ewk2_context.cpp:
(TEST_F):
2016-10-10 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkSession: downloads started by startDownload() can fail before starting from the API point of view
https://bugs.webkit.org/show_bug.cgi?id=163107
Reviewed by Alex Christensen.
In the network process we use a PendingDownload in this case, but in the UI process we always have a single
download proxy. If an error happens before the pending download is converted inot a real download, the DidFail
messages is received in the download proxy before the DidStart one. This is problematic at least for the GTK+
API, because it's common to connect to the started signal and connect to all other signals from there, but in
this case the started signal is never emitted, and then the failed one is not handled. This is not a problem for
downloads started by convertTaskToDownload, because in that case those loads are not considered a download by
the UI process when those early errors happen, and then the web page handles them.
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::PendingDownload): Send DidStart message right after the network load starts like the
non network session code does.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::convertTaskToDownload): Send DidStart message now that the normal load has been converted
into a download.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::findPendingDownloadLocation): Do not send DidStart message here.
2016-10-10 Carlos Garcia Campos <cgarcia@igalia.com>
Network Session: PendingDownload is always nullptr in DownloadManager::dataTaskBecameDownloadTask
https://bugs.webkit.org/show_bug.cgi?id=163006
Reviewed by Alex Christensen.
In DownloadManager::dataTaskBecameDownloadTask() we are supposed to have either a pending download, or a network
data task depending on whether the download was started by startDownload() or convertTaskToDownload. However, in
both cases we do have a data task and never a pending download. In the case of startDownload() the pending
download is removed from m_pendingDownloads in willDecidePendingDownloadDestination(). The task is always
added to m_downloadsWaitingForDestination in willDecidePendingDownloadDestination() and to
m_downloadsAfterDestinationDecided in continueDecidePendingDownloadDestination() in both cases.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::dataTaskBecameDownloadTask): Add an ASSERT to ensure we don't have a pending download
at this point and that the download is not already in the map. Remove the download from the
m_downloadsAfterDestinationDecided map, but don't check its result because it might not bein that map if
dataTaskBecameDownloadTask is called synchronously from the didReceiveResponse completion handler.
(WebKit::DownloadManager::willDecidePendingDownloadDestination): Do not take the pending download here, wait
until didReceiveResponse completion handler is called.
(WebKit::DownloadManager::continueDecidePendingDownloadDestination): Take the pending download here ensuring
it's alive while the didReceiveResponse completion handler is called. Also remove invalid early return when
either networkDataTask or completionHandler are nullptr because we are using both unconditionally, we should
return early if both are nullptr to avoid crashes. However, we are checking that the download is in the
m_downloadsWaitingForDestination and in that case we should always have both, so better add asserts there. If
the download is already in the map after the completion handler it means that dataTaskBecameDownloadTask() has
alrady been called, so we can just return in that case.
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Protect the NetworkDataTask that can
be deleted by dataTaskBecameDownloadTask().
2016-10-10 Tim Horton <timothy_horton@apple.com>
Share more code between iOS and macOS ViewGestureController
https://bugs.webkit.org/show_bug.cgi?id=163158
Reviewed by Simon Fraser.
Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
because it shouldn't know anything about WKWebView.
Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView setAllowsBackForwardNavigationGestures:]):
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
(WebKit::ViewGestureController::canSwipeInDirection):
(WebKit::ViewGestureController::gestureControllerForPage): Deleted.
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::createWeakPtr):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
(WebKit::ViewGestureController::canSwipeInDirection): Deleted.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
2016-10-10 Tomas Popela <tpopela@redhat.com>
[GTK] UIProcess crashes when using Japanese IM
https://bugs.webkit.org/show_bug.cgi?id=163011
We have to reference the current GdkEventKey before we try process it
as later when the lambda body is reached the event could be already
freed.
Reviewed by Carlos Garcia Campos.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseKeyPressEvent):
(webkitWebViewBaseKeyReleaseEvent):
* UIProcess/gtk/InputMethodFilter.h:
Use non-copyable Function so we can use WTFMove to pass the event to
lambda.
2016-10-09 Wenson Hsieh <wenson_hsieh@apple.com>
Support InputEvent.inputType for the new InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163025
<rdar://problem/28658092>
Reviewed by Darin Adler.
Accounts for some changes to the EditAction enum in nameForEditAction. Some former edit
actions, such as EditActionTyping, have been split out into its more specific subtypes,
so we preserve shipping behavior by treating all of the new subtypes the same way as the
original type.
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):
2016-10-08 Emanuele Aina <emanuele.aina@collabora.com>
[GTK] Drop redundant wl_display_flush_clients() call
https://bugs.webkit.org/show_bug.cgi?id=161904
Reviewed by Michael Catanzaro.
The Wayland GSource::prepare() function already calls
wl_display_flush_clients() at every mainloop iteration, so there's no
need to further call it on Surface::commit().
* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::Surface::commit):
* UIProcess/gtk/WaylandCompositor.h:
2016-10-06 Darin Adler <darin@apple.com>
Next step on moving to modern way to return DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163016
Reviewed by Ryosuke Niwa.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
(webkit_dom_dom_implementation_create_document_type): Updated for name change
from takeReturnValue to releaseReturnValue.
(webkit_dom_dom_implementation_create_document): Ditto.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
(webkit_dom_dom_selection_collapse_to_end): Use ExceptionOr instead of ExceptionCode.
(webkit_dom_dom_selection_collapse_to_start): Ditto.
(webkit_dom_dom_selection_extend): Ditto.
(webkit_dom_dom_selection_get_range_at): Ditto.
2016-10-08 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206950.
https://bugs.webkit.org/show_bug.cgi?id=163169
broke an API test (Requested by thorton on #webkit).
Reverted changeset:
"Share more code between iOS and macOS ViewGestureController"
https://bugs.webkit.org/show_bug.cgi?id=163158
http://trac.webkit.org/changeset/206950
2016-10-08 Tim Horton <timothy_horton@apple.com>
Share more code between iOS and macOS ViewGestureController
https://bugs.webkit.org/show_bug.cgi?id=163158
Reviewed by Simon Fraser.
Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
because it shouldn't know anything about WKWebView.
Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView setAllowsBackForwardNavigationGestures:]):
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
(WebKit::ViewGestureController::canSwipeInDirection):
(WebKit::ViewGestureController::gestureControllerForPage): Deleted.
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::createWeakPtr):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
(WebKit::ViewGestureController::canSwipeInDirection): Deleted.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
2016-10-07 Anders Carlsson <andersca@apple.com>
Get rid of API::Session and WKSessionRef
https://bugs.webkit.org/show_bug.cgi?id=163140
Reviewed by Tim Horton.
This API is no longer used.
* CMakeLists.txt:
* Shared/API/APIObject.h:
* Shared/API/c/WKSharedAPICast.h:
* UIProcess/API/APISession.cpp: Removed.
(API::generateID): Deleted.
(API::Session::defaultSession): Deleted.
(API::Session::Session): Deleted.
(API::Session::createEphemeral): Deleted.
(API::Session::isEphemeral): Deleted.
(API::Session::getID): Deleted.
(API::Session::~Session): Deleted.
* UIProcess/API/APISession.h: Removed.
* UIProcess/API/C/WKPage.h:
* UIProcess/API/C/WKSessionRef.cpp: Removed.
(WKSessionCreate): Deleted.
(WKSessionGetTypeID): Deleted.
(WKSessionIsEphemeral): Deleted.
* UIProcess/API/C/WKSessionRef.h: Removed.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.h:
* WebKit2.xcodeproj/project.pbxproj:
2016-10-07 Tim Horton <timothy_horton@apple.com>
Move ViewGestureController files to more accurate locations
https://bugs.webkit.org/show_bug.cgi?id=163141
Reviewed by Anders Carlsson.
* PlatformMac.cmake:
* UIProcess/Cocoa/ViewGestureController.cpp: Renamed from UIProcess/ViewGestureController.cpp.
* UIProcess/Cocoa/ViewGestureController.h: Renamed from UIProcess/mac/ViewGestureController.h.
* UIProcess/Cocoa/ViewGestureController.messages.in: Renamed from UIProcess/mac/ViewGestureController.messages.in.
* WebKit2.xcodeproj/project.pbxproj:
2016-10-07 Tim Horton <timothy_horton@apple.com>
Adopt BlockPtr in ViewGestureController
https://bugs.webkit.org/show_bug.cgi?id=163132
Reviewed by Anders Carlsson.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::setDidMoveSwipeSnapshotCallback):
* UIProcess/ViewGestureController.cpp:
(WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
* UIProcess/mac/ViewGestureController.h:
(WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
(WebKit::ViewGestureController::m_didMoveSwipeSnapshotCallback): Deleted.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::platformTeardown):
(WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback): Deleted.
2016-10-07 Anders Carlsson <andersca@apple.com>
Get rid of WKPageSetSession
https://bugs.webkit.org/show_bug.cgi?id=163129
Reviewed by Tim Horton.
This function is no longer used.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetSession): Deleted.
* UIProcess/API/C/WKPage.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setSessionID): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::sessionID):
* WebProcess/WebPage/WebPage.messages.in:
2016-10-07 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r206909.
https://bugs.webkit.org/show_bug.cgi?id=163116
Caused most of GTK layout tests to crash (Requested by KaL on
#webkit).
Reverted changeset:
"[GTK] UIProcess crashes when using Japanese IM"
https://bugs.webkit.org/show_bug.cgi?id=163011
http://trac.webkit.org/changeset/206909
2016-10-07 Carlos Garcia Campos <cgarcia@igalia.com>
Network Session: Allow NetworkDataTask decide what to do when override is allowed for a download
https://bugs.webkit.org/show_bug.cgi?id=163010
Reviewed by Alex Christensen.
Current code always deletes the file before starting a download when allow override is True. In soup backend we
use glib API that takes care of it and tries to ensure that the original file is not deleted if the new file
creation fails for whatever reason.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::continueDecidePendingDownloadDestination): Pass allowOverride to setPendingDownloadLocation().
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTask::setPendingDownloadLocation): Delete the destination file if exists and allowOverride
is True.
2016-10-07 Tomas Popela <tpopela@redhat.com>
[GTK] UIProcess crashes when using Japanese IM
https://bugs.webkit.org/show_bug.cgi?id=163011
We have to reference the current GdkEventKey before we try process it
as later when the lambda body is reached the event could be already
freed.
Reviewed by Carlos Garcia Campos.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseKeyPressEvent):
(webkitWebViewBaseKeyReleaseEvent):
* UIProcess/gtk/InputMethodFilter.h:
Use non-copyable Function so we can use WTFMove to pass the event to
lambda.
2016-10-06 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Expose WebKitDOMHTMLInputElement APIs for form autofill
https://bugs.webkit.org/show_bug.cgi?id=163082
Reviewed by Darin Adler.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
(webkit_dom_html_input_element_get_auto_filled): Added.
(webkit_dom_html_input_element_set_auto_filled): Added.
(webkit_dom_html_input_element_set_editing_value): Added.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
* WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
2016-10-06 John Wilander <wilander@apple.com>
Update Resource Load Statistics
https://bugs.webkit.org/show_bug.cgi?id=162811
Reviewed by Alex Christensen.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics):
Switched to vector-based classification.
(WebKit::WebResourceLoadStatisticsStore::classifyResource):
Simplified logic and moved the split between has and has
no user interaction into ResourceLoadStatisticsStore.
(WebKit::WebResourceLoadStatisticsStore::clearDataRecords):
Added.
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
Updated to make use of the new functions.
(WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
Removed stray whitespace.
(WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
Removed stray whitespace.
(WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk):
Removed stray whitespace.
(WebKit::hasPrevalentResourceCharacteristics): Deleted.
(WebKit::classifyPrevalentResources): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:
Added member variables for clearing of data records.
2016-10-06 Youenn Fablet <youenn@apple.com>
[WK2] 304 revalidation on the network process does not update the validated response
https://bugs.webkit.org/show_bug.cgi?id=162973
Reviewed by Darin Adler.
* NetworkProcess/NetworkResourceLoader.cpp: Updating cache entry with the revalidated one.
2016-10-05 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce InputEvent bindings in preparation for the input events spec
https://bugs.webkit.org/show_bug.cgi?id=162954
Reviewed by Ryosuke Niwa.
Adds a new runtime switch for enabling InputEvents.
* Shared/WebPreferencesDefinitions.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-10-05 Myles C. Maxfield <mmaxfield@apple.com>
Put variation fonts work behind a compile-time flag
https://bugs.webkit.org/show_bug.cgi?id=162949
Reviewed by Simon Fraser.
* Configurations/FeatureDefines.xcconfig:
2016-10-05 Tim Horton <timothy_horton@apple.com>
Fix the build.
* UIProcess/Cocoa/WebViewImpl.mm:
2016-10-05 Tim Horton <timothy_horton@apple.com>
Avoid automatically re-taking snapshots for back-forward items that were never loaded into the view
https://bugs.webkit.org/show_bug.cgi?id=162955
<rdar://problem/27659173>
Reviewed by Simon Fraser.
Make it possible for clients to control the snapshot for back-forward
items that are restored from session state without navigating to them,
by ensuring that we won't stomp on the snapshot that they explicitly take,
until a load occurs.
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::addItem):
(WebKit::WebBackForwardList::goToItem):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::trackSwipeGesture):
Disambiguate explicit API-driven snapshot recording from automatic,
navigation-driven snapshot recording.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::saveBackForwardSnapshotForCurrentItem):
Get rid of the version of recordNavigationSnapshot() that doesn't take a
back-forward list item, and grab the current item at the one remaining caller.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::recordAutomaticNavigationSnapshot):
(WebKit::WebPageProxy::recordNavigationSnapshot):
(WebKit::WebPageProxy::restoreFromSessionState):
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebPageProxy.h:
Rename m_suppressNavigationSnapshotting to m_suppressAutomaticNavigationSnapshotting,
and make it be only about automatic (navigation-driven) snapshots; it won't have
any impact on explicit snapshots forced by clients.
Set m_suppressAutomaticNavigationSnapshotting unconditionally when restoring
from session state, so that we won't start automatically snapshotting until
something has loaded in the view.
2016-10-05 Tim Horton <timothy_horton@apple.com>
Make it possible to test ViewSnapshotStore behaviors
https://bugs.webkit.org/show_bug.cgi?id=162983
Reviewed by Simon Fraser.
Add two pieces of SPI to make it easier to test ViewSnapshotStore:
- [WKWebView _disableBackForwardSnapshotVolatilityForTesting]
This makes it so that we don't make snapshots volatile after we
take them, so that they won't get purged while the test is running
and cause the test to be flaky.
- [WKBackForwardListItem _copySnapshotForTesting]
This returns a CGImage with the content of the given back-forward
item's current snapshot, if there is one.
* UIProcess/API/Cocoa/WKBackForwardListItem.mm:
(-[WKBackForwardListItem _copySnapshotForTesting]):
* UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
* UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Added.
Add WKBackForwardListItem SPI to retrieve the snapshot for a given back-forward list item.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]):
Add WKWebView SPI to disable volatility of snapshots, for testing purposes.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::takeViewSnapshot):
Adopt ViewSnapshot::setVolatile instead of reaching into the surface.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::removeSwipeSnapshot):
Adopt ViewSnapshot::setVolatile instead of reaching into the surface.
* UIProcess/mac/ViewSnapshotStore.h:
(WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting):
(WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting):
* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshotStore::ViewSnapshotStore):
(WebKit::ViewSnapshot::setVolatile):
(WebKit::ViewSnapshot::asLayerContents):
Move all touching of snapshot volatility into the new setVolatile,
and short-circuit if the testing-only m_disableSnapshotVolatility bit is set
(WebKit::ViewSnapshot::asImageForTesting):
Make a CGImageRef for the aforementioned WKBackForwardListItem SPI.
This is currently not implemented for the iOS Simulator, because we
don't have access to the bits of the image in that case.
2016-10-05 Chris Dumez <cdumez@apple.com>
KeyboardEvent.getModifierState() should support "CapsLock" modifier
https://bugs.webkit.org/show_bug.cgi?id=162861
Reviewed by Darin Adler.
Add support for CapsLock modifier on events.
* Shared/API/c/WKEvent.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
(WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
(WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
* Shared/efl/WebEventFactory.cpp:
(WebKit::toWebEventModifiers):
* Shared/ios/WebIOSEventFactory.mm:
(modifiersForEvent):
* Shared/mac/WebEventFactory.mm:
(WebKit::modifiersForEvent):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(toNSEventModifierFlags):
* UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2016-10-05 Zan Dobersek <zdobersek@igalia.com>
Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
https://bugs.webkit.org/show_bug.cgi?id=162903
Reviewed by Alex Christensen.
Rename build guards for the remaining implementation of the legacy EME API
to ENABLE_LEGACY_ENCRYPTED_MEDIA. This will allow for the future implementation
of the near-finished API to be guarded with the simple ENABLE_ENCRYPTED_MEDIA guards.
* Configurations/FeatureDefines.xcconfig:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
* WebProcess/WebProcess.cpp:
(WebKit::m_resourceLoadStatisticsStorage):
2016-10-05 Daniel Bates <dabates@apple.com>
[WK2][NetworkSession] Ping requests should follow redirects if applicable
https://bugs.webkit.org/show_bug.cgi?id=162580
<rdar://problem/28631274>
Reviewed by Alex Christensen.
Implement support for following redirects, if applicable, of a ping request when using the
Network Session (ENABLE(NETWORK_SESSION)) code path in WebKit2. For ping requests that are
in response to hyperlink auditing (e.g. <a ping>) we should follow redirect responses.
For Content Security Policy and XSS Auditor violation reports we should not follow redirect
responses.
Currently we always ignore redirects for ping requests that are sent using the Network Session
code path in WebKit2. This behavior disagrees with the behavior described in section
"Hyperlink auditing" of the HTML standard, <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing> (27 September 2016),
as well as the behavior in Legacy WebKit and WebKit2 with Network Session disabled. We should
follow redirects for ping requests initiated as part of hyperlink auditing to more closely
conform to the HTML standard and match the behavior in Legacy WebKit and WebKit2 with Network
Session disabled.
* NetworkProcess/PingLoad.h:
2016-10-05 Daniel Bates <dabates@apple.com>
Do not follow redirects when sending violation report
https://bugs.webkit.org/show_bug.cgi?id=162520
<rdar://problem/27957639>
Reviewed by Alex Christensen.
Update the non-Network Session WebKit2 implementation to follow redirect responses for a ping
request, if applicable. I did not update the Network Session implementation at this time. I
will fix it in <https://bugs.webkit.org/show_bug.cgi?id=162580>.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::loadPing): Tell PingHandle whether to follow redirects.
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode): Encode NetworkResourceLoadParameters::shouldFollowRedirects.
(WebKit::NetworkResourceLoadParameters::decode): Decode NetworkResourceLoadParameters::shouldFollowRedirects.
* NetworkProcess/PingLoad.h: Added FIXME comment to implement support for following redirects,
if applicable (for hyperlink auditing). See <https://bugs.webkit.org/show_bug.cgi?id=162580>
for more details.
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::createPingHandle): Modified to take a boolean whether to follow
redirects responses and set NetworkResourceLoadParameters::shouldFollowRedirects as appropriate.
* WebProcess/Network/WebLoaderStrategy.h:
2016-10-05 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Move global TLS errors handling from ResourceHandle to SoupNetworkSession
https://bugs.webkit.org/show_bug.cgi?id=162910
Reviewed by Alex Christensen.
Use SoupNetworkSession instead of ResourceHandle.
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::setIgnoreTLSErrors):
(WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost):
2016-10-05 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK+ build with USE_REDIRECTED_XCOMPOSITE_WINDOW disabled.
* UIProcess/AcceleratedDrawingAreaProxy.cpp:
(WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
2016-10-04 Chris Dumez <cdumez@apple.com>
Implement KeyboardEvent.code from the UI Event spec
https://bugs.webkit.org/show_bug.cgi?id=149584
Reviewed by Darin Adler.
Add support for Keyboard.code attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-code
- https://w3c.github.io/uievents-code/
* Shared/WebEvent.h:
(WebKit::WebKeyboardEvent::code):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
(WebKit::WebKeyboardEvent::encode):
(WebKit::WebKeyboardEvent::decode):
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebKeyboardEvent):
2016-10-04 Said Abou-Hallawa <sabouhallawa@apple.com>
The dragged image should be the current frame only of the animated image
https://bugs.webkit.org/show_bug.cgi?id=162109
Reviewed by Tim Horton.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name.
2016-10-04 Ryosuke Niwa <rniwa@webkit.org>
Revert a change erroneously committed in r206795.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-10-04 Anders Carlsson <andersca@apple.com>
Properly kill web processes in the launching state
https://bugs.webkit.org/show_bug.cgi?id=162938
Reviewed by Tim Horton.
* UIProcess/Launcher/ProcessLauncher.h:
Add m_xpcConnection member.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
Store the XPC connection in the m_xpcConnection member variable.
In the reply handler, handle m_xpcConnection being null.
(WebKit::ProcessLauncher::platformInvalidate):
Cancel and kill the connection.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::terminateProcess):
Get rid of an assertion.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::requestTermination):
Handle the launching state.
2016-10-04 Tim Horton <timothy_horton@apple.com>
Fix the build.
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::WebBackForwardListItem):
(WebKit::WebBackForwardListItem::highestUsedItemID):
2016-10-04 Tim Horton <timothy_horton@apple.com>
Fix a typo in WebBackForwardListItem (highed->highest)
https://bugs.webkit.org/show_bug.cgi?id=162935
Reviewed by Anders Carlsson.
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::highestUsedItemID):
(WebKit::WebBackForwardListItem::highedUsedItemID): Deleted.
* Shared/WebBackForwardListItem.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
2016-10-04 Yusuke Suzuki <utatane.tea@gmail.com>
[DOMJIT] Introduce DOMJIT::GetterSetter to tell JIT information
https://bugs.webkit.org/show_bug.cgi?id=162916
Reviewed by Filip Pizlo.
* CMakeLists.txt:
2016-10-04 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Remove SSLPolicyFlags from SoupNetworkSession
https://bugs.webkit.org/show_bug.cgi?id=162906
Reviewed by Michael Catanzaro.
* NetworkProcess/soup/NetworkProcessMainSoup.cpp:
(WebKit::NetworkProcessMainUnix):
2016-10-04 Wenson Hsieh <wenson_hsieh@apple.com>
Media controls are displayed in the incorrect state momentarily after switching between tabs playing media
https://bugs.webkit.org/show_bug.cgi?id=162766
<rdar://problem/28533523>
Reviewed by Jer Noble.
Plumbs some more Now Playing information from the web process to the UI process for testing purposes. See
WebCore ChangeLog for more details.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]):
(-[WKWebView _handleActiveNowPlayingSessionInfoResponse:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::requestActiveNowPlayingSessionInfo):
2016-10-04 Zan Dobersek <zdobersek@igalia.com>
Unreviewed GTK+ build fix.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient): Guard the call to getDefaultWebCryptoMasterKey()
with ENABLE(SUBTLE_CRYPTO), since the same guard is used for the definition. Fixes
GTK+ production builds where the feature is disabled.
2016-10-03 Keith Rollin <krollin@apple.com>
More logging to diagnose "WebKit encountered an internal error" messages
https://bugs.webkit.org/show_bug.cgi?id=162754
Reviewed by Antti Koivisto.
Add more logging around calls to internalError, as well as some
low-level logging around SharedMemory, and mach_vm_map in particular.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
* Platform/Logging.h:
* Platform/mac/SharedMemoryMac.cpp:
(WebKit::SharedMemory::allocate):
(WebKit::makeMemoryEntry):
(WebKit::SharedMemory::map):
(WebKit::SharedMemory::~SharedMemory):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::networkProcessCrashed):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResource):
2016-10-03 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r206754.
This change broke the El Capitan and Yosemite debug builds.
Reverted changeset:
"More logging to diagnose "WebKit encountered an internal
error" messages"
https://bugs.webkit.org/show_bug.cgi?id=162754
http://trac.webkit.org/changeset/206754
2016-10-03 Keith Rollin <krollin@apple.com>
More logging to diagnose "WebKit encountered an internal error" messages
https://bugs.webkit.org/show_bug.cgi?id=162754
Reviewed by Antti Koivisto.
Add more logging around calls to internalError, as well as some
low-level logging around SharedMemory, and mach_vm_map in particular.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
* Platform/Logging.h:
* Platform/mac/SharedMemoryMac.cpp:
(WebKit::SharedMemory::allocate):
(WebKit::makeMemoryEntry):
(WebKit::SharedMemory::map):
(WebKit::SharedMemory::~SharedMemory):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::networkProcessCrashed):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResource):
2016-10-03 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.key attribute
https://bugs.webkit.org/show_bug.cgi?id=36267
Reviewed by Darin Adler.
Add support for KeyboardEvent.key attribute.
* Shared/WebEvent.h:
(WebKit::WebKeyboardEvent::key):
(WebKit::WebKeyboardEvent::unmodifiedText): Deleted.
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
(WebKit::WebKeyboardEvent::encode):
(WebKit::WebKeyboardEvent::decode):
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebKeyboardEvent):
2016-10-03 Chris Dumez <cdumez@apple.com>
Add support for KeyboardEvent.key attribute
https://bugs.webkit.org/show_bug.cgi?id=36267
Reviewed by Darin Adler.
Add support for KeyboardEvent.key attribute.
* Shared/WebEvent.h:
(WebKit::WebKeyboardEvent::key):
(WebKit::WebKeyboardEvent::unmodifiedText): Deleted.
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
(WebKit::WebKeyboardEvent::encode):
(WebKit::WebKeyboardEvent::decode):
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebKeyboardEvent):
2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Cleanup persistent credential storage code
https://bugs.webkit.org/show_bug.cgi?id=162777
Reviewed by Alex Christensen.
Use USE(LIBSECRET) instead of ENABLE(CREDENTIAL_STORAGE).
* UIProcess/API/gtk/WebKitAuthenticationRequest.cpp:
(webkit_authentication_request_can_save_credentials):
2016-10-02 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r206683.
This change caused API test WebKit2.FindMatches to fail on
Mac.
Reverted changeset:
"The dragged image should be the current frame only of the
animated image"
https://bugs.webkit.org/show_bug.cgi?id=162109
http://trac.webkit.org/changeset/206683
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Follow-up patch after r206701
https://bugs.webkit.org/show_bug.cgi?id=162818
Unreviewed.
I missed one place required to enable an experimental feature by default.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::registerUserDefaultsIfNeeded):
2016-09-30 Dan Bernstein <mitz@apple.com>
[iOS] Editing menu omits the Share command if the selected text is longer than 200 characters
https://bugs.webkit.org/show_bug.cgi?id=162821
<rdar://problem/28409828>
Reviewed by Tim Horton.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformAction:withSender:]): Changed to return YES for the _share:
action even if the selection is longer than 200 characters. While Define should not have
been available for longer selections, Share does not have such a limitation.
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Turn variation fonts on by default
https://bugs.webkit.org/show_bug.cgi?id=162818
Reviewed by Simon Fraser.
* Shared/WebPreferencesDefinitions.h:
2016-09-30 Brady Eidson <beidson@apple.com>
REGRESSION (Safari 10 combined with WK changes): Unable to store WebCrypto keys in IndexedDB database.
<rdar://problem/28334440> and https://bugs.webkit.org/show_bug.cgi?id=162554
Reviewed by Alexey Proskuryakov.
Safari 10 has a WKPageNavigation client but does not implement the "copyWebCryptoMasterKey" callback.
WebKit just fails in this case, instead of falling back to "getDefaultWebCryptoMasterKey".
It should fall back.
Additionally there's a WKContextClient callback to get the crypto key, also, but it is completely unused.
So it should be pulled.
* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::webCryptoMasterKey): Deleted.
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
(WKPageSetPageNavigationClient): If the client doesn't implement this method, fallback to getDefaultWebCryptoMasterKey.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::webCryptoMasterKey): If the client doesn't implement this method,
fallback to getDefaultWebCryptoMasterKey.
* UIProcess/WebContextClient.cpp:
(WebKit::WebContextClient::copyWebCryptoMasterKey): Deleted.
* UIProcess/WebContextClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::wrapCryptoKey): Only ask the NavigationClient before falling back. Don't ask the loader client.
(WebKit::WebPageProxy::unwrapCryptoKey): Ditto.
2016-09-30 Said Abou-Hallawa <sabouhallawa@apple.com>
The dragged image should be the current frame only of the animated image
https://bugs.webkit.org/show_bug.cgi?id=162109
Reviewed by Tim Horton.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name.
2016-09-30 Anders Carlsson <andersca@apple.com>
Second time going into fullscreen using silverlight, will hide the menu bar and dock for Safari
https://bugs.webkit.org/show_bug.cgi?id=162805
rdar://problem/28208495
Reviewed by Dan Bernstein.
Turns out that the WindowRef wrappers for full screen NSWindows can end up in the m_windows HashSet,
and never go away.
Fix this by storing the canonical CGWindowIDs in the hash map instead.
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::cgWindowID):
(WebKit::windowCoversAnyScreen):
(WebKit::FullscreenWindowTracker::windowShown):
(WebKit::FullscreenWindowTracker::windowHidden):
2016-09-30 Myles C. Maxfield <mmaxfield@apple.com>
Create runtime flag for variation font work
https://bugs.webkit.org/show_bug.cgi?id=162780
Reviewed by Alex Christensen.
* Shared/WebPreferencesDefinitions.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-09-30 Chris Dumez <cdumez@apple.com>
[WK2][iOS] Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint
https://bugs.webkit.org/show_bug.cgi?id=162787
<rdar://problem/28554292>
Reviewed by Benjamin Poulain.
Add radiusX / radiusY / rotationAngle to WebPlatformTouchPoint.
* Platform/spi/ios/UIKitSPI.h:
* Shared/WebEvent.h:
(WebKit::WebPlatformTouchPoint::setRadiusX):
(WebKit::WebPlatformTouchPoint::radiusX):
(WebKit::WebPlatformTouchPoint::setRadiusY):
(WebKit::WebPlatformTouchPoint::radiusY):
(WebKit::WebPlatformTouchPoint::setRotationAngle):
(WebKit::WebPlatformTouchPoint::rotationAngle):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint):
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::extractWebTouchPoint):
* Shared/ios/WebPlatformTouchPointIOS.cpp:
(WebKit::WebPlatformTouchPoint::encode):
(WebKit::WebPlatformTouchPoint::decode):
2016-09-30 Megan Gardner <megan_gardner@apple.com>
Make it possible to test web-related user-interface features
https://bugs.webkit.org/show_bug.cgi?id=162657
Reviewed by Simon Fraser.
Added the ability to pull the strings from an Action Sheet and pass them to
test scripts to make sure we are giving the correct available actions for
the item we are interacting with.
Added a test for long press on an image, and used the sheet scraping functionality
to make sure that the correct actions were being displayed.
Test for previous patch, Changeset 205915; Bug 161761
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _contentsOfUserInterfaceItem:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKActionSheetAssistant.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant currentAvailableActionStrings]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _contentsOfUserInterfaceItem:]):
2016-09-27 Anders Carlsson <andersca@apple.com>
Remove a couple of unused members from PlatformKeyboardEvent
https://bugs.webkit.org/show_bug.cgi?id=162641
Reviewed by Tim Horton.
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
2016-09-29 Nan Wang <n_wang@apple.com>
AX: iOS: Tapping <input> in Safari zooms in a bit when page has max scale = 1
https://bugs.webkit.org/show_bug.cgi?id=162471
Reviewed by Simon Fraser.
* Shared/AssistedNodeInformation.cpp:
(WebKit::AssistedNodeInformation::encode):
(WebKit::AssistedNodeInformation::decode):
* Shared/AssistedNodeInformation.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _displayFormNodeInputView]):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::maximumPageScaleFactorIgnoringAlwaysScalable):
(WebKit::WebPage::getAssistedNodeInformation):
2016-09-29 Daniel Bates <dabates@apple.com>
Mark NetworkLoad as final
https://bugs.webkit.org/show_bug.cgi?id=162681
Reviewed by Alex Christensen.
Mark class NetworkLoad as final as we do not have any derived classes at the moment and it
is unclear if it would make sense to subclass it. We can always unmark the class if it turns
out that it makes sense to subclass it.
* NetworkProcess/NetworkLoad.h:
2016-09-29 Sam Weinig <sam@webkit.org>
Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis
<rdar://problem/27648683>
https://bugs.webkit.org/show_bug.cgi?id=162735
Reviewed by Dan Bernstein.
Add SPI for overriding the following NSURLSessionConfigurations properties:
- _sourceApplicationBundleIdentifier
- _sourceApplicationSecondaryIdentifier
- _CTDataConnectionServiceType
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::globalSourceApplicationBundleIdentifier):
(WebKit::globalSourceApplicationSecondaryIdentifier):
(WebKit::globalCTDataConnectionServiceType):
(WebKit::NetworkSession::setCustomProtocolManager):
(WebKit::NetworkSession::setSourceApplicationAuditTokenData):
(WebKit::NetworkSession::setSourceApplicationBundleIdentifier):
(WebKit::NetworkSession::setSourceApplicationSecondaryIdentifier):
(WebKit::NetworkSession::setCTDataConnectionServiceType):
(WebKit::NetworkSession::NetworkSession):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]):
(-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]):
(-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]):
(-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]):
(-[_WKProcessPoolConfiguration CTDataConnectionServiceType]):
(-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
2016-09-29 Carlos Garcia Campos <cgarcia@igalia.com>
NetworkSession: HTTP authentication doesn't work if PROTECTION_SPACE_AUTH_CALLBACK is not enabled
https://bugs.webkit.org/show_bug.cgi?id=162724
Reviewed by Alex Christensen.
NetworkLoad always expects continueCanAuthenticateAgainstProtectionSpace() to be called to complete the
authentication challenge, which is only defined when PROTECTION_SPACE_AUTH_CALLBACK is enabled.
I've added missing #ifdefs for PROTECTION_SPACE_AUTH_CALLBACK.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::~NetworkLoad):
(WebKit::NetworkLoad::didReceiveChallenge): Call completeAuthenticationChallenge() instead of
canAuthenticateAgainstProtectionSpaceAsync() when PROTECTION_SPACE_AUTH_CALLBACK is not enabled.
(WebKit::NetworkLoad::completeAuthenticationChallenge): Moved common code to complete the authentication
challenge from continueCanAuthenticateAgainstProtectionSpace().
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): Call completeAuthenticationChallenge().
(WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
(WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxy.messages.in:
2016-09-28 Joseph Pecoraro <pecoraro@apple.com>
WKSharedAPICast should not warn about acceptable custom context menu tag values
https://bugs.webkit.org/show_bug.cgi?id=162597
<rdar://problem/28487627>
Reviewed by Tim Horton.
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
(WebKit::toImpl):
Don't log an error when casting ContextMenu types if it is within
the Custom ContextMenu tag range.
2016-09-27 Wenson Hsieh <wenson_hsieh@apple.com>
Adopt MediaRemote SPI to achieve desired Now Playing behavior
https://bugs.webkit.org/show_bug.cgi?id=162658
<rdar://problem/28499358>
Reviewed by Jer Noble.
Plumbs Now Playing session information (for now, this is just a flag indicating whether or not there is an
active session) across from the web process to the UI process for testing in the form of asynchronous request/
handle-response messages on the WebPage and its proxy in the UI process.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestActiveNowPlayingSessionInfo]):
(-[WKWebView _handleActiveNowPlayingSessionInfoResponse:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
(WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::requestActiveNowPlayingSessionInfo):
2016-09-28 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Switch to use GMenu internally in the context menu implementation
https://bugs.webkit.org/show_bug.cgi?id=162603
Reviewed by Michael Catanzaro.
Switch to use GAction instead of GtkAction internally, but still keeping a GtkAction associated to the GAction,
because our API depends on GtkAction.
* Shared/gtk/WebContextMenuItemGtk.cpp:
(WebKit::WebContextMenuItemGtk::WebContextMenuItemGtk):
(WebKit::WebContextMenuItemGtk::createActionIfNeeded): Create the GAction and the associated GtkAction. Ensure a
unique name for the GAction, since the name now matters.
* Shared/gtk/WebContextMenuItemGtk.h:
(WebKit::WebContextMenuItemGtk::gtkAction):
(WebKit::WebContextMenuItemGtk::gAction):
(WebKit::WebContextMenuItemGtk::submenuItems): Deleted.
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::contextMenuItemActivatedCallback): Use the GAction.
(WebKit::WebContextMenuProxyGtk::append): Create a new GMenuItem for the GAction.
(WebKit::WebContextMenuProxyGtk::buildMenu): Build a GMenu for the given items.
(WebKit::WebContextMenuProxyGtk::populate): Create a GMenu and bind it ot the GtkMenu.
(WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk): Create the GActionGroup for the menu.
(WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk): Remove the action group from the GtkMenu.
* UIProcess/gtk/WebContextMenuProxyGtk.h:
2016-09-27 Daniel Bates <dabates@apple.com>
NetworkLoad and PingLoad should use private inheritance
https://bugs.webkit.org/show_bug.cgi?id=162649
Reviewed by Alex Christensen.
Make NetworkLoad privately inherit from NetworkDataTaskClient and ResourceHandleClient,
and make the client callbacks from these interfaces private as this class implements
these interfaces.
Similarly, make PingLoad privately inherit from ResourceHandleClient.
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/PingLoad.h:
2016-09-20 Anders Carlsson <andersca@apple.com>
PlatformEvent::m_modifiers should be an OptionSet
https://bugs.webkit.org/show_bug.cgi?id=162326
Reviewed by Daniel Bates.
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
(WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
2016-09-27 Dan Bernstein <mitz@apple.com>
[iOS] REGRESSION (r182126): Selection highlight and handles aren’t visible with WKSelectionGranularityCharacter
https://bugs.webkit.org/show_bug.cgi?id=162577
<rdar://problem/28481984>
Reviewed by Simon Fraser.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _uiTextSelectionRectViews]): Added this method in the WKTesting category, which
uses UIKit internals to get the views used for the selection highlight.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _selectionClipRect]): When selection is not confined to a form control or
content-editable element, return the null rect to indicate no clipping, rather than
clipping to the empty rect at the origin.
2016-09-27 Jer Noble <jer.noble@apple.com>
Remove deprecated ENCRYPTED_MEDIA implementation.
https://bugs.webkit.org/show_bug.cgi?id=161010
Reviewed by Eric Carlson.
Remove ENABLE_ENCRYPTED_MEDIA.
* Configurations/FeatureDefines.xcconfig:
2016-09-27 Chris Dumez <cdumez@apple.com>
[WK2] Navigating to a Blob URL does not trigger a download
https://bugs.webkit.org/show_bug.cgi?id=162574
Reviewed by Darin Adler.
Add support for converting Blob URL loads into downloads.
* NetworkProcess/Downloads/BlobDownloadClient.cpp:
(WebKit::BlobDownloadClient::didReceiveResponseAsync):
Make sure we return a valid suggested filename because the client side (Safari)
does not deal with empty suggested filenames. Use "unknown" by default to
match the default suggested filename of non-Blob downloads.
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::startWithHandle):
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::convertHandleToDownload):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/ios/DownloadIOS.mm:
(WebKit::Download::startNetworkLoadWithHandle):
* NetworkProcess/Downloads/mac/DownloadMac.mm:
(WebKit::Download::startNetworkLoadWithHandle):
* NetworkProcess/Downloads/soup/DownloadSoup.cpp:
(WebKit::Download::startNetworkLoadWithHandle):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
* NetworkProcess/NetworkLoad.h:
(WebKit::NetworkLoad::handle):
2016-09-27 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Unreviewed typo fix
* UIProcess/API/gtk/WebKitWebInspector.cpp:
(webkit_web_inspector_class_init):
2016-09-27 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
[GTK] Should check whether GDK can use GL before asking it to
https://bugs.webkit.org/show_bug.cgi?id=162598
Reviewed by Michael Catanzaro.
gdk_cairo_draw_from_gl can fail even when WebKit itself has been able to use GL (its
context creation code might be buggy, GL may have been disabled using GDK_GL=disable, …).
Unfortunately it does not have any error reporting other than a warning printed to
stderr, so we cannot fallback from it. We have to first check if GL can be used by GDK
by trying to create a context.
See https://bugzilla.redhat.com/show_bug.cgi?id=1378987
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::canGdkUseGL): decide whether GDK can use GL by
trying to create a context for a GdkWindow.
(WebKit::AcceleratedBackingStoreWayland::paint): fallback to glReadPixels if GDK cannot
use GL.
* UIProcess/gtk/AcceleratedBackingStoreWayland.h:
2016-09-26 Tim Horton <timothy_horton@apple.com>
Delete some unused code from r202695
https://bugs.webkit.org/show_bug.cgi?id=162595
<rdar://problem/28343784>
Reviewed by Dan Bernstein.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]): Deleted.
(-[WKWebView _didFirstVisuallyNonEmptyLayoutForMainFrame]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
We didn't end up needing this mechanism.
2016-09-26 Dan Bernstein <mitz@apple.com>
-_webViewWebProcessDidBecomeUnresponsive: gets called when the Web process is stopped in the debugger
https://bugs.webkit.org/show_bug.cgi?id=162234
Reviewed by Sam Weinig.
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::platformIsBeingDebugged): Use the KERN_PROC sysctl to get the
process flags and check for P_TRACED.
* UIProcess/ResponsivenessTimer.cpp:
(WebKit::ResponsivenessTimer::timerFired): Call the new client function
mayBecomeUnresponsive. If it returns false, restart the timer and bail out without
changing the responsiveness state.
* UIProcess/ResponsivenessTimer.h: Declared new client function mayBecomeUnresponsive.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::platformIsBeingDebugged): A generic implementation that always
returns false.
(WebKit::WebProcessProxy::mayBecomeUnresponsive): Implement this new
ResponsivenessTimer::Client function to return true unless the process is being debugged.
* UIProcess/WebProcessProxy.h:
2016-09-26 Chris Dumez <cdumez@apple.com>
[WK2] BlobDownloadClient should use asynchronous IPC to decide destination path
https://bugs.webkit.org/show_bug.cgi?id=162568
Reviewed by Alex Christensen.
Use DecideDestinationWithSuggestedFilenameAsync IPC to decide the destination
path in the case of Blob downloads, instead of the synchronous alternative.
To achieve this, BlobResourceHandle was updated in WebCore to properly support
asynchronous callback and BlobDownloadClient was updated to use asynchronous
callbacks. When BlobDownloadClient::didReceiveResponseAsync() is called, we
now ask the WebContent process asynchronously to decide what the destination
path should be. Then, when we later get the destination path back from the
WebContent process, we create the file on disk and call
continueDidReceiveResponse() on the BlobResourceHandle so we start getting the
blob data to write.
* NetworkProcess/Downloads/BlobDownloadClient.cpp:
(WebKit::BlobDownloadClient::didReceiveResponseAsync):
(WebKit::BlobDownloadClient::didDecideDownloadDestination):
* NetworkProcess/Downloads/BlobDownloadClient.h:
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::decideDestinationWithSuggestedFilenameAsync):
(WebKit::Download::didDecideDownloadDestination):
(WebKit::Download::continueDidReceiveResponse):
(WebKit::Download::decideDestinationWithSuggestedFilename): Deleted.
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::willDecidePendingDownloadDestination):
(WebKit::DownloadManager::continueDecidePendingDownloadDestination):
(WebKit::DownloadManager::convertHandleToDownload): Deleted.
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::continueDidReceiveResponse):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): Deleted.
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxy.messages.in:
2016-09-26 Daniel Bates <dabates@apple.com>
Mark Ping{Handle, Load} as final
https://bugs.webkit.org/show_bug.cgi?id=162576
Reviewed by Alex Christensen.
We should not support subclassing of a ping handle or overriding its NetworkDataTaskClient
callbacks because there are security/privacy implications with a ping request. We should
not encourage subclassing without careful consideration.
* NetworkProcess/PingLoad.h:
2016-09-26 Daniel Bates <dabates@apple.com>
Rename IOS_TEXT_AUTOSIZING to TEXT_AUTOSIZING
https://bugs.webkit.org/show_bug.cgi?id=162365
Reviewed by Simon Fraser.
* Configurations/FeatureDefines.xcconfig:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com>
Fix -Wformat warnings in WebLoaderStrategy
https://bugs.webkit.org/show_bug.cgi?id=162553
Reviewed by Alex Christensen.
Consistently use PRIu64 to print uint64_t
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::didReceiveResponse):
(WebKit::Download::didReceiveData):
(WebKit::Download::didFinish):
(WebKit::Download::didFail):
(WebKit::Download::didCancel):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::setDefersLoading):
(WebKit::NetworkResourceLoader::abort):
(WebKit::NetworkResourceLoader::didReceiveBuffer):
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::didFailLoading):
(WebKit::NetworkResourceLoader::continueWillSendRequest):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::willSendRequest):
(WebKit::WebResourceLoader::didReceiveResponse):
(WebKit::WebResourceLoader::didReceiveData):
(WebKit::WebResourceLoader::didFinishResourceLoad):
(WebKit::WebResourceLoader::didFailResourceLoad):
(WebKit::WebResourceLoader::didReceiveResource):
== Rolled over to ChangeLog-2016-09-26 ==