2015-04-29 Simon Fraser Allow testing of plug-ins that handle wheel events. https://bugs.webkit.org/show_bug.cgi?id=144413 Reviewed by Tim Horton. Allow the Test Netscape Plug-in to pretend to handle wheel events, so layout tests can use it. * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::NetscapePluginModule::determineQuirks): 2015-04-29 Filip Pizlo JSTypeInfo should have an inline type flag to indicate if getCallData() has been overridden https://bugs.webkit.org/show_bug.cgi?id=144397 Reviewed by Andreas Kling. If you override getCallData() and you want to be called a "function", then you need to use the new TypeOfShouldCallGetCallData flag. * WebProcess/Plugins/Netscape/JSNPObject.h: 2015-04-29 Antti Koivisto ResourceLoadPriority should be enum class https://bugs.webkit.org/show_bug.cgi?id=144326 Reviewed by Darin Adler. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::servePendingRequests): Deleted. Remove this unused message. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeStoreDecision): (WebKit::NetworkCache::Cache::retrieve): * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm: (WebKit::NetworkResourceLoadScheduler::platformInitializeNetworkSettings): * WebProcess/Network/WebResourceLoadScheduler.cpp: (WebKit::WebResourceLoadScheduler::servePendingRequests): * WebProcess/Network/WebResourceLoadScheduler.h: 2015-04-29 Myles C. Maxfield [OS X] Use CTFontCreateForCSS instead of doing font search ourselves https://bugs.webkit.org/show_bug.cgi?id=132159 Reviewed by Darin Adler. Add SPI to set the font whitelist. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/API/C/WKContext.cpp: (WKContextSetFontWhitelist): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setFontWhitelist): * UIProcess/WebProcessPool.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2015-04-29 Martin Robinson [CMake] [GTK] Organize and clean up unused CMake variables https://bugs.webkit.org/show_bug.cgi?id=144364 Reviewed by Gyuyoung Kim. * PlatformGTK.cmake: Add variables specific to this project. * webkit2gtk-web-extension.pc.in: Hardcode the GTK+ API version. It rarely changes. * webkit2gtk.pc.in: Ditto. 2015-04-29 Carlos Garcia Campos REGRESSION(r182573): [GTK] The default context menu contains an empty item since r182573 https://bugs.webkit.org/show_bug.cgi?id=144388 Reviewed by Brady Eidson. Move the WebContextMenuClient::shareMenuItem() implementation to platform files, since platforms not supporting share menu item should return a null ContextMenuIem instead. * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::shareMenuItem): Deleted. * WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp: (WebKit::WebContextMenuClient::shareMenuItem): * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp: (WebKit::WebContextMenuClient::shareMenuItem): * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: (WebKit::WebContextMenuClient::shareMenuItem): 2015-04-29 Carlos Garcia Campos REGRESSION(r183467): [SOUP] isMainResource is no longer passed as resource load parameters to the network process https://bugs.webkit.org/show_bug.cgi?id=144381 Reviewed by Darin Adler. A requester enum value is passed now as part of the ResourceRequest, but it's not encoded/decoded for soup. * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder::encodePlatformData): Encode requester. (IPC::ArgumentCoder::decodePlatformData): Decode requester. 2015-04-28 Carlos Garcia Campos [SOUP] Use xattrs to get/set the creation time of disk cache files https://bugs.webkit.org/show_bug.cgi?id=144251 Reviewed by Martin Robinson. The network process disk cache uses the creation time to compute a worth value used to determine the order in which cached resources are deleted when the cache is shrunk. In some operating systems like Linux there's no st_birthtime in struct stat, but since cache files are always created and deleted by us, we could use a custom xattr to store and retrieve the creation time of cached resources. * NetworkProcess/cache/NetworkCacheFileSystemPosix.h: (WebKit::NetworkCache::fileTimes): * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::IOChannel::IOChannel): 2015-04-28 Carlos Garcia Campos Network Cache: Do not create a SharedBuffer for mapped resources unless explicitly requested https://bugs.webkit.org/show_bug.cgi?id=144337 Reviewed by Antti Koivisto. We send a buffer or a memory mapped handler to the web process depending on whether the resource body is mapped or not, but we are always creating a shared buffer even for mapped resources. Split initializeBufferFromStorageRecord() moving the mapped memory handler initialization to its own method. * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord): Initialize the mapped memory handler if the body data is mapped. (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord): Initialize the buffer by wrapping the mapped memory if the body data is mapped, or using the body data directly otherwise. (WebKit::NetworkCache::Entry::shareableResourceHandle): Call initializeShareableResourceHandleFromStorageRecord() if the handler is null. * NetworkProcess/cache/NetworkCacheEntry.h: 2015-04-28 Simon Fraser Make a non-static version of FrameView::yPositionForRootContentLayer() https://bugs.webkit.org/show_bug.cgi?id=144375 Reviewed by Andy Estes. There were two calls to the static FrameView::yPositionForRootContentLayer() which passed in all the arguments for the same FrameView. Make a member function for convenience. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::shadowLayerPositionForFrame): 2015-04-28 Ryuan Choi [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS https://bugs.webkit.org/show_bug.cgi?id=143001 Reviewed by Gyuyoung Kim. * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp: (WebKit::CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::dispatchViewportPropertiesDidChange): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidLayout): (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setSize): (WebKit::WebPage::setUseFixedLayout): (WebKit::WebPage::canHandleUserEvents): * WebProcess/WebPage/WebPage.h: 2015-04-28 Timothy Horton [TextIndicator] Yellow highlight takes too long to fade out on scroll https://bugs.webkit.org/show_bug.cgi?id=144358 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView renewGState]): (-[WKView viewDidMoveToWindow]): (-[WKView _dictionaryLookupPopoverWillClose:]): (-[WKView _setTextIndicator:]): (-[WKView _setTextIndicator:withLifetime:]): (-[WKView _clearTextIndicatorWithAnimation:]): (-[WKView magnifyWithEvent:]): (-[WKView smartMagnifyWithEvent:]): (-[WKView setMagnification:centeredAtPoint:]): (-[WKView setMagnification:]): (-[WKView _dismissContentRelativeChildWindows]): (-[WKView _dismissContentRelativeChildWindowsWithAnimation:]): (-[WKView _setTextIndicator:fadeOut:]): Deleted. * UIProcess/API/mac/WKViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::pageDidScroll): (WebKit::WebPageProxy::setTextIndicator): (WebKit::WebPageProxy::clearTextIndicator): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::setTextIndicator): (WebKit::PageClientImpl::clearTextIndicator): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setTextIndicator): (WebKit::PageClientImpl::clearTextIndicator): (WebKit::PageClientImpl::didPerformDictionaryLookup): (WebKit::PageClientImpl::dismissContentRelativeChildWindows): * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]): * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController _defaultAnimationController]): (-[WKImmediateActionController _animationControllerForDataDetectedText]): (-[WKImmediateActionController _animationControllerForDataDetectedLink]): (-[WKImmediateActionController _animationControllerForText]): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindIndicator): Make _setTextIndicator take a reference. Add a variant of _setTextIndicator that takes a Lifetime. Make _clearTextIndicatorWithAnimation take a DismissalAnimation. Make dismissContentRelativeChildWindows take a parameter indicating whether the dismissal should include animation or not (currently only applies to TextIndicator). Don't animate when dismissal occurs because of scrolling, zooming, or other things in which the content will have changed significantly underneath the indicator and shouldn't have a slowly-fading-out yellow highlight. 2015-04-28 Michael Catanzaro Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT https://bugs.webkit.org/show_bug.cgi?id=144304 Reviewed by Geoffrey Garen. Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default. * Configurations/FeatureDefines.xcconfig: 2015-04-28 Commit Queue Unreviewed, rolling out r183514. https://bugs.webkit.org/show_bug.cgi?id=144359 It broke cloop test bots (Requested by mcatanzaro on #webkit). Reverted changeset: "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT" https://bugs.webkit.org/show_bug.cgi?id=144304 http://trac.webkit.org/changeset/183514 2015-04-28 Michael Catanzaro Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT https://bugs.webkit.org/show_bug.cgi?id=144304 Reviewed by Geoffrey Garen. Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default. * Configurations/FeatureDefines.xcconfig: 2015-04-28 Enrica Casucci Add support for lookup on iOS. https://bugs.webkit.org/show_bug.cgi?id=144342 rdar://problem/19994090 Reviewed by Tim Horton. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _lookup:]): (-[WKContentView canPerformAction:withSender:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::getLookupContextAtPoint): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getLookupContextAtPoint): 2015-04-28 Brady Eidson Consolidate most "frame load" arguments into FrameLoadRequest. https://bugs.webkit.org/show_bug.cgi?id=144276 Reviewed by Alexey Proskuryakov. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): 2015-04-28 Chris Dumez [WK2][Mac] Update WebContent process' sandbox profile for AWD https://bugs.webkit.org/show_bug.cgi?id=144315 Reviewed by Alexey Proskuryakov. Update sandbox profile for AWD similarly to what was done for iOS in r182278. * WebProcess/com.apple.WebProcess.sb.in: 2015-04-28 Antti Koivisto Network Cache: Disk cache getting filled by YouTube video data https://bugs.webkit.org/show_bug.cgi?id=144259 Reviewed by Darin Adler. MSE media is loaded via XHR and tends to eventually fill the cache. YouTube serves the media chunks cacheable, however they are rarely (if ever) reused. We can reduce disk writes and keep more useful resources around by not caching them * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponseAsync): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeStoreDecision): Don't store if the requester is XHR and response has video or audio content type. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::storeDecisionToDiagnosticKey): * Shared/Network/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): (WebKit::NetworkResourceLoadParameters::encode): (WebKit::NetworkResourceLoadParameters::decode): * Shared/Network/NetworkResourceLoadParameters.h: The requester type is now part of the ResourceRequest, no need for separate parameter. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): * WebProcess/Network/WebResourceLoadScheduler.cpp: (WebKit::WebResourceLoadScheduler::scheduleLoad): 2015-04-28 Zan Dobersek [WK2] API::UserContentURLPattern creation functions should return Ref<> https://bugs.webkit.org/show_bug.cgi?id=144225 Reviewed by Darin Adler. Have API::UserContentURLPattern creation functions return Ref<>. Call-sites are also updated, using and operating on the returned Ref<> object where possible. * Shared/API/APIUserContentURLPattern.h: (API::UserContentURLPattern::create): * Shared/API/c/WKUserContentURLPattern.cpp: (WKUserContentURLPatternCreate): 2015-04-28 Zan Dobersek [WK2] API::URLRequest, API::URLResponse creation functions should return Ref<> https://bugs.webkit.org/show_bug.cgi?id=144224 Reviewed by Darin Adler. Have API::URLRequest and API::URLResponse creation functions return Ref<>. The call-sites are also updated, using and operating on the returned Ref<> object where possible. * Shared/API/APIURLRequest.h: (API::URLRequest::create): * Shared/API/APIURLResponse.h: (API::URLResponse::create): * Shared/API/c/WKURLRequest.cpp: (WKURLRequestCreateWithWKURL): * Shared/API/c/mac/WKURLRequestNS.mm: (WKURLRequestCreateWithNSURLRequest): * Shared/API/c/mac/WKURLResponseNS.mm: (WKURLResponseCreateWithNSURLResponse): * UIProcess/API/C/WKContext.cpp: (WKContextSetDownloadClient): * UIProcess/API/C/WKDownload.cpp: (WKDownloadCopyRequest): * UIProcess/API/C/WKNavigationDataRef.cpp: (WKNavigationDataCopyOriginalRequest): * UIProcess/API/C/WKPage.cpp: (WKPageSetPagePolicyClient): (WKPageSetPageUIClient): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: (WebKit::WebSoupCustomProtocolRequestManagerClient::startLoading): * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (willSendRequestForFrame): * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp: (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction): (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction): (WebKit::InjectedBundlePagePolicyClient::decidePolicyForResponse): 2015-04-27 Zan Dobersek [WK2] API::Point, API::Size, API::Rect creation functions should return Ref<> https://bugs.webkit.org/show_bug.cgi?id=144223 Reviewed by Darin Adler. Have API::Point, API::Size and API::Rect creation functions return Ref<>. Call-sites are also updated, using and operating on the returned Ref<> object where possible. * Shared/API/APIGeometry.h: (API::Size::create): (API::Point::create): (API::Rect::create): * Shared/API/c/WKGeometry.cpp: (WKPointCreate): (WKSizeCreate): (WKRectCreate): 2015-04-27 Zan Dobersek [WK2] API::Error creation functions should return Ref<> https://bugs.webkit.org/show_bug.cgi?id=144222 Reviewed by Darin Adler. Have API::Error creation functions return Ref<>. The call-sites are also updated, using and operating on the returned Ref<> object where possible. * Shared/API/APIError.h: (API::Error::create): * Shared/API/c/cf/WKErrorCF.cpp: (WKErrorCreateWithCFError): * UIProcess/API/C/WKOriginDataManager.cpp: (WKOriginDataManagerDeleteEntriesForOrigin): (WKOriginDataManagerDeleteEntriesModifiedBetweenDates): (WKOriginDataManagerDeleteAllEntries): * UIProcess/API/C/WKPage.cpp: (toGenericCallbackFunction): (WKPageForceRepaint): (WKPageValidateCommand): (WKPageComputePagesForPrinting): * UIProcess/API/C/WKPluginSiteDataManager.cpp: (WKPluginSiteDataManagerClearSiteData): (WKPluginSiteDataManagerClearAllSiteData): * UIProcess/GenericCallback.h: (WebKit::toGenericCallbackFunction): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::printFinishedCallback): 2015-04-27 Sungmann Cho [GTK] Remove unnecessary semicolon from WebKitNotificationProvider.h. https://bugs.webkit.org/show_bug.cgi?id=144312 Reviewed by Martin Robinson. No new tests, no behavior change. * UIProcess/API/gtk/WebKitNotificationProvider.h: 2015-04-27 Brent Fulgham PDF action menu fixes https://bugs.webkit.org/show_bug.cgi?id=144299 Reviewed by Tim Horton. Make two corrections to how PDFs are handled: 1. When calculating the view rect for the user's selection, make sure that we get coordinates for the correct PDF page. The existing code assumed that the current PDFLayerControler's current page was correct, but this will not be true if you zoom the PDF out so that several pages are displayed at once. Each selection keeps track of the page it is referenced against. 2. Revise the offsets calculated for the TextIndicator to take into account the font descender (as well as the ascender), and to adjust by the scaled amount of margin around the selected text. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::viewRectForSelection): Use correct page for calculating the coordinates. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Include font 'descendant' and (scaled) margin when adjusting the hit target for the TextIndicator to draw. 2015-04-27 Michael Catanzaro Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D https://bugs.webkit.org/show_bug.cgi?id=144193 Reviewed by Darin Adler. * CMakeLists.txt: 2015-04-24 Jon Honeycutt Context menus are not reshown after an orientation change Reviewed by Darin Adler. * UIProcess/ios/WKActionSheet.mm: (-[WKActionSheet updateSheetPosition]): Return early if we're still in a rotation, not if the rotation is complete. 2015-04-27 Zan Dobersek [WK2] API::Dictionary creation functions should return Ref<> https://bugs.webkit.org/show_bug.cgi?id=144221 Reviewed by Darin Adler. Have API::Dictionary creation functions return Ref<>. The call-sites are also updated, using and operating on the returned Ref<> object where possible. * Shared/API/APIDictionary.cpp: (API::Dictionary::create): * Shared/API/APIDictionary.h: * Shared/API/Cocoa/WKRemoteObjectCoder.mm: (createEncodedObject): * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm: (-[_WKRemoteObjectRegistry _sendInvocation:interface:]): * Shared/API/c/WKDictionary.cpp: (WKDictionaryCreate): * Shared/API/c/WKMutableDictionary.cpp: (WKMutableDictionaryCreate): * Shared/Plugins/Netscape/PluginInformation.cpp: (WebKit::createPluginInformationDictionary): * Shared/Plugins/Netscape/PluginInformation.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/gtk/WebKitWebContext.cpp: (webkit_web_context_prefetch_dns): * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_get_snapshot): * UIProcess/Plugins/PlugInAutoStartProvider.cpp: (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy): * UIProcess/Plugins/PlugInAutoStartProvider.h: * UIProcess/StatisticsRequest.cpp: (WebKit::createDictionaryFromHashMap): (WebKit::StatisticsRequest::completedRequest): * UIProcess/WebFormClient.cpp: (WebKit::WebFormClient::willSubmitForm): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailToInitializePlugin): * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (didInitiateLoadForResource): (willSendRequestForFrame): (didReceiveResponseForResource): (didReceiveContentLengthForResource): (didFinishLoadForResource): (didFailLoadForResource): (webkitWebPageDidReceiveMessage): * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp: (WebKit::InjectedBundlePageFormClient::willSendSubmitEvent): (WebKit::InjectedBundlePageFormClient::willSubmitForm): 2015-04-27 Zan Dobersek [WK2] API::Data creation functions should return Ref<> https://bugs.webkit.org/show_bug.cgi?id=144220 Reviewed by Darin Adler. Have API::Data creation functions return Ref<>. The call-sites are also updated, using and operating on the returned Ref<> object where possible. * Shared/API/APIData.h: (API::Data::createWithoutCopying): (API::Data::create): * Shared/API/c/WKData.cpp: (WKDataCreate): * Shared/API/c/mac/WKWebArchive.cpp: (WKWebArchiveCopyData): * Shared/API/c/mac/WKWebArchiveResource.cpp: (WKWebArchiveResourceCopyData): * Shared/APIWebArchive.h: * Shared/APIWebArchive.mm: (API::WebArchive::data): * Shared/APIWebArchiveResource.h: * Shared/APIWebArchiveResource.mm: (API::WebArchiveResource::data): * Shared/Cocoa/APIDataCocoa.mm: (API::Data::createWithoutCopying): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]): * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: (webkitURISchemeRequestReadCallback): * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_load_bytes): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::createData): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dataCallback): (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder): 2015-04-27 Zan Dobersek [WK2] API::URL creation functions should return Ref<> https://bugs.webkit.org/show_bug.cgi?id=144219 Reviewed by Darin Adler. Have API::URL creation functions return Ref<>. The call-sites are also updated, using and operating in the returned Ref<> object, where possible. * Shared/API/APIURL.h: (API::URL::create): * Shared/API/c/WKSharedAPICast.h: (WebKit::toCopiedURLAPI): * Shared/API/c/WKURL.cpp: (WKURLCreateWithUTF8CString): (WKURLCreateWithBaseURL): * UIProcess/API/gtk/WebKitWebResource.cpp: (webkit_web_resource_get_data): * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::didChangeIconForPageURL): (WebKit::WebIconDatabase::notifyIconDataReadyForPageURL): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userAgent): 2015-04-27 Zan Dobersek [WK2] API::String creation functions should return Ref<> https://bugs.webkit.org/show_bug.cgi?id=144218 Reviewed by Darin Adler. Have API::String creation functions return Ref<>. The call-sites are also updated, using and operating on the returned Ref<> object, where possible. * Shared/API/APIString.h: * Shared/API/c/WKPluginInformation.cpp: (WKPluginInformationBundleIdentifierKey): (WKPluginInformationBundleVersionKey): (WKPluginInformationBundleShortVersionKey): (WKPluginInformationPathKey): (WKPluginInformationDisplayNameKey): (WKPluginInformationDefaultLoadPolicyKey): (WKPluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey): (WKPluginInformationHasSandboxProfileKey): (WKPluginInformationFrameURLKey): (WKPluginInformationMIMETypeKey): (WKPluginInformationPageURLKey): (WKPluginInformationPluginspageAttributeURLKey): (WKPluginInformationPluginURLKey): (WKPlugInInformationReplacementObscuredKey): * Shared/API/c/WKSharedAPICast.h: (WebKit::ProxyingRefPtr::ProxyingRefPtr): (WebKit::toCopiedAPI): * Shared/API/c/WKString.cpp: (WKStringCreateWithUTF8CString): (WKStringCreateWithJSString): * UIProcess/API/C/WKDatabaseManager.cpp: (WKDatabaseManagerGetOriginKey): (WKDatabaseManagerGetOriginQuotaKey): (WKDatabaseManagerGetOriginUsageKey): (WKDatabaseManagerGetDatabaseDetailsKey): (WKDatabaseManagerGetDatabaseDetailsNameKey): (WKDatabaseManagerGetDatabaseDetailsDisplayNameKey): (WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey): (WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey): (WKDatabaseManagerGetDatabaseDetailsCreationTimeKey): (WKDatabaseManagerGetDatabaseDetailsModificationTimeKey): * UIProcess/API/C/WKKeyValueStorageManager.cpp: (WKKeyValueStorageManagerGetOriginKey): (WKKeyValueStorageManagerGetCreationTimeKey): (WKKeyValueStorageManagerGetModificationTimeKey): * UIProcess/API/C/WKPage.cpp: (WKPageGetSessionHistoryURLValueType): (WKPageGetSessionBackForwardListItemValueType): (toGenericCallbackFunction): (WKPageValidateCommand): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::didReceiveInvalidMessage): 2015-04-27 Brady Eidson Make 'enum NavigationType' be an enum class https://bugs.webkit.org/show_bug.cgi?id=144270 Reviewed by Alex Christensen. * Shared/API/c/WKSharedAPICast.h: (WebKit::toAPI): * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::NavigationActionData): * UIProcess/API/Cocoa/WKNavigationAction.mm: (toWKNavigationType): * UIProcess/API/gtk/WebKitPrivate.cpp: (toWebKitNavigationType): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): 2015-04-27 Brent Fulgham REGRESSION(r182879): Images and video can no longer be downloaded https://bugs.webkit.org/show_bug.cgi?id=144267 Reviewed by Simon Fraser. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _createActionMenuItemForTag:]): Check for "!WebCore::protocolIs(..., "file")" for image and media downloads. 2015-04-27 Csaba Osztrogonác [EFL] TestWebKitAPI's forwarding header generator should depend on WebKit2's generator https://bugs.webkit.org/show_bug.cgi?id=143874 Reviewed by Gyuyoung Kim. * PlatformEfl.cmake: Rename the generator to have consistent name with other generators. * Scripts/generate-forwarding-headers.pl: Removed the unnecessary multiple include-path support. 2015-04-17 Carlos Garcia Campos [SOUP] Add initial implementation of NetworkProcess disk cache https://bugs.webkit.org/show_bug.cgi?id=143872 Reviewed by Martin Robinson. Implement the platform specific parts of the disk cache implementation for Soup. It's mainly NetworkCache::Data and NetworkCache::IOChannel. * CMakeLists.txt: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::dumpFileChanged): (WebKit::NetworkCache::Cache::initialize): * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: * NetworkProcess/cache/NetworkCacheData.h: (WebKit::NetworkCache::Data::soupBuffer): * NetworkProcess/cache/NetworkCacheDataSoup.cpp: Added. (WebKit::NetworkCache::Data::Data): (WebKit::NetworkCache::Data::empty): (WebKit::NetworkCache::Data::data): (WebKit::NetworkCache::Data::isNull): (WebKit::NetworkCache::Data::apply): (WebKit::NetworkCache::Data::subrange): (WebKit::NetworkCache::concatenate): (WebKit::NetworkCache::MapWrapper::~MapWrapper): (WebKit::NetworkCache::deleteMapWrapper): (WebKit::NetworkCache::mapFile): (WebKit::NetworkCache::Data::adoptMap): (WebKit::NetworkCache::computeSHA1): (WebKit::NetworkCache::bytesEqual): * NetworkProcess/cache/NetworkCacheIOChannel.h: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: Added. (WebKit::NetworkCache::IOChannel::IOChannel): (WebKit::NetworkCache::IOChannel::open): (WebKit::NetworkCache::fillDataFromReadBuffer): (WebKit::NetworkCache::inputStreamReadReadyCallback): (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::IOChannel::readSync): (WebKit::NetworkCache::outputStreamWriteReadyCallback): (WebKit::NetworkCache::IOChannel::write): * NetworkProcess/cache/NetworkCacheStorageSoup.cpp: Removed. * NetworkProcess/gtk/NetworkProcessMainGtk.cpp: * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::NetworkProcess::platformSetCacheModel): (WebKit::NetworkProcess::clearDiskCache): * PlatformGTK.cmake: 2015-04-26 Yusuke Suzuki [ES6] Implement ES6 template literals https://bugs.webkit.org/show_bug.cgi?id=142691 Reviewed by Darin Adler. Add ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX compile time flag. * Configurations/FeatureDefines.xcconfig: 2015-04-26 Sungmann Cho Remove PluginView::renderer(). https://bugs.webkit.org/show_bug.cgi?id=144216 Reviewed by Darin Adler. Nobody should have to know about the plug-in view's renderer except the plug-in view itself. No new tests, no behavior change. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::convertFromScrollbarToContainingView): (WebKit::PDFPlugin::convertFromContainingViewToScrollbar): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::renderer): Deleted. * WebProcess/Plugins/PluginView.h: 2015-04-26 Doug Russell AX: richer text change notifications (142719) https://bugs.webkit.org/show_bug.cgi?id=142719 Reviewed by Darin Adler. Richer accessibility value change notifications. Introduce AXTextEditType, postTextStateChangeNotification and postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content. Also implement a mechanism to post value changes in password form fields in coalesced ticks to thwart analyzing the cadence of changes. Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent, and an overload of postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content selection. Also block posting selection changes on password fields. * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::nameForEditAction): 2015-04-26 Dan Bernstein REGRESSION (r182952): Plug-in service fails to load because it links against WebKit2.framework https://bugs.webkit.org/show_bug.cgi?id=144233 Reviewed by Simon Fraser. Have the plug-in service link against WebKit.framework rather than WebKit2.framework. * Configurations/PluginService.32.xcconfig: Removed linker flags for linking against WebKit2 and Foundation from the definition of OTHER_LDFLAGS. Since linking is no longer conditional, we can just do it in the target’s Link Binary With Libraries build phase. * Configurations/PluginService.64.xcconfig: Ditto. * WebKit2.xcodeproj/project.pbxproj: Have Foundation and WebKit listed in the services’ Link Binariy With Libraries build phases (one service already had WebKit). 2015-04-26 Dan Bernstein Fixed the build. * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _showDocumentPickerMenu]): Suppressed deprecation warnings around use of -[UIDocumentMenuViewController _setIgnoreApplicationEntitlementForImport:]. 2015-04-25 Tim Horton Further update gesture swipe shadow style https://bugs.webkit.org/show_bug.cgi?id=144215 Reviewed by Dan Bernstein. * Resources/mac/SwipeShadow.png: Removed. * Resources/mac/SwipeShadow@2x.png: Removed. * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::beginSwipeGesture): * WebKit2.xcodeproj/project.pbxproj: Use a CAGradientLayer instead of PNGs for the swipe shadow. 2015-04-25 Dan Bernstein WebKit2 part of Avoid using TBD as an argument to NS_AVAILABLE https://bugs.webkit.org/show_bug.cgi?id=144201 Reviewed by Darin Adler. Instead of TBD, we use the high version number to which it corresponds in CFAvailability.h, 9876.5. * mac/MigrateHeadersFromWebKitLegacy.make: To detect not-yet-available declarations in headers, look for "9876_5" rather than "TBA". 2015-04-24 Timothy Hatcher Web Inspector: Remove native window dock controls https://bugs.webkit.org/show_bug.cgi?id=144184 Reviewed by Joseph Pecoraro. * Resources/DockBottom.pdf: Removed. * Resources/DockBottomLegacy.pdf: Removed. * Resources/DockRight.pdf: Removed. * Resources/DockRightLegacy.pdf: Removed. * UIProcess/WebInspectorProxy.h: * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::createInspectorWindow): (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): * WebKit2.xcodeproj/project.pbxproj: 2015-04-25 Martin Robinson Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS https://bugs.webkit.org/show_bug.cgi?id=144182 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS. 2015-04-24 Simon Fraser Have the web inspector report accurate memory use for layers with detached backing store https://bugs.webkit.org/show_bug.cgi?id=144179 Reviewed by Dean Jackson. Remote layers can make their backing store volatile, so the backing only contributes to reported memory use when attached. * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 2015-04-24 Andreas Kling theverge.com burning 100% CPU on iPad (due to window.screenX/Y) Reviewed by Anders Carlsson. Return an empty window rect on iOS WK2 builds. This avoids sending a synchronous IPC request to the UI process that would give the same result, but spend way more time and CPU cycles to do so. With this change, theverge.com CPU usage goes from 100% to ~20% when idle. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::windowRect): 2015-04-24 Brent Fulgham TextIndicator for embedded PDFs is slightly offset https://bugs.webkit.org/show_bug.cgi?id=144172 Reviewed by Tim Horton. When I converted the existing DOM Range logic to work with PDFSelections, I omitted the step where the font ascent was used to adjust the origin used for the TextIndicator. This patch determines the correct ascent for the range of characters in the selection, and adjusts the offset by the difference between the ascent and the height of the selection rect. Also, since the PDFSelection only supplies the bounding rect for the selection, I calculate an equivalent text bounding box by insetting the rect by half the size of the ascent. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::scaleFactor): Add accessor for PDF scale factor. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Adjusted to take the font ascent and scale factor into account. 2015-04-24 David Kilzer REGRESSION (r183293): Fix iOS EWS build by adding SPI declaration for +[UIPeripheralHost visiblePeripheralFrame] Fixes the following build failures: WebKit2/UIProcess/ios/WKPDFView.mm:740:45: error: class method '+visiblePeripheralFrame' not found (return type defaults to 'id') [-Werror,-Wobjc-method-access] CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame]; ^~~~~~~~~~~~~~~~~~~~~~ WebKit2/UIProcess/ios/WKPDFView.mm:740:12: error: no viable conversion from 'id' to 'CGRect' CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Platform/spi/ios/UIKitSPI.h: (+[UIPeripheralHost visiblePeripheralFrame]): Add declaration. 2015-04-24 Anders Carlsson Change _WKWebsiteDataStore to hold on to an internal WKWebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=144171 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _websiteDataStore]): (-[WKWebViewConfiguration _setWebsiteDataStore:]): * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: (-[_WKWebsiteDataStore initWithDataStore:]): (+[_WKWebsiteDataStore defaultDataStore]): (+[_WKWebsiteDataStore nonPersistentDataStore]): (-[_WKWebsiteDataStore isNonPersistent]): (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]): (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]): (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): * UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h. * WebKit2.xcodeproj/project.pbxproj: 2015-04-24 Tim Horton WKPDFView does not support password-protected PDFs https://bugs.webkit.org/show_bug.cgi?id=144162 Reviewed by Andy Estes. * Platform/spi/ios/UIKitSPI.h: Add some SPI. * UIProcess/ios/WKPDFView.h: * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _didLoadPDFDocument]): (-[WKPDFView web_setContentProviderData:suggestedFilename:]): Move creation of the UIPDFDocument (only possible if the CGPDFDocument is unlocked) and initial setup of the page views out into _didLoadPDFDocument. If the CGPDFDocument is locked, we'll show some UI to unlock it; otherwise we'll continue on to _didLoadPDFDocument as previously. (-[WKPDFView web_setMinimumSize:]): Resize the password UI instead of the PDF pages if we have it. (-[WKPDFView _computePageAndDocumentFrames]): Don't bother doing any work revalidating PDF pages if the document is locked. (-[WKPDFView _updatePasswordEntryField]): Make sure that the UIDocumentPassword view is always the size of the scrollview. This takes care of rotation. (-[WKPDFView _keyboardDidShow:]): Make sure that we scroll the password field around, if necessary, to keep it on screen when editing begins. (-[WKPDFView _showPasswordEntryField]): (-[WKPDFView _hidePasswordEntryField]): Adjust the background color (to match the UIDocumentPasswordView) and disable zooming while it's up. The UIDocumentPassword view is installed into the scroll view to match UIWebView behavior. (-[WKPDFView userDidEnterPassword:forPasswordView:]): (-[WKPDFView didBeginEditingPassword:inView:]): (-[WKPDFView didEndEditingPassword:inView:]): (-[WKPDFView _didFailToUnlock]): Pop up a dialog informing the user that they entered the wrong password. (-[WKPDFView _tryToUnlockWithPassword:]): Try to unlock the document. If it succeeds, hide the unlock UI and go back to _didLoadPDFDocument. 2015-04-24 Commit Queue Unreviewed, rolling out r183266. https://bugs.webkit.org/show_bug.cgi?id=144164 Broke 32-bit build and a test. (Requested by ap on #webkit). Reverted changeset: "AX: richer text change notifications (142719)" https://bugs.webkit.org/show_bug.cgi?id=142719 http://trac.webkit.org/changeset/183266 2015-04-24 Brent Fulgham REGRESSION: WebKit2.ActionMenusTest API test fails https://bugs.webkit.org/show_bug.cgi?id=144149 Reviewed by Tim Horton. Tested by TestWebKitAPI The 'lookupTextAtLocation' method was not converting the NSEvent coordinates it was receiving from root view to the plugin view. Consequently, full page PDFs did hit testing correctly, but an PDF would not. Since 'existingSelectionContainsPoint' is exposed as API, I also modified it to expect 'root view' coordinates and perform the requisite conversions, rather than expecting 'plugin view' coordinates. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::existingSelectionContainsPoint): Expect 'root view' coordinates for the input. (WebKit::PDFPlugin::lookupTextAtLocation): Properly convert the passed 'root view' coordinates to the PDF's view coordinate space. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): Pass hit point using view coordinates, not content coordinates. 2015-04-24 Anders Carlsson Address a review comment from Joe Pecoraro. * UIProcess/API/Cocoa/WKWebsiteDataStore.h: 2015-04-24 Anders Carlsson Rename -[WKWebsiteDataStore isNonPersistent] to -[WKWebsiteDataStore isPersistent] https://bugs.webkit.org/show_bug.cgi?id=144158 Reviewed by Beth Dakin. * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::isPersistent): (API::WebsiteDataStore::isNonPersistent): Deleted. * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore isPersistent]): (-[WKWebsiteDataStore isNonPersistent]): Deleted. * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: (-[_WKWebsiteDataStore isNonPersistent]): * UIProcess/WebsiteData/WebsiteDataStore.h: 2015-04-24 Brent Fulgham Immediate action not functional for embedded PDFs https://bugs.webkit.org/show_bug.cgi?id=143952 Reviewed by Tim Horton. Add a new method to retrieve appropriate dictionary lookup content and update the hit test result with relevant dictionary content and the bounding rect of the selection. * WebProcess/Plugins/Netscape/NetscapePlugin.h: Add stub. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: Initialize plugin type. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::rectInWindowSpaceForRectInLayoutSpace): New helper function to convert PDF 'in page' units to the equivalent view units. (WebKit::PDFPlugin::PDFPlugin): Initialize plugin type. (WebKit::PDFPlugin::viewRectForSelection): Query a provided PDFSelection for its bounding rect and return the result in view units. * WebProcess/Plugins/Plugin.h: * WebProcess/Plugins/PluginProxy.cpp: Initialize plugin type. * WebProcess/Plugins/PluginProxy.h: Add stub. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::viewRectForSelection): Added. * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Added. (WebKit::textIndicatorTransitionForActionMenu): Added helper function. (WebKit::WebPage::performActionMenuHitTestAtLocation): Update the hit test information with relevant dictionary lookup content, and mark the result as a text node (if appropriate). 2015-04-24 Jer Noble [WK2] Only issue a isPlayingAudioDidChange() notification if the audio playing state actually changed. https://bugs.webkit.org/show_bug.cgi?id=144153 Reviewed by Alexey Proskuryakov. Check the old state vs. the new state and only issue the change notification if the IsPlayingAudio state changed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): 2015-04-24 Antti Koivisto CrashTracer: [USER] com.apple.WebKit.Networking at com.apple.WebKit: WebKit::NetworkResourceLoader::~NetworkResourceLoader + 14 https://bugs.webkit.org/show_bug.cgi?id=144147 Reviewed by Chris Dumez. Storage::storeBodyAsBlob copies the std::function callback for handling mapped bodies in a thread. This is thread safe only if the function copy is thread safe. It is currently not as we are capturing RefPtr and NetworkResourceLoader doesn't use thread safe refcounting. Fix by avoiding copying of the callback. Use same apporach for WriteOperation as we already use for ReadOperation: count the active operations in progress and delete WriteOperation when everything is finished. This way we don't need to copy the function out from WriteOperation. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation): (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation): Move definition here from the header. (WebKit::NetworkCache::Storage::~Storage): (WebKit::NetworkCache::Storage::storeBodyAsBlob): Increment the operation count when storing a blob, call finishWriteOperation when done. (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::Storage::finishReadOperation): Count active operations instead of finished operations. This makes the code clearer. (WebKit::NetworkCache::Storage::dispatchWriteOperation): (WebKit::NetworkCache::Storage::finishWriteOperation): Mirror the way ReadOperations work. * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation): Deleted. 2015-04-24 Timothy Hatcher REGRESSION: Web Inspector: Start Timeline Recording in Develop menu broken https://bugs.webkit.org/show_bug.cgi?id=144150 Reviewed by Brian Burg. * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::evaluateCommandOnLoad): Properly treat bools as literals instead of strings by not using the string version of evaluateCommandOnLoad. 2015-04-23 Anders Carlsson Add headerdocs for WKWebsiteDataRecord and WKWebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=144138 Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]): (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]): 2015-04-24 Doug Russell AX: richer text change notifications (142719) https://bugs.webkit.org/show_bug.cgi?id=142719 Reviewed by Darin Adler. Richer accessibility value change notifications. Introduce AXTextEditType, postTextStateChangeNotification and postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content. Also implement a mechanism to post value changes in password form fields in coalesced ticks to thwart analyzing the cadence of changes. Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent, and an overload of postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content selection. Also block posting selection changes on password fields. * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::nameForEditAction): 2015-04-24 Darin Adler Convert OwnPtr and PassOwnPtr uses to std::unique_ptr https://bugs.webkit.org/show_bug.cgi?id=128007 Reviewed by Anders Carlsson. * NetworkProcess/cache/NetworkCacheEncoder.h: Added an include now needed that was inherited from OwnPtr.h before. 2015-04-24 Antti Koivisto Network Cache: Make path functions members https://bugs.webkit.org/show_bug.cgi?id=144146 Reviewed by Carlos Garcia Campos. This simplifies the code. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::partitionPathForKey): (WebKit::NetworkCache::Storage::recordPathForKey): (WebKit::NetworkCache::Storage::bodyPathForKey): (WebKit::NetworkCache::Storage::storeBodyAsBlob): (WebKit::NetworkCache::Storage::remove): (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::Storage::finishReadOperation): (WebKit::NetworkCache::Storage::dispatchWriteOperation): (WebKit::NetworkCache::partitionPathForKey): Deleted. (WebKit::NetworkCache::recordPathForKey): Deleted. (WebKit::NetworkCache::bodyPathForKey): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: 2015-04-24 Carlos Garcia Campos Unreviewed. Remove incorrect assert after r183189. In this case the assert was already there, but it's incorrect because we are handling uninitialized attachments below in the same function, and also when sending messages. So, if it's ok to send uninitialized attachments, it's ok to receive them. This didn't fail before r183189, because we were only invaliding the attachments by setting the file descriptor to -1, and they were handled as null attachments. After r183189, the move operator resets the moved attachment leaving it uninitialized again. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::processMessage): 2015-04-24 Carlos Garcia Campos [SOUP] Use a webkit subdirectory for the disk cache https://bugs.webkit.org/show_bug.cgi?id=144048 Reviewed by Martin Robinson. Recent versions of libsoup remove any file in cache dir not referenced by the index when the cache is loaded to workaround leaked resources when load/dump is unbalanced for whatever reason, like a crash. We currently use $XDG_CACHE_HOME/app-name as default disk cache directory, but that directory could be used by apps to cache other things, and the soup cache might end up deleting other stuff. The soup cache assumes the given directory is only for the disk cache, so we should ensure that. * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): Append webkit to the given disk cache and clear the previous soup cache if it exists. * WebProcess/soup/WebProcessSoup.cpp: (WebKit::WebProcess::platformInitializeWebProcess): Ditto. 2015-04-24 Carlos Garcia Campos Unreviewed. Remove incorrect ASSERT added in r183176. We allow to encode null attachments. * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::Handle::releaseAttachment): 2015-04-23 Dan Bernstein Framework header postprocessing isn’t removing WK_DEPRECATED macros when it should. Reviewed by Andy Estes. * mac/postprocess-framework-headers.sh: 2015-04-23 Simon Fraser Make it possible to detach GraphicsLayerCA backing store https://bugs.webkit.org/show_bug.cgi?id=144140 Reviewed by Tim Horton. This changes makes it possible to denote a GraphicsLayerCA's backing store as "attached" or not. When not attached, the backing store is made volatile and can be purged. This will be used in a future patch. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore): Whitespace. (WebKit::RemoteLayerBackingStore::display): If backingStoreWillBeDisplayed() returns true, this indicates that the backing store was brought out of the "unreachable" list, so return true even if the backing store doesn't require painting. * Shared/mac/RemoteLayerBackingStoreCollection.h: C++11 initializer, and comments. * Shared/mac/RemoteLayerBackingStoreCollection.mm: (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection): (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDisplayed): Return true if the caller will need to submit the backing store in the current transaction. (WebKit::RemoteLayerBackingStoreCollection::backingStoreBecameUnreachable): This explicit dirtying is no longer necessary given the backingStoreWillBeDisplayed() change. * Shared/mac/RemoteLayerTreePropertyApplier.mm: (WebKit::applyPropertiesToLayer): Only set the layer's backing if we both have backing store, and it's attached. * Shared/mac/RemoteLayerTreeTransaction.h: New bit, and data member. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): (WebKit::dumpChangedLayers): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): Only call display() on the backing store if it's attached. (WebKit::PlatformCALayerRemote::setBackingStoreAttached): (WebKit::PlatformCALayerRemote::backingStoreAttached): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed): 2015-04-23 Tim Horton Quick Look preview popover is not dismissed on scroll in Mail https://bugs.webkit.org/show_bug.cgi?id=144119 Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: (-[WKView renewGState]): If we have a TextIndicator, dismiss all content relative child windows on renewGState, not just the TextIndicator itself. This will fix cases like Mail, where WebKit isn't driving the scrolling, and we have no way (except renewGState) to know that scrolling is happening. 2015-04-23 Simon Fraser Changing TiledBacking velocity should schedule a tile revalidation https://bugs.webkit.org/show_bug.cgi?id=144123 Reviewed by Tim Horton. Drive-by fix: use the FrameView& that we have already. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2015-04-23 Jer Noble [Mac] Disable QTKit by default on future OS X. https://bugs.webkit.org/show_bug.cgi?id=144082 Reviewed by Darin Adler. QTKitEnabled defaults to false. * Shared/WebPreferencesDefinitions.h: 2015-04-23 Jer Noble [WK2][Mac] Tweak the timing curve of the WebKit Fullscreen animation https://bugs.webkit.org/show_bug.cgi?id=144120 Reviewed by Eric Carlson. Tweak the curve to ease-in faster when the fullscreen animation duration is short. * UIProcess/mac/WKFullScreenWindowController.mm: (timingFunctionForDuration): (zoomAnimation): (maskAnimation): (fadeAnimation): 2015-04-23 Enrica Casucci iOS build fix after r183208. Unreviewed. * UIProcess/ios/WKContentViewInteraction.mm: 2015-04-22 Alexey Proskuryakov [iOS] WebKit services should inherit environment variables for home https://bugs.webkit.org/show_bug.cgi?id=144078 rdar://problem/20571678 Reviewed by Dan Bernstein. Pass current environment variables as XPC bootstrap. Also while at it, made _CFBundleSetupXPCBootstrap not soft linked. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (main): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): 2015-04-23 Enrica Casucci Support share button. https://bugs.webkit.org/show_bug.cgi?id=144077 rdar://problem/19772892 Reviewed by Darin Adler. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _share:]): (-[WKContentView canPerformAction:withSender:]): (-[WKContentView _define:]): (-[WKContentView accessibilityRetrieveSpeakSelectionContent]): (-[WKContentView moveByOffset:]): (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]): (-[WKContentView accessoryTab:]): (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKContentView executeEditCommandWithCallback:]): 2015-04-23 Carlos Garcia Campos [UNIX] Do not allow copies of IPC::Attachment https://bugs.webkit.org/show_bug.cgi?id=144096 Reviewed by Darin Adler. It ensures that the file descriptor ownership is always correctly transferred. This way we can remove the dispose() method to explicitly close the file descriptor and always close it in the Attachment destructor (unless explicitly transferred to IPC::Connection or SharedMemory). It simplifies the code and ensure we don't leak file descriptors. * Platform/IPC/ArgumentDecoder.cpp: (IPC::ArgumentDecoder::~ArgumentDecoder): Remove the code to explicitly dispose attachments. (IPC::ArgumentDecoder::removeAttachment): Use WTF::move(). * Platform/IPC/ArgumentEncoder.cpp: (IPC::ArgumentEncoder::~ArgumentEncoder): Remove the code to explicitly dispose attachments. (IPC::ArgumentEncoder::addAttachment): Use WTF::move(). (IPC::ArgumentEncoder::releaseAttachments): Simplify by using WTF::move(). * Platform/IPC/ArgumentEncoder.h: * Platform/IPC/Attachment.cpp: (IPC::Attachment::encode): Move a copy of the attachment, and reset the file descriptor, since the ownership is passed to the encoder. * Platform/IPC/Attachment.h: Make copy constructor and assignment private to not allow public copies. The only copy allowed is done by Attachment::encode(). Make m_fileDescriptor mutable so that we can reset it in Attachment::encode() after passing the ownership to the encoder. * Platform/IPC/unix/AttachmentUnix.cpp: (IPC::Attachment::~Attachment): Close the file descriptor if it hasn't been released explicitly. (IPC::Attachment::dispose): Deleted. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::processMessage): Do not use AttachmentResourceGuard. (IPC::Connection::sendOutgoingMessage): Ditto. (IPC::AttachmentResourceGuard::AttachmentResourceGuard): Deleted. (IPC::AttachmentResourceGuard::~AttachmentResourceGuard): Deleted. * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::Handle::~Handle): Do not call clear(). (WebKit::SharedMemory::Handle::clear): Reset the attachment. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::createInspectorPage): Use WTF::move(). * WebProcess/Plugins/PluginProcessConnectionManager.cpp: (WebKit::PluginProcessConnectionManager::getPluginProcessConnection): Call releaseFileDescriptor() instead of fileDescritpro() since the ownership is passed to the connection. 2015-04-23 Alexey Proskuryakov Build fix. * WebProcess/cocoa/WebProcessCocoa.mm: Correct the case of an include file name. 2015-04-23 Carlos Garcia Campos Unreviewed. Fix debug build after r183176. * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::Handle::decode): (WebKit::SharedMemory::createHandle): 2015-04-23 Andreas Kling There should only be one way to get the system memory size. Reviewed by Antti Koivisto. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformSetCacheModel): (WebKit::memorySize): Deleted. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformSetCacheModel): (WebKit::memorySize): Deleted. 2015-04-23 Chris Dumez [WK2] WebDiagnosticLoggingClient is leaking https://bugs.webkit.org/show_bug.cgi?id=144089 Reviewed by Darin Adler. WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage constructor but there is no code destroying it. This patch adds a new xxxDestroyed() virtual function to DiagnosticLoggingClient and that is overriden in WebDiagnosticLoggingClient to call "delete this". This is the same pattern as for other WK2 clients (e.g. WebFrameLoaderClient, WebProgressTrackerClient). * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp: (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed): * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h: 2015-04-23 Carlos Garcia Campos [UNIX] Simplify the file descriptor handling in SharedMemory https://bugs.webkit.org/show_bug.cgi?id=144046 Reviewed by Darin Adler. Simplify the file descriptor handling and clarify its ownership by using IPC::Attachment in SharedMemory::Handle instead of fd and size members. SharedMemory::Handle::adoptFromAttachment() has been renamed as SharedMemory::Handle::adoptAttachment() and receives an IPC::Attachment. And SharedMemory::Handle::releaseToAttachment() has been renamed as SharedMemory::Handle::releaseAttachment(). * Platform/IPC/Attachment.h: Add move constructor and move assigned operator. * Platform/IPC/Connection.h: (IPC::Connection::identifierIsNull): A file descriptor is null when it's -1 no 0. * Platform/IPC/unix/AttachmentUnix.cpp: (IPC::Attachment::Attachment): (IPC::Attachment::operator=): (IPC::Attachment::dispose): Reset the file descriptor after closing it. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::processMessage): Use SharedMemory::Handle::adoptAttachment() that receives an IPC::Attachment now. (IPC::Connection::sendOutgoingMessage): Use SharedMemory::Handle::releaseAttachment(). * Platform/SharedMemory.h: * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::Handle::Handle): Remove initializers for file descriptor and size members. (WebKit::SharedMemory::Handle::clear): Dispose the attachment. (WebKit::SharedMemory::Handle::isNull): Handle is null if the attachment file descriptor is -1. (WebKit::SharedMemory::Handle::encode): Use releaseAttachment(). (WebKit::SharedMemory::Handle::decode): Use adoptAttachment(). (WebKit::SharedMemory::Handle::releaseAttachment): Implement it using move. (WebKit::SharedMemory::Handle::adoptAttachment): Ditto. (WebKit::SharedMemory::map): Use IPC::Attachment::releaseFileDescriptor() instead of manually changing the member. (WebKit::SharedMemory::createHandle): Initialize the handle attachment with the duplicated file descriptor and size. 2015-04-22 Darin Adler Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2 https://bugs.webkit.org/show_bug.cgi?id=143943 Reviewed by Anders Carlsson. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: Removed unneeded include. 2015-04-22 Brent Fulgham VisibleSelection should only accept Range by reference https://bugs.webkit.org/show_bug.cgi?id=144047 Reviewed by Tim Horton. Update all uses of VisibleSelection to pass a Range reference instead of a Range pointer. * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::getImageForFindMatch): (WebKit::FindController::selectFindMatch): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertTextAsync): (WebKit::WebPage::setCompositionAsync): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::insertDictatedTextAsync): 2015-04-22 Anders Carlsson Add WK_ARRAY and WK_SET annotations https://bugs.webkit.org/show_bug.cgi?id=144075 rdar://problem/19417770 Reviewed by Dan Bernstein. * Shared/API/Cocoa/WKFoundation.h: * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * mac/postprocess-framework-headers.sh: 2015-04-22 Brent Fulgham Unreviewed build fix after r183136. * WebProcess/WebPage/mac/WebPageMac.mm: Correct capitalization of 'HTMLPluginImageElement.h' -> 'HTMLPlugInImageElement.h' 2015-04-21 Brent Fulgham Extend action menus to support PDF https://bugs.webkit.org/show_bug.cgi?id=143895 Reviewed by Tim Horton. If the mouse pointer is over a PDF, try to provide a relevant action menu for whatever content is under the mouse. For now, we only support copying text and handling URLs. If no text is selected, use the dictionary lookup service to find a semantically appropriate selection underneath the mouse. This is consistent with how normal text is treated in pure HTML views. If some text is already selected, and the mouse is over the existing selection, continue using the selected text. Otherwise, discard the old selection and select the most appropriate region under the mouse pointer. * Shared/API/c/WKActionMenuTypes.h: Add PDF menu option. * Shared/WebMouseEvent.cpp: Recognize mouse force events as valid mouse events. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForPDF]): Add simply copy text option. (-[WKActionMenuController _defaultMenuItems]): Recognize PDFs and add relevant action menu entries. * WebProcess/Plugins/Netscape/NetscapePlugin.h: Provide stub for new method. * WebProcess/Plugins/PDF/PDFLayerControllerDetails.h: Expose 'rectsForSelectionInLayerSpace', 'rectsForAnnotationInLayoutSpace', 'layout', and 'currentPage'. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::getSelectionForWordAtPoint): Added. (WebKit::PDFPlugin::existingSelectionContainsPoint): Added. (WebKit::PDFPlugin::lookupTextAtLocation): Added. * WebProcess/Plugins/Plugin.h: Add declaration for new 'getSelectionForWordAtPoint' method. * WebProcess/Plugins/PluginProxy.h: Provide stub for new method. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::getSelectionForWordAtPoint): Added. (WebKit::PluginView::existingSelectionContainsPoint): Added. (WebKit::PluginView::lookupTextAtLocation): Added. * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): Update to support PDF documents and retrieve relevant content to support later action menu handling. 2015-04-22 Eric Carlson Update AirPlay sandbox rules https://bugs.webkit.org/show_bug.cgi?id=144062 Reviewed by Alexey Proskuryakov. * WebProcess/com.apple.WebProcess.sb.in: Remove obsolete rules. 2015-04-22 Alexey Proskuryakov [Mac] In nightlies and local builds, WebKit services can get terminated under memory pressure https://bugs.webkit.org/show_bug.cgi?id=144052 rdar://problem/19754404 Reviewed by Darin Adler. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm: (main): Make XPC transaction tracking work again after a re-exec. 2015-04-22 Zan Dobersek [WK2] Have API::Array creation methods return Ref<> https://bugs.webkit.org/show_bug.cgi?id=143933 Reviewed by Darin Adler. API::Array::create() and API::Array::createStringArray() should return Ref<> objects as the return values are never null. It's up to the caller to implicitly convert the returned objects to RefPtr<> if so required. All the call-sites have been updated to reflect that. * Shared/API/APIArray.cpp: (API::Array::create): (API::Array::createStringArray): (API::Array::copy): * Shared/API/APIArray.h: * Shared/API/APIDictionary.cpp: (API::Dictionary::keys): * Shared/API/APIDictionary.h: * Shared/API/Cocoa/WKRemoteObjectCoder.mm: (ensureObjectStream): * Shared/API/c/WKArray.cpp: (WKArrayCreate): (WKArrayCreateAdoptingValues): * Shared/API/c/WKContextMenuItem.cpp: (WKContextMenuCopySubmenuItems): * Shared/API/c/WKDictionary.cpp: (WKDictionaryCopyKeys): * Shared/API/c/WKMutableArray.cpp: (WKMutableArrayCreate): * Shared/Cocoa/WKNSDictionary.mm: (-[WKNSDictionary keyEnumerator]): * Shared/SecurityOriginData.cpp: (WebKit::performAPICallbackWithSecurityOriginDataVector): * Shared/WebContextMenuItem.cpp: (WebKit::WebContextMenuItem::submenuItemsAsAPIArray): * Shared/WebContextMenuItem.h: * Shared/WebOpenPanelParameters.cpp: (WebKit::WebOpenPanelParameters::acceptMIMETypes): (WebKit::WebOpenPanelParameters::selectedFileNames): * Shared/WebOpenPanelParameters.h: * UIProcess/API/C/WKBackForwardListRef.cpp: (WKBackForwardListCopyBackListWithLimit): (WKBackForwardListCopyForwardListWithLimit): * UIProcess/API/C/WKGrammarDetail.cpp: (WKGrammarDetailCopyGuesses): * UIProcess/API/C/WKOpenPanelParameters.cpp: (WKOpenPanelParametersCopyAcceptedMIMETypes): (WKOpenPanelParametersCopySelectedFileNames): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageContextMenuClient): (WKPageCopyRelatedPages): * UIProcess/API/Cocoa/WKBackForwardList.mm: (-[WKBackForwardList backList]): (-[WKBackForwardList forwardList]): * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm: (createWKArray): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]): * UIProcess/API/gtk/WebKitBackForwardList.cpp: (webkit_back_forward_list_get_back_list_with_limit): (webkit_back_forward_list_get_forward_list_with_limit): * UIProcess/API/gtk/WebKitFileChooserRequest.cpp: (webkit_file_chooser_request_get_mime_types): (webkit_file_chooser_request_get_mime_types_filter): (webkit_file_chooser_request_select_files): * UIProcess/API/gtk/WebKitNotificationProvider.cpp: (WebKitNotificationProvider::notificationCloseCallback): * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::populateCopyOfNotificationPermissions): * UIProcess/Notifications/WebNotificationProvider.cpp: (WebKit::WebNotificationProvider::clearNotifications): * UIProcess/Plugins/WebPluginSiteDataManager.cpp: (WebKit::WebPluginSiteDataManager::didGetSitesWithData): * UIProcess/StatisticsRequest.cpp: (WebKit::StatisticsRequest::completedRequest): * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::backList): (WebKit::WebBackForwardList::forwardList): (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit): (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit): * UIProcess/WebBackForwardList.h: * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies): * UIProcess/WebDatabaseManagerProxy.cpp: (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin): (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins): * UIProcess/WebGrammarDetail.cpp: (WebKit::WebGrammarDetail::guesses): * UIProcess/WebGrammarDetail.h: * UIProcess/WebKeyValueStorageManager.cpp: (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins): (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin): * UIProcess/WebMediaCacheManagerProxy.cpp: (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache): * UIProcess/WebOriginDataManagerProxy.cpp: (WebKit::WebOriginDataManagerProxy::didGetOrigins): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFindStringMatches): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pluginInfoStoreDidLoadPlugins): * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): (-[WKFileUploadPanel presentWithParameters:resultListener:]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame childFrames]): * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp: (WKBundleBackForwardListItemCopyChildren): * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleFrameCopyChildFrames): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageCopyTrackedRepaintRects): * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp: (WebKit::InjectedBundleBackForwardListItem::children): * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h: * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp: (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems): * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp: (WebKit::InjectedBundlePageFormClient::didAssociateFormControls): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::findLargestFrameInFrameSet): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::childFrames): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::trackedRepaintRects): * WebProcess/WebPage/WebPage.h: 2015-04-21 Eric Carlson [Mac] Use one playback target for all web processes https://bugs.webkit.org/show_bug.cgi?id=144009 Reviewed by Tim Horton. Every WebPageProxy uses the WebMediaSessionManager singleton to talk to the playback target picker. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::isPlayingMediaDidChange): (WebKit::WebPageProxy::addPlaybackTargetPickerClient): (WebKit::WebPageProxy::removePlaybackTargetPickerClient): (WebKit::WebPageProxy::showPlaybackTargetPicker): (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange): (WebKit::WebPageProxy::setPlaybackTarget): (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange): (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget): (WebKit::WebPageProxy::devicePickerProxy): Deleted. (WebKit::WebPageProxy::startingMonitoringPlaybackTargets): Deleted. (WebKit::WebPageProxy::stopMonitoringPlaybackTargets): Deleted. (WebKit::WebPageProxy::didChoosePlaybackTarget): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isPlayingAudio): * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::mediaSessionManager): (WebKit::PageClientImpl::createPlaybackTargetPicker): Deleted. * UIProcess/mac/WebMediaSessionManagerMac.cpp: Added. (WebKit::WebMediaSessionManagerMac::singleton): (WebKit::WebMediaSessionManagerMac::WebMediaSessionManagerMac): (WebKit::WebMediaSessionManagerMac::~WebMediaSessionManagerMac): (WebKit::WebMediaSessionManagerMac::targetPicker): * UIProcess/mac/WebMediaSessionManagerMac.h: Added. * WebProcess/Plugins/PluginView.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::isPlayingMediaDidChange): (WebKit::WebChromeClient::addPlaybackTargetPickerClient): (WebKit::WebChromeClient::removePlaybackTargetPickerClient): (WebKit::WebChromeClient::showPlaybackTargetPicker): (WebKit::WebChromeClient::playbackTargetPickerClientStateDidChange): (WebKit::WebChromeClient::startingMonitoringPlaybackTargets): Deleted. (WebKit::WebChromeClient::stopMonitoringPlaybackTargets): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::playbackTargetSelected): (WebKit::WebPage::playbackTargetAvailabilityDidChange): (WebKit::WebPage::setShouldPlayToPlaybackTarget): 2015-04-21 Anders Carlsson WKWebsiteDataStore doesn't track and remove IndexedDB databases https://bugs.webkit.org/show_bug.cgi?id=144032 rdar://problem/20242856 Reviewed by Tim Horton. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * Shared/WebsiteData/WebsiteDataTypes.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::generateCallbackID): (WebKit::DatabaseProcessProxy::~DatabaseProcessProxy): (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): (WebKit::DatabaseProcessProxy::didClose): (WebKit::DatabaseProcessProxy::didFetchWebsiteData): (WebKit::DatabaseProcessProxy::didDeleteWebsiteData): (WebKit::DatabaseProcessProxy::didDeleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Databases/DatabaseProcessProxy.messages.in: * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): (WebKit::WebsiteDataStore::removeData): 2015-04-21 Anders Carlsson Add module maps for WebKit https://bugs.webkit.org/show_bug.cgi?id=144026 rdar://problem/19665428 Reviewed by Dan Bernstein. * Configurations/WebKit.xcconfig: * Modules/OSX.modulemap: Added. * Modules/iOS.modulemap: Added. 2015-04-21 Tim Horton Long pause under _takeViewSnapshot when screen updates are disabled https://bugs.webkit.org/show_bug.cgi?id=144017 Reviewed by Simon Fraser. * UIProcess/API/mac/WKView.mm: (-[WKView _takeViewSnapshot]): Use CGSHWCaptureWindowList, for snapshotting that doesn't block on the next commit, and can succeed while screen updates are disabled without blocking. 2015-04-21 Chris Dumez [WK2][NetworkCache] Better account of resource revalidations in efficacy logging https://bugs.webkit.org/show_bug.cgi?id=144014 Reviewed by Antti Koivisto. Better account of resource revalidations in efficacy logging. Prevously, resources that were in the cache but needed revalidation were counted as retrieval successes, which is not entirely accurate. We now distinguish "is in the cache and is directly usable" from "is in the cache but needs revalidation". We also log how many of these revalidations are successful. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponseAsync): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::update): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry): (WebKit::NetworkCache::Statistics::recordRevalidationSuccess): * NetworkProcess/cache/NetworkCacheStatistics.h: 2015-04-21 Dan Bernstein [Cocoa] Framework header postprocessing should respect additional definitions https://bugs.webkit.org/show_bug.cgi?id=144018 Reviewed by Anders Carlsson. * mac/postprocess-framework-headers.sh: Read definitons from /usr/local/include/WebKitAdditions/Scripts/postprocess-framework-headers-definitions, and have them take precedence over OSX_VERSION and IOS_VERSION and supply additional options to sed. 2015-04-21 Anders Carlsson Fix block signatures https://bugs.webkit.org/show_bug.cgi?id=144002 Reviewed by Andreas Kling. * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]): * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]): (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]): * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]): (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]): (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]): 2015-04-21 Timothy Horton PDFs still don't snapshot properly in iOS Safari https://bugs.webkit.org/show_bug.cgi?id=143976 Reviewed by Anders Carlsson. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didLayoutForCustomContentProvider): * UIProcess/WebPageProxy.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]): Inform the client that we've passed all reasonable layout milestones as soon as the custom content provider has been handed its data. WKPDFView, the only custom content provider, synchronously lays out its subviews upon initial receipt of data, so this works fine for it. This ensures that clients that normally depend on layout milestones firing won't break when a custom content view is installed. (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Fall back to renderInContext: if the custom content view is not parented when a snapshot is requested. 2015-04-21 Dan Bernstein Merged WKBackForwardListItem’s Internal category into the class extension in WKBackForwardListItemInternal.h. Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKBackForwardListItem.mm: (-[WKBackForwardListItem _item]): (-[WKBackForwardListItem _apiObject]): * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h: 2015-04-21 Chris Dumez Make Vector(const Vector&) constructor explicit https://bugs.webkit.org/show_bug.cgi?id=143970 Reviewed by Darin Adler. Make Vector(const Vector&) constructor explicit as it copies the vector and it is easy to call it by mistake. * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: (WebKit::WebIDBServerConnection::setIndexKeys): * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: 2015-04-20 Dan Bernstein Expose more bundle form client functions as WKWebProcessPlugInFormDelegatePrivate methods https://bugs.webkit.org/show_bug.cgi?id=143973 Reviewed by Anders Carlsson. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared new delegate methods. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Declared new frame property. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (-[WKWebProcessPlugInNodeHandle frame]): Added. Returns the node’s document’s frame. This is useful to delegates getting an array of nodes via the new method. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added overrides of shouldNotifyOnFormChanges and didAssociateFormControls, which call the new delegate methods. 2015-04-20 Joseph Pecoraro Cleanup some StringBuilder use https://bugs.webkit.org/show_bug.cgi?id=143550 Reviewed by Darin Adler. * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp: (WebKit::buildObjectStoreStatement): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::v2RecordsTableSchema): * Shared/Databases/IndexedDB/IDBUtilities.cpp: (WebKit::uniqueDatabaseIdentifier): * UIProcess/API/APIUserScript.cpp: (API::UserScript::generateUniqueURL): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::didReceiveInvalidMessage): * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp: (WebKit::combinedSecurityOriginIdentifier): 2015-04-20 Anders Carlsson Modify the WKWebsiteDataStore API to take a NSSet of types instead of a bitmask https://bugs.webkit.org/show_bug.cgi?id=143966 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): (-[WKWebsiteDataRecord dataTypes]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore allWebsiteDataTypes]): (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]): (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]): * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: (toWKWebsiteDataTypes): (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]): (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]): (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): 2015-04-20 Beth Dakin Should remove mouseForceClick and mouseForceCancelled from DOM force events https://bugs.webkit.org/show_bug.cgi?id=143904 -and corresponding- rdar://problem/20578842 Reviewed by Dan Bernstein. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::immediateActionDidCancel): 2015-04-20 Tim Horton Implement immediate action support for tel: and mailto: URLs https://bugs.webkit.org/show_bug.cgi?id=143916 Reviewed by Darin Adler. * Shared/API/c/WKImmediateActionTypes.h: * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController _defaultAnimationController]): (-[WKImmediateActionController _animationControllerForDataDetectedText]): (-[WKImmediateActionController _animationControllerForDataDetectedLink]): (-[WKImmediateActionController _menuItemForDataDetectedText]): Deleted. Add _animationControllerForDataDetectedLink and use it when building immediate actions for tel: and mailto: links. 2015-04-20 Alex Christensen Properly report errors from _WKUserContentExtensionStore. https://bugs.webkit.org/show_bug.cgi?id=143808 Reviewed by Darin Adler. * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm: (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]): (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): 2015-04-18 Simon Fraser REGRESSION (r181656): Animated tiled layers are missing content https://bugs.webkit.org/show_bug.cgi?id=143911 rdar://problem/20596328 Reviewed by Darin Adler. After r181656, all requestAnimationFrame was falling back to timers, and not using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr fumble. Replace this confusing Optional<> code with simpler code that just forces the clients to make a DisplayRefreshMonitor if they can, first asking ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor(). Make lots of things into references, and use C++11 initialization in some places. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createDisplayRefreshMonitor): * WebProcess/WebCoreSupport/WebChromeClient.h: 2015-04-18 Dan Bernstein SwipeShadow images are installed on iOS https://bugs.webkit.org/show_bug.cgi?id=143915 Reviewed by Tim Horton. * Configurations/WebKit.xcconfig: Added Resources/Mac/* to EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*]. We could move more resources there and remove individual patterns. * Resources/SwipeShadow.png: Moved to mac. * Resources/SwipeShadow@2x.png: Moved to mac. * Resources/mac: Added. * Resources/mac/SwipeShadow.png: Moved from Source/WebKit2/Resources/SwipeShadow.png. * Resources/mac/SwipeShadow@2x.png: Moved from Source/WebKit2/Resources/SwipeShadow@2x.png. * WebKit2.xcodeproj/project.pbxproj: Created mac group in the Resources group and moved SwipeShadow*.png into it. Updated for file moves. 2015-04-18 Chris Dumez Fix NetworkCache Statistics database bootstrapping after r182803 https://bugs.webkit.org/show_bug.cgi?id=143890 Reviewed by Darin Adler. Update the NetworkCache Statistics database bootstrapping code to use the records path instead of the version path. Also check that the filenames in the folder are valid hashes to discard the *-body files. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::recordsPath): (WebKit::NetworkCache::Cache::storagePath): Deleted. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::initialize): (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache): (WebKit::NetworkCache::Statistics::shrinkIfNeeded): 2015-04-17 Tim Horton Clients sometimes block for 500ms in waitForPossibleGeometryUpdates https://bugs.webkit.org/show_bug.cgi?id=143901 Reviewed by Anders Carlsson. * Platform/IPC/Connection.cpp: (IPC::Connection::waitForMessage): InterruptWaitingIfSyncMessageArrives already cancels waitForMessage if a sync message arrives while waiting, but it should also avoid waiting if there's a sync message already in the queue when the waiting starts, as that will have the same nasty effect. * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate): If a synchronous message comes in from the Web process while we're waiting, cancel our synchronous wait for DidUpdateGeometry. This will cause the size change to not synchronize with the Web process' painting, but that is better than pointlessly blocking for 500ms. 2015-04-17 Chris Dumez Possible null pointer dereference in WebDiagnosticLoggingClient::logDiagnosticMessageWithValue() https://bugs.webkit.org/show_bug.cgi?id=143899 Reviewed by Anders Carlsson. WebDiagnosticLoggingClient::logDiagnosticMessage*() methods failed to check that m_page.corePage() was non-null before dereferencing, thus causing crashes when it is null. * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp: (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage): (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult): (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue): 2015-04-17 Yongjun Zhang WebKit client should be able to add view controller for link preview. https://bugs.webkit.org/show_bug.cgi?id=143686 Add delegate methods to WKUIDelegatePrivate so that a WebKit client can prepare a view controller for link preview and react to the dismissal of this view controller. Also connect WKContentView to preview gesture recognizer and forwards the delegate callbacks to corresponding delegate methods in WKUIDelegatePrivate. Reviewed by Beth Dakin. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView willMoveToWindow:]): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView previewViewControllerForPosition:inSourceView:]): (-[WKContentView commitPreviewViewController:]): (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): (-[WKContentView didDismissPreviewViewController:committing:]): 2015-04-17 Beth Dakin Force mouse events should go through normal mouse event handling code paths https://bugs.webkit.org/show_bug.cgi?id=143749 -and corresponding- rdar://problem/20472895 Reviewed by Dean Jackson. This patch makes pressureChangeWithEvent create NativeWebMouseEvents with the NSEventTypePressures that is gets and sends those down to the web process. Re-name pressureEvent to lastPressureEvent. Now that event can sometimes be an NSEventTypePressure, the new name makes it clear how the second parameter differs from the first. * Shared/NativeWebMouseEvent.h: New event types for the new types of events. * Shared/WebEvent.h: * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): * Shared/mac/NativeWebMouseEventMac.mm: (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): * Shared/mac/WebEventFactory.h: All of the square-peg, round-hole problems of massaging the NSEventTypePressures events into WebMouseEvents is taken care of here. * Shared/mac/WebEventFactory.mm: (WebKit::mouseButtonForEvent): (WebKit::globalPointForEvent): (WebKit::pointForEvent): (WebKit::WebEventFactory::createWebMouseEvent): Instead of calling the old inputDeviceForceDidChange, create a NativeWebMouseEvent and handle it. * UIProcess/API/mac/WKView.mm: (-[WKView pressureChangeWithEvent:]): Handle the new types. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): Can delete inputDeviceForceDidChange since it’s no longer used. (WebKit::WebPageProxy::inputDeviceForceDidChange): Deleted. * UIProcess/WebPageProxy.h: Handle the new types of mouse events properly. * WebProcess/WebPage/WebPage.cpp: (WebKit::handleMouseEvent): Delete inputDeviceForceDidChange() and m_lastForceStage. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::inputDeviceForceDidChange): Deleted. Handle new WebEvent types. * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: 2015-04-17 Commit Queue Unreviewed, rolling out r182912 and r182920. https://bugs.webkit.org/show_bug.cgi?id=143881 Build breakage in some configurations (Requested by ap on #webkit). Reverted changesets: "Force mouse events should go through normal mouse event handling code paths" https://bugs.webkit.org/show_bug.cgi?id=143749 http://trac.webkit.org/changeset/182912 http://trac.webkit.org/changeset/182920 2015-04-17 Antti Koivisto Network Cache: Read resource record and body in parallel https://bugs.webkit.org/show_bug.cgi?id=143879 Reviewed by Chris Dumez. We currently first fetch the record file and then fetch the body blob if needed. We can do both operations in parallel to reduce latency. * NetworkProcess/cache/NetworkCacheFileSystemPosix.h: (WebKit::NetworkCache::traverseCacheFiles): Do all validation in the client. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::synchronize): Maintain a bloom filter that contains the body blobs to avoid unnecessary IO attempts. Delete any unknown file in cache directory. (WebKit::NetworkCache::Storage::addToRecordFilter): More informative name for record filter. (WebKit::NetworkCache::Storage::mayContain): (WebKit::NetworkCache::Storage::readRecord): (WebKit::NetworkCache::Storage::storeBodyAsBlob): (WebKit::NetworkCache::Storage::dispatchReadOperation): Start record read IO and body blob read IO in parallel. (WebKit::NetworkCache::Storage::finishReadOperation): The read is finished when we have both the record and the blob. (WebKit::NetworkCache::Storage::dispatchWriteOperation): (WebKit::NetworkCache::Storage::retrieve): (WebKit::NetworkCache::Storage::store): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::Storage::clear): (WebKit::NetworkCache::Storage::shrink): (WebKit::NetworkCache::Storage::addToContentsFilter): Deleted. (WebKit::NetworkCache::Storage::decodeRecord): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation): ReadOperation is now mutable and gathers the read result. 2015-04-16 Anders Carlsson Stop installing WebKit2.framework https://bugs.webkit.org/show_bug.cgi?id=143860 rdar://problem/18298491 Reviewed by Dan Bernstein. * Configurations/WebKit2.xcconfig: Set SKIP_INSTALL=YES for all SDKs except 10.9 where we still need it. 2015-04-17 Carlos Garcia Campos Unreviewed. Fix the build with ENABLE(NETWORK_CACHE) and !ENABLE(SHAREABLE_RESOURCE). * NetworkProcess/cache/NetworkCacheEntry.cpp: * NetworkProcess/cache/NetworkCacheFileSystemPosix.h: (WebKit::NetworkCache::fileTimes): There's no st_birthtime in Linux. 2015-04-17 Carlos Garcia Campos [SOUP] ResourceRequest cache policy is not encoded/decoded in IPC messages https://bugs.webkit.org/show_bug.cgi?id=143867 Reviewed by Sergio Villar Senin. Encode/Decode the ResourceRequest cache policy. * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2015-04-16 Sungmann Cho Use UNUSED_PARAM instead of the void casting to suppress unused parameter warnings. https://bugs.webkit.org/show_bug.cgi?id=143750 Reviewed by Darin Adler. No new tests, no behavior change. * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: (WebKit::NotificationPermissionRequestManager::NotificationPermissionRequestManager): 2015-04-16 Brady Eidson Compiling a content extension fails when user's home directory is on a different volume from /var/tmp. https://bugs.webkit.org/show_bug.cgi?id=143834 Reviewed by Anders Carlsson. * UIProcess/API/APIUserContentExtensionStore.cpp: (API::compiledToFile): Use moveFile() instead of renameFile() 2015-04-16 Anders Carlsson Deprecate _WKWebsiteDataStore in favor of WKWebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=143844 Reviewed by Dan Bernstein. * Shared/API/Cocoa/WKFoundation.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _validate]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: * mac/postprocess-framework-headers.sh: 2015-04-16 Alex Christensen Removed unused WKUserContentFilterRef. https://bugs.webkit.org/show_bug.cgi?id=143852 Reviewed by Sam Weinig. * Shared/WebCompiledContentExtension.cpp: (WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient): Deleted. (WebKit::LegacyContentExtensionCompilationClient::writeBytecode): Deleted. (WebKit::LegacyContentExtensionCompilationClient::writeActions): Deleted. (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData): Deleted. * Shared/WebCompiledContentExtension.h: * UIProcess/API/C/WKUserContentFilterRef.cpp: Removed. * UIProcess/API/C/WKUserContentFilterRef.h: Removed. * UIProcess/API/C/WebKit2_C.h: * UIProcess/API/Cocoa/_WKUserContentFilter.h: * UIProcess/API/Cocoa/_WKUserContentFilter.mm: (-[_WKUserContentFilter initWithName:serializedRules:]): Deleted. * WebKit2.xcodeproj/project.pbxproj: 2015-04-16 Beth Dakin Rubber-stamped by Tim Horton. Fixing a small mistake in http://trac.webkit.org/changeset/182912 which should make sure to use the most up-to-date pressure information when setting the force on a WebMouseEvent. * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebMouseEvent): 2015-04-13 Jer Noble [iOS] When simultaneously exiting-and-entering fullscreen, WebVideoFullscreenManager/Proxy becomes confused about what video element it represents. https://bugs.webkit.org/show_bug.cgi?id=143680 Reviewed by Simon Fraser. The original assumption of WebVideoFullscreenManager and -Proxy was that the two classes would represent a single video element and its full screen state. With multiple animations in and out of fullscreen combined with multiple fullscreen modes, this assumption no longer holds true. Rather than having a WebVideoFullscreenManager which /isa/ WebVideoFullscreenModelVideoElement, the manager now /hasa/ WebVideoFullscreenModelVideoElement (or has many such models). Ditto for WebVideoFullscreenManager and WebVideoFullscreenInterfaceAVKit. The WebVideoFullscreenInterfaceAVKit still needs a WebVideoFullscreenModel to communicate with, so a new wrapper class is used for that purpose, WebVideoFullscreenModelContext. Ditto for WebVideoFullscreenModelVideoElement and the new class WebVideoFullscreenInterfaceContext. These context classes are paired and share a contextId, allowing the manager and its proxy to route messages between the UIProcess's WebVideoFullscreenInterfaceAVKit to-and-from the WebProcess's WebVideoFullscreenModelVideoElement. Both the WebVideoFullscreenModelContext and the WebVideoFullscreenInterfaceContext take a back-pointer to their manager or manager proxy, and each method on the context simply calls the matching method on the manager and passes its contextId as a parameter. Both the WebVideoFullscreenManager and the WebVideoFullscreenManagerProxy pass that contextId in each of their cross-process messages. On the other side, the manager and proxy also have a map between contextIds and their matching WebVideoFullscreenModelVideoElement (in the case of WebVideoFullscreenManager) or WebVideoFullscreenInterfaceAVKit (in the case of WebVideoFullscreenManagerProxy). While this change is large by LoC, it is almost entirely boilerplate. The new and interesting pieces are these: * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy): No longer a WebVideoFullscreenInterfaceAVKit. (WebKit::WebVideoFullscreenManagerProxy::invalidate): Walk through the models and interfaces, invalidating each. (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface): Added. Return a new model and interface tuple. (WebKit::WebVideoFullscreenManagerProxy::ensureModelAndInterface): Added. Lazily create, and add to the m_contextMap a new model and interface object. (WebKit::WebVideoFullscreenManagerProxy::ensureModel): Return the model half of ensureModelAndInterface(). (WebKit::WebVideoFullscreenManagerProxy::ensureInterface): Return the interface half of ensureModelAndInterface(). (WebKit::WebVideoFullscreenManagerProxy::enterFullscreen): Walk through the outstanding interface objects, and if any have a fullscreen mode which matches the about-to-be-fullscreen interface, request that that other interface exit fullscreen. * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::nextContextId): Static, incrementing counter used as a contextId source. (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager): No longer a WebVideoFullscreenModelVideoElement. (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): Walk through the models and interfaces, invalidating each. (WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Added. Return a new model and interface tuple. (WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Added. Lazily create, and add to the m_contextMap a new model and interface object. (WebKit::WebVideoFullscreenManager::ensureModel): Return the model half of ensureModelAndInterface(). (WebKit::WebVideoFullscreenManager::ensureInterface): Return the interface half of ensureModelAndInterface(). New classes and methods which just forward on to their owning objects: * UIProcess/ios/WebVideoFullscreenManagerProxy.h: (WebKit::WebVideoFullscreenModelContext::create): (WebKit::WebVideoFullscreenModelContext::~WebVideoFullscreenModelContext): (WebKit::WebVideoFullscreenModelContext::invalidate): (WebKit::WebVideoFullscreenModelContext::layerHost): (WebKit::WebVideoFullscreenModelContext::setLayerHost): (WebKit::WebVideoFullscreenModelContext::setInitialVideoLayerFrame): (WebKit::WebVideoFullscreenModelContext::WebVideoFullscreenModelContext): * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenModelContext::play): (WebKit::WebVideoFullscreenModelContext::pause): (WebKit::WebVideoFullscreenModelContext::togglePlayState): (WebKit::WebVideoFullscreenModelContext::beginScrubbing): (WebKit::WebVideoFullscreenModelContext::endScrubbing): (WebKit::WebVideoFullscreenModelContext::seekToTime): (WebKit::WebVideoFullscreenModelContext::fastSeek): (WebKit::WebVideoFullscreenModelContext::beginScanningForward): (WebKit::WebVideoFullscreenModelContext::beginScanningBackward): (WebKit::WebVideoFullscreenModelContext::endScanning): (WebKit::WebVideoFullscreenModelContext::requestExitFullscreen): (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame): (WebKit::WebVideoFullscreenModelContext::videoLayerFrame): (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity): (WebKit::WebVideoFullscreenModelContext::videoLayerGravity): (WebKit::WebVideoFullscreenModelContext::selectAudioMediaOption): (WebKit::WebVideoFullscreenModelContext::selectLegibleMediaOption): (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged): (WebKit::WebVideoFullscreenModelContext::didSetupFullscreen): (WebKit::WebVideoFullscreenModelContext::didEnterFullscreen): (WebKit::WebVideoFullscreenModelContext::didExitFullscreen): (WebKit::WebVideoFullscreenModelContext::didCleanupFullscreen): (WebKit::WebVideoFullscreenModelContext::fullscreenMayReturnToInline): * WebProcess/ios/WebVideoFullscreenManager.h: (WebKit::WebVideoFullscreenInterfaceContext::create): (WebKit::WebVideoFullscreenInterfaceContext::invalidate): (WebKit::WebVideoFullscreenInterfaceContext::layerHostingContext): (WebKit::WebVideoFullscreenInterfaceContext::isAnimating): (WebKit::WebVideoFullscreenInterfaceContext::setIsAnimating): (WebKit::WebVideoFullscreenInterfaceContext::targetIsFullscreen): (WebKit::WebVideoFullscreenInterfaceContext::setTargetIsFullscreen): (WebKit::WebVideoFullscreenInterfaceContext::fullscreenMode): (WebKit::WebVideoFullscreenInterfaceContext::setFullscreenMode): (WebKit::WebVideoFullscreenInterfaceContext::isFullscreen): (WebKit::WebVideoFullscreenInterfaceContext::setIsFullscreen): * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext): (WebKit::WebVideoFullscreenInterfaceContext::~WebVideoFullscreenInterfaceContext): (WebKit::WebVideoFullscreenInterfaceContext::setLayerHostingContext): (WebKit::WebVideoFullscreenInterfaceContext::resetMediaState): (WebKit::WebVideoFullscreenInterfaceContext::setDuration): (WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime): (WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime): (WebKit::WebVideoFullscreenInterfaceContext::setRate): (WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions): (WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges): (WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse): (WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions): (WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions): (WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback): Cross-process methods which now take a contextId parameter: * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::WebVideoFullscreenManagerProxy::resetMediaState): (WebKit::WebVideoFullscreenManagerProxy::setCurrentTime): (WebKit::WebVideoFullscreenManagerProxy::setBufferedTime): (WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions): (WebKit::WebVideoFullscreenManagerProxy::setSeekableRangesVector): (WebKit::WebVideoFullscreenManagerProxy::setCanPlayFastReverse): (WebKit::WebVideoFullscreenManagerProxy::setAudioMediaSelectionOptions): (WebKit::WebVideoFullscreenManagerProxy::setLegibleMediaSelectionOptions): (WebKit::WebVideoFullscreenManagerProxy::setExternalPlaybackProperties): (WebKit::WebVideoFullscreenManagerProxy::setDuration): (WebKit::WebVideoFullscreenManagerProxy::setRate): (WebKit::WebVideoFullscreenManagerProxy::exitFullscreen): (WebKit::WebVideoFullscreenManagerProxy::cleanupFullscreen): (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline): (WebKit::WebVideoFullscreenManagerProxy::play): (WebKit::WebVideoFullscreenManagerProxy::pause): (WebKit::WebVideoFullscreenManagerProxy::togglePlayState): (WebKit::WebVideoFullscreenManagerProxy::beginScrubbing): (WebKit::WebVideoFullscreenManagerProxy::endScrubbing): (WebKit::WebVideoFullscreenManagerProxy::seekToTime): (WebKit::WebVideoFullscreenManagerProxy::fastSeek): (WebKit::WebVideoFullscreenManagerProxy::beginScanningForward): (WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward): (WebKit::WebVideoFullscreenManagerProxy::endScanning): (WebKit::WebVideoFullscreenManagerProxy::requestExitFullscreen): (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen): (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): (WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen): (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity): (WebKit::WebVideoFullscreenManagerProxy::selectAudioMediaOption): (WebKit::WebVideoFullscreenManagerProxy::selectLegibleMediaOption): (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged): (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline): (WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Deleted. (WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Deleted. * WebProcess/ios/WebVideoFullscreenManager.messages.in: * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement): (WebKit::WebVideoFullscreenManager::resetMediaState): (WebKit::WebVideoFullscreenManager::setDuration): (WebKit::WebVideoFullscreenManager::setCurrentTime): (WebKit::WebVideoFullscreenManager::setBufferedTime): (WebKit::WebVideoFullscreenManager::setRate): (WebKit::WebVideoFullscreenManager::setVideoDimensions): (WebKit::WebVideoFullscreenManager::setSeekableRanges): (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse): (WebKit::WebVideoFullscreenManager::setAudioMediaSelectionOptions): (WebKit::WebVideoFullscreenManager::setLegibleMediaSelectionOptions): (WebKit::WebVideoFullscreenManager::setExternalPlayback): (WebKit::WebVideoFullscreenManager::play): (WebKit::WebVideoFullscreenManager::pause): (WebKit::WebVideoFullscreenManager::togglePlayState): (WebKit::WebVideoFullscreenManager::beginScrubbing): (WebKit::WebVideoFullscreenManager::endScrubbing): (WebKit::WebVideoFullscreenManager::seekToTime): (WebKit::WebVideoFullscreenManager::fastSeek): (WebKit::WebVideoFullscreenManager::beginScanningForward): (WebKit::WebVideoFullscreenManager::beginScanningBackward): (WebKit::WebVideoFullscreenManager::endScanning): (WebKit::WebVideoFullscreenManager::requestExitFullscreen): (WebKit::WebVideoFullscreenManager::selectAudioMediaOption): (WebKit::WebVideoFullscreenManager::selectLegibleMediaOption): (WebKit::WebVideoFullscreenManager::fullscreenModeChanged): (WebKit::WebVideoFullscreenManager::didSetupFullscreen): (WebKit::WebVideoFullscreenManager::didEnterFullscreen): (WebKit::WebVideoFullscreenManager::didExitFullscreen): (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): (WebKit::WebVideoFullscreenManager::setVideoLayerGravityEnum): (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline): (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): (WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted. 2015-04-16 Beth Dakin Force mouse events should go through normal mouse event handling code paths https://bugs.webkit.org/show_bug.cgi?id=143749 -and corresponding- rdar://problem/20472895 Reviewed by Dean Jackson. This patch makes pressureChangeWithEvent create NativeWebMouseEvents with the NSEventTypePressures that is gets and sends those down to the web process. Re-name pressureEvent to lastPressureEvent. Now that event can sometimes be an NSEventTypePressure, the new name makes it clear how the second parameter differs from the first. * Shared/NativeWebMouseEvent.h: New event types for the new types of events. * Shared/WebEvent.h: * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): * Shared/mac/NativeWebMouseEventMac.mm: (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): * Shared/mac/WebEventFactory.h: All of the square-peg, round-hole problems of massaging the NSEventTypePressures events into WebMouseEvents is taken care of here. * Shared/mac/WebEventFactory.mm: (WebKit::mouseButtonForEvent): (WebKit::globalPointForEvent): (WebKit::pointForEvent): (WebKit::WebEventFactory::createWebMouseEvent): Instead of calling the old inputDeviceForceDidChange, create a NativeWebMouseEvent and handle it. * UIProcess/API/mac/WKView.mm: (-[WKView pressureChangeWithEvent:]): Handle the new types. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): Can delete inputDeviceForceDidChange since it’s no longer used. (WebKit::WebPageProxy::inputDeviceForceDidChange): Deleted. * UIProcess/WebPageProxy.h: Handle the new types of mouse events properly. * WebProcess/WebPage/WebPage.cpp: (WebKit::handleMouseEvent): Delete inputDeviceForceDidChange() and m_lastForceStage. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::inputDeviceForceDidChange): Deleted. Handle new WebEvent types. * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: 2015-04-16 Dan Bernstein Also include a definition of __NSd_{current deployment target} in WKFoundation.h. Reviewed by Tim Horton. * WebKit2.xcodeproj/project.pbxproj: 2015-04-16 Timothy Horton Provide a mechanism through the legacy SPI to know when swipe gestures begin and end https://bugs.webkit.org/show_bug.cgi?id=143740 Reviewed by Dan Bernstein. In the C SPI, add three WKPageLoaderClient callbacks for the three navigation gesture events (did begin, will end, did end). * UIProcess/API/C/WKPageLoaderClient.h: Add the callbacks. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::navigationGestureDidBegin): (API::LoaderClient::navigationGestureWillEnd): (API::LoaderClient::navigationGestureDidEnd): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::navigationGestureDidBegin): (WebKit::WebPageProxy::navigationGestureWillEnd): (WebKit::WebPageProxy::navigationGestureDidEnd): Dispatch navigation gesture events to the loader client as well as (after a bounce through the PageClient) the navigation delegate. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): Call the callbacks. * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::trackSwipeGesture): (WebKit::ViewGestureController::willEndSwipeGesture): While we were already informing WebPageProxy of 'did begin' and 'did end' navigation gesture events, we were missing 'will end'. Add it. 2015-04-16 Tim Horton Dispatching multiple asynchronous animated resizes in parallel causes page scale to detach from reality https://bugs.webkit.org/show_bug.cgi?id=143812 Reviewed by Simon Fraser. * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): No cats in transaction (more of these below, too). * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleTap): (WebKit::WebPage::commitPotentialTap): (WebKit::WebPage::dynamicViewportSizeUpdate): Add an incrementing ID to dynamicViewportSizeUpdates. The UI process keeps the current ID, and it is bounced through the Web process (dynamicViewportSizeUpdates) back to the UI process (dynamicViewportUpdateChangedTarget). If we have dispatched another dynamicViewportSizeUpdate in the interim, ignore the intermediate target. 2015-04-16 Sungmann Cho Remove PluginController::isPluginVisible(). https://bugs.webkit.org/show_bug.cgi?id=143830 Reviewed by Darin Adler. PluginController::isPluginVisible() was introduced by http://webkit.org/b/60285. This method had been used only for WebKit2 on Windows, and no one uses it now. So we can remove it. No new tests, no behavior change. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::isPluginVisible): Deleted. * PluginProcess/PluginControllerProxy.h: * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::isPluginVisible): Deleted. * WebProcess/Plugins/PluginView.h: 2015-04-16 Gyuyoung Kim [EFL] Disable a flaky ewk_context_network_process_model() API test https://bugs.webkit.org/show_bug.cgi?id=143824 Reviewed by Csaba Osztrogonác. ewk_context_network_process_model has been often failed. Though Bug 142967 was filed to fix this issue, it is not solved yet. To maintain EFL bot, this patch disables it until fixing it. * UIProcess/API/efl/tests/test_ewk2_context.cpp: (TEST_F): 2015-04-16 Csaba Osztrogonác [WK2] Forwarding headers generator shouldn't generate unnecessary headers https://bugs.webkit.org/show_bug.cgi?id=143820 Reviewed by Carlos Garcia Campos. * Scripts/generate-forwarding-headers.pl: (collectNeededHeaders): 2015-04-16 Csaba Osztrogonác [GTK] Run forwarding headers generator unconditionally https://bugs.webkit.org/show_bug.cgi?id=143819 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: 2015-04-15 Brent Fulgham [Mac] Disable "Save to Downloads" option for local files https://bugs.webkit.org/show_bug.cgi?id=143794 Reviewed by Tim Horton. Disable the Image and Media download options if the download target is a local file. We can only download web resources; anything else is actually a no-op. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForVideo]): (-[WKActionMenuController _defaultMenuItemsForImage]): 2015-04-15 Anders Carlsson Make websiteDataStore on WKWebViewConfiguration public https://bugs.webkit.org/show_bug.cgi?id=143810 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration websiteDataStore]): (-[WKWebViewConfiguration setWebsiteDataStore:]): (-[WKWebViewConfiguration _websiteDataStore]): (-[WKWebViewConfiguration _setWebsiteDataStore:]): 2015-04-15 Anders Carlsson Make WKWebsiteDataStore public https://bugs.webkit.org/show_bug.cgi?id=143805 Reviewed by Dan Bernstein. Rename the current _WKWebsiteDataStore to WKWebsiteDataStore. Make init unavailable and tighten up the types of the defaultDataStore and nonPersistentDataStore class methods. Add a new _WKWebsiteDataStore @interface and @implementation that derives from WKWebsiteDataStore and forwards the defaultDataStore and nonPersistentDataStore method calls. * Shared/API/Cocoa/WebKit.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _websiteDataStore]): * UIProcess/API/Cocoa/WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.mm. (+[WKWebsiteDataStore defaultDataStore]): (+[WKWebsiteDataStore nonPersistentDataStore]): (-[WKWebsiteDataStore dealloc]): (-[WKWebsiteDataStore isNonPersistent]): (toSystemClockTime): (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]): (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): (toWebsiteDataRecords): (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]): (-[WKWebsiteDataStore _apiObject]): * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h. (WebKit::wrapper): * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: (+[_WKWebsiteDataStore defaultDataStore]): (+[_WKWebsiteDataStore nonPersistentDataStore]): (-[_WKWebsiteDataStore dealloc]): Deleted. (-[_WKWebsiteDataStore isNonPersistent]): Deleted. (toWebsiteDataTypes): Deleted. (toSystemClockTime): Deleted. (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): Deleted. (-[_WKWebsiteDataStore _apiObject]): Deleted. * WebKit2.xcodeproj/project.pbxproj: 2015-04-15 Timothy Horton Custom CSS cursors do not use -webkit-image-set on retina displays https://bugs.webkit.org/show_bug.cgi?id=120783 Reviewed by Beth Dakin. Patch by Evan Wallace . Serialize the cursor image scale for SetCursor messages so custom CSS cursors work with -webkit-image-set on retina displays. * Shared/WebCoreArgumentCoders.cpp: (CoreIPC::ArgumentCoder::encode): (CoreIPC::ArgumentCoder::decode): 2015-04-15 Alex Christensen Progress towards CMake on Mac. https://bugs.webkit.org/show_bug.cgi?id=143785 Reviewed by Csaba Osztrogonác. * CMakeLists.txt: * PlatformEfl.cmake: * PlatformGTK.cmake: 2015-04-15 Anders Carlsson Make WKWebsiteDataRecord public https://bugs.webkit.org/show_bug.cgi?id=143796 Reviewed by Dan Bernstein. Rename _WKWebsiteDataRecord and associated files to WKWebsiteDataRecord and add a new _WKWebsiteDataRecord.h with a class @interface declaration that just inherits from WKWebsiteDataRecord. We don't need an @implementation since nobody is expected to allocate _WKWebsiteDataRecord objects. * Shared/API/Cocoa/WebKit.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.h. * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm. (-[WKWebsiteDataRecord dealloc]): (dataTypesToString): (-[WKWebsiteDataRecord description]): (-[WKWebsiteDataRecord displayName]): (-[WKWebsiteDataRecord dataTypes]): (-[WKWebsiteDataRecord _apiObject]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h. (WebKit::wrapper): (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: (toWebsiteDataRecords): * WebKit2.xcodeproj/project.pbxproj: 2015-04-13 Jer Noble [Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideoElement. https://bugs.webkit.org/show_bug.cgi?id=143674 Reviewed by Darin Adler. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): Takes a reference. (WebKit::WebChromeClient::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen(). (WebKit::WebChromeClient::exitVideoFullscreen): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/ios/WebVideoFullscreenManager.h: * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Ditto. (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen(). (WebKit::WebVideoFullscreenManager::didEnterFullscreen): Pass a reference. (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Ditto. (WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted. 2015-04-15 Antti Koivisto Network Cache: Inline small body data to record file https://bugs.webkit.org/show_bug.cgi?id=143783 Reviewed by Chris Dumez. We currently save all body data as separate files. We can improve space efficiency and do less reads and writes by inlining smaller resource bodies with the header. * NetworkProcess/cache/NetworkCacheIOChannel.h: * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::IOChannel::readSync): (WebKit::NetworkCache::IOChannel::write): Add WorkQueue argument to allow specifying which queue the result is submitted to. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::decodeRecordMetaData): Add a boolean indicating whether the body is inlined. (WebKit::NetworkCache::decodeRecordHeader): (WebKit::NetworkCache::Storage::decodeRecord): (WebKit::NetworkCache::encodeRecordMetaData): (WebKit::NetworkCache::Storage::storeBodyAsBlob): (WebKit::NetworkCache::Storage::encodeRecord): (WebKit::NetworkCache::Storage::dispatchReadOperation): Read the record first, then read the blob if needed. Submit the read operation directly from the main queue. Only thing we do is opening an IO channel and that uses O_NONBLOCK. Process the read results in the IO work queue where we now do the blob retrieval. (WebKit::NetworkCache::shouldStoreBodyAsBlob): The current threshold for saving a separate blob is 16KB. (WebKit::NetworkCache::Storage::dispatchWriteOperation): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::createRecord): Deleted. (WebKit::NetworkCache::encodeRecordHeader): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: 2015-04-15 Tim Horton Non-local keyboards don't update scroll view parameters https://bugs.webkit.org/show_bug.cgi?id=143791 * Platform/spi/ios/UIKitSPI.h: Fix the build. 2015-04-15 Tim Horton Non-local keyboards don't update scroll view parameters https://bugs.webkit.org/show_bug.cgi?id=143791 Reviewed by Enrica Casucci. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _shouldUpdateKeyboardWithInfo:]): (-[WKWebView _keyboardWillChangeFrame:]): (-[WKWebView _keyboardWillShow:]): Make sure that we update scroll view parameters (obscured insets, etc.) if we have a non-local keyboard, in addition to the cases where we have an assisted node. 2015-04-15 Dan Bernstein No matching __NSi_ definition for postprocessed value of WK_{MAC,IOS}_TBA https://bugs.webkit.org/show_bug.cgi?id=143786 Reviewed by Anders Carlsson. * Shared/API/Cocoa/WKFoundation.h: Added a placeholder for the postprocessing script to insert a definition of __NSi_* for the current deployment target. Import CoreFoundation.h so that we can check if the macro is already defined. * WebKit2.xcodeproj/project.pbxproj: In the Postprocess WKFoundation.h script build phase, replace the placeholder with a definition of __NSi_{current deployment target} if not already defined. 2015-04-14 Anders Carlsson Make creating send rights from shared memory more robust https://bugs.webkit.org/show_bug.cgi?id=143730 rdar://problem/16595870 Reviewed by Darin Adler. This cleans up creation of handles and send rights and also fixes a bug where it would be impossible to send more than 128 MB of shared memory in a single object. * Platform/SharedMemory.h: * Platform/mac/SharedMemoryMac.cpp: (WebKit::makeMemoryEntry): New helper function that creates a memory entry send right. This uses MAP_MEM_VM_SHARE which ensures that memory objects larger than 128 MB will be handled correctly. (WebKit::SharedMemory::create): Call makeMemoryEntry. (WebKit::SharedMemory::createHandle): Call createSendRight. (WebKit::SharedMemory::createSendRight): Call makeMemoryEntry and add the necessary assertions. 2015-04-15 Eric Carlson Generalize "isPlayingAudio" to include other media characteristics https://bugs.webkit.org/show_bug.cgi?id=143713 Reviewed by Jer Noble. * UIProcess/API/C/WKPage.cpp: (toGenericCallbackFunction): Scope CallbackBase. (WKPageForceRepaint): Ditto. (WKPageValidateCommand): Ditto. (WKPageComputePagesForPrinting): Ditto. * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto. * UIProcess/API/mac/WKView.mm: (-[WKView becomeFirstResponder]): Ditto. (-[WKView updateFontPanelIfNeeded]): Ditto. (-[WKView validateUserInterfaceItem:]): Ditto. (-[WKView startSpeaking:]): Ditto. (-[WKView selectedRangeWithCompletionHandler:]): Ditto. (-[WKView markedRangeWithCompletionHandler:]): Ditto. (-[WKView hasMarkedTextWithCompletionHandler:]): Ditto. (-[WKView attributedSubstringForProposedRange:completionHandler:]): Ditto. (-[WKView firstRectForCharacterRange:completionHandler:]): Ditto. (-[WKView characterIndexForPoint:completionHandler:]): Ditto. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): Rename from isPlayingAudioDidChange. (WebKit::WebPageProxy::isPlayingAudioDidChange): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController dealloc]): Scope CallbackBase. (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto. * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto. (-[WKPrintingView _askPageToComputePageRects]): Ditto. (-[WKPrintingView _drawPreview:]): Ditto. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::setPluginIsPlayingAudio): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::isPlayingMediaDidChange): (WebKit::WebChromeClient::isPlayingAudioDidChange): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: 2015-04-15 Antti Koivisto Network Cache: Add thread-safe accessors for storage paths https://bugs.webkit.org/show_bug.cgi?id=143668 Reviewed by Darin Adler. Less need to use StringCapture. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::dumpFilePath): (WebKit::NetworkCache::Cache::storagePath): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::makeRecordsDirectoryPath): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::basePath): (WebKit::NetworkCache::Storage::versionPath): (WebKit::NetworkCache::Storage::recordsPath): (WebKit::NetworkCache::Storage::synchronize): (WebKit::NetworkCache::Storage::remove): (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::Storage::finishReadOperation): (WebKit::NetworkCache::Storage::dispatchWriteOperation): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::Storage::clear): (WebKit::NetworkCache::Storage::shrink): (WebKit::NetworkCache::Storage::deleteOldVersions): (WebKit::NetworkCache::makeRecordDirectoryPath): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::baseDirectoryPath): Deleted. (WebKit::NetworkCache::Storage::directoryPath): Deleted. 2015-04-14 Tim Horton Update gesture swipe shadow style https://bugs.webkit.org/show_bug.cgi?id=143616 Reviewed by Darin Adler. * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::beginSwipeGesture): For the modern shadow style, use a layer stretched along the edge of the swiping content with the newly added PNGs as the layer contents. Add a dimming layer over the lower layer of content which fades in/out during the swipe. (WebKit::ViewGestureController::handleSwipeGesture): Fade the dimming layer in and out during the entire swipe. Fade the shadow layer out during the last few pixels of the swipe. (WebKit::ViewGestureController::removeSwipeSnapshot): Unparent the new layers. * WebKit2.xcodeproj/project.pbxproj: * Resources/SwipeShadow.png: * Resources/SwipeShadow@2x.png: Add the new resources. 2015-04-14 Brian Weinstein Add SPI to clear HSTS hosts added since a date. https://bugs.webkit.org/show_bug.cgi?id=143726 and rdar://problem/16664597 Reviewed by Anders Carlsson. * UIProcess/API/C/mac/WKContextPrivateMac.h: * UIProcess/API/C/mac/WKContextPrivateMac.mm: (WKContextResetHSTSHostsAddedAfterDate): Call into the WebProcessPool. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate): Call CFNetwork SPI to clear HSTS hosts added after the given date. * UIProcess/WebProcessPool.h: 2015-04-14 Anders Carlsson More work on making the SharedMemory interface more sane https://bugs.webkit.org/show_bug.cgi?id=143718 Reviewed by Andreas Kling. Get rid of m_shouldVMDeallocateData. The idea is that shared memory created by calling SharedMemory::allocate has a non-null m_data pointer, and a null m_port. Shared memory created by calling SharedMemory::create with a pointer and a length has a non-null port but a null m_data since the data can be unmapped by the caller and we don't want to hold on to dangling pointers. * Platform/SharedMemory.h: (WebKit::SharedMemory::data): * Platform/mac/SharedMemoryMac.cpp: (WebKit::SharedMemory::allocate): (WebKit::SharedMemory::create): (WebKit::SharedMemory::map): (WebKit::SharedMemory::~SharedMemory): (WebKit::SharedMemory::createHandle): 2015-04-14 Antti Koivisto Network Cache: Deduplicate body data https://bugs.webkit.org/show_bug.cgi?id=143652 Reviewed by Darin Adler. It is common to have cache entries with identical body data. This happens when the same resource is loaded from a different URL (https vs http, slash vs no-slash at end, etc.). It also happens when the same URL is referenced from different cache partitions. We can improve disk space efficiency and use less memory by sharing identical body data between cache entries. This patch splits the body data out from the record file. The new record file contains meta data and response headers only. Body data is stored using the new BlobStorage interface. Files are deduplicated by computing SHA1 hash over the data and looking for an existing blob with the same hash. If found the existing entry is reused by creating a hard link to it. The new disk structure looks like this: WebKitCache/ Version 3/ Blobs/ 0A3C9A970ADA27FAE9BD7BC630BAD0B929C293C0 0A6B8060BA77DF92C82A2FD7AF58F79524D8F34C ... Records/ apple.com/ 0B8645B04E7EC78C178B7460052601C2 0B8645B04E7EC78C178B7460052601C2-body 0CB1A3638D1C5A09C5E3283A74FA040B 0CB1A3638D1C5A09C5E3283A74FA040B-body ... Each record file has an associated -body which is a hard link to a file in the Blobs directory. The patch increases effective capacity by 10-20% with a typical cache. It also saves memory especially when identical resources are used in multiple tabs. Currently all >0 sized resources are stored as shared blobs. In future small resources should be integrated into record files and blobs used for larger files only. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::store): (WebKit::NetworkCache::Cache::update): Adopt the new storage interface. (WebKit::NetworkCache::Cache::dumpContentsToFile): * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: Added. (WebKit::NetworkCache::BlobStorage::BlobStorage): (WebKit::NetworkCache::BlobStorage::synchronize): Compute size and delete unused files from the Blobs directory (link count == 1). (WebKit::NetworkCache::BlobStorage::blobPath): (WebKit::NetworkCache::BlobStorage::add): (WebKit::NetworkCache::BlobStorage::get): Interface for storing and retrieving data blobs. Blobs are deduplicated on add. (WebKit::NetworkCache::BlobStorage::remove): Removes the link but doesn't remove the blob even if there are no other clients. That happens on next synchronize(). (WebKit::NetworkCache::BlobStorage::shareCount): Checks the link count to get the number of clients. * NetworkProcess/cache/NetworkCacheBlobStorage.h: Added. (WebKit::NetworkCache::BlobStorage::approximateSize): * NetworkProcess/cache/NetworkCacheCoders.cpp: (WebKit::NetworkCache::Coder::encode): (WebKit::NetworkCache::Coder::decode): * NetworkProcess/cache/NetworkCacheCoders.h: * NetworkProcess/cache/NetworkCacheData.h: (WebKit::NetworkCache::Data::isEmpty): * NetworkProcess/cache/NetworkCacheDataCocoa.mm: (WebKit::NetworkCache::Data::empty): (WebKit::NetworkCache::Data::fromMap): (WebKit::NetworkCache::mapFile): (WebKit::NetworkCache::computeSHA1): (WebKit::NetworkCache::bytesEqual): Add some helpers. * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::asJSON): * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: (WebKit::NetworkCache::IOChannel::IOChannel): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::makeRecordDirectoryPath): (WebKit::NetworkCache::makeBlobDirectoryPath): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::approximateSize): (WebKit::NetworkCache::Storage::synchronize): (WebKit::NetworkCache::partitionPathForKey): (WebKit::NetworkCache::recordPathForKey): (WebKit::NetworkCache::bodyPath): (WebKit::NetworkCache::decodeRecordMetaData): (WebKit::NetworkCache::decodeRecordHeader): (WebKit::NetworkCache::createRecord): (WebKit::NetworkCache::encodeRecordMetaData): (WebKit::NetworkCache::encodeRecordHeader): (WebKit::NetworkCache::Storage::remove): (WebKit::NetworkCache::Storage::updateFileModificationTime): (WebKit::NetworkCache::Storage::dispatchReadOperation): Read both the blob and the record entry. (WebKit::NetworkCache::Storage::finishReadOperation): Factor to a function. (WebKit::NetworkCache::Storage::store): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations): (WebKit::NetworkCache::Storage::dispatchWriteOperation): We don't need separate full write and header write paths anymore. Everything is treated as a full write and deduplication stops us writing the body again. This simplifies the code and data structures. (WebKit::NetworkCache::Storage::finishWriteOperation): Factor to a function. (WebKit::NetworkCache::Storage::clear): (WebKit::NetworkCache::deletionProbability): Take the sharing count into account when computing deletion probability. It is less useful to delete a record that shares its body with others as data won't get deleted. (WebKit::NetworkCache::Storage::shrinkIfNeeded): (WebKit::NetworkCache::Storage::shrink): (WebKit::NetworkCache::Storage::deleteOldVersions): (WebKit::NetworkCache::directoryPathForKey): Deleted. (WebKit::NetworkCache::filePathForKey): Deleted. (WebKit::NetworkCache::openFileForKey): Deleted. (WebKit::NetworkCache::decodeRecord): Deleted. (WebKit::NetworkCache::Storage::update): Deleted. No need for separate update interface anymore. Regular store() avoids unnecessary body write. (WebKit::NetworkCache::Storage::dispatchFullWriteOperation): Deleted. (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: * WebKit2.xcodeproj/project.pbxproj: 2015-04-14 Chris Dumez REGRESSION(r182603): [GTK] More than 500 crashes on the layout tests with the debug build. https://bugs.webkit.org/show_bug.cgi?id=143715 Reviewed by Darin Adler. Enable assertions checking that calling editorState() does not cause a synchronous layout only on Mac and iOS. This assertion does not necessarily hold true on other ports as each one as its own platformEditorState() implementation. In particular, this assertion was being hit on GTK. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didChangeSelection): 2015-04-13 Alexey Proskuryakov Build fixes after r182772. * UIProcess/API/mac/WKView.mm: (-[WKView _updateAutomaticallyComputedFixedLayoutSize]): Make a CGSize, not an NSSize. (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): Moved implementation to the correct place. (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]): Ditto. (-[WKView _layoutMode]): Use a memeber from _data directly, not via a method. 2015-04-13 Alexey Proskuryakov More build fix. * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setDragImage): 2015-04-13 Hunseop Jeong [EFL][GTK] Fix build break after r182753 https://bugs.webkit.org/show_bug.cgi?id=143689 Reviewed by Anders Carlsson. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::processMessage): (IPC::Connection::sendOutgoingMessage): * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::allocate): (WebKit::accessModeMMap): (WebKit::SharedMemory::map): (WebKit::SharedMemory::create): Deleted. 2015-04-13 Alexey Proskuryakov Build fix. * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setDragImage): 2015-04-13 Anders Carlsson Keep track of each shared memory object's protection when deciding whether to return our existing port https://bugs.webkit.org/show_bug.cgi?id=143687 Reviewed by Tim Horton. * Platform/SharedMemory.h: * Platform/mac/SharedMemoryMac.cpp: (WebKit::machProtection): (WebKit::SharedMemory::create): (WebKit::SharedMemory::map): (WebKit::SharedMemory::createHandle): 2015-04-13 Tim Horton Add a persistent, fixed scale factor to make it easy to scale down WK(Web)Views https://bugs.webkit.org/show_bug.cgi?id=143560 Reviewed by Darin Adler. Add a new "view" scale factor to WKView and WKWebView. Unlike page scale (or "magnification" in the API), view scale: - persists between page loads - persists between Web process crashes - is not user adjustable - can reliably be < 1 The page scale and view scale are multiplied together whenever we push a new page scale down into WebCore, so the implementation of view scale is transparent to WebCore, and acts effectively as a constant multiplier for the (user-adjustable) page scale factor. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::scaleView): Add scaleView, which updates our cached viewScaleFactor and pushes it to the Web process. (WebKit::WebPageProxy::creationParameters): Plumb viewScaleFactor through the page creation parameters. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::viewScaleFactor): Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): If the viewScaleFactor is not 1 at creation time, call scalePage with a page scale of 1. Internally, scalePage will multiply in the viewScaleFactor and push it all to the Web process. (WebKit::WebPage::scalePage): Multiply the page scale factor by the view scale factor before passing it to WebCore. (WebKit::WebPage::scalePageInViewCoordinates): Early returns need to check the total scale, not just the new page scale. (WebKit::WebPage::totalScaleFactor): The scale that we get back from WebCore::Page::pageScaleFactor is the product of WebKit2's view and page scales. So, here we'll call that the totalScaleFactor. (Might need a different name because it seems like "total" should include deviceScale too). (WebKit::WebPage::pageScaleFactor): WebKit2's notion of the pageScaleFactor does not include the view scale, so divide it out of WebCore's page scale. (WebKit::WebPage::scaleView): Apply a new view scale, maintaining the current scroll position. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::viewScaleFactor): * WebProcess/WebPage/WebPage.messages.in: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: Plumb viewScaleFactor through the page creation parameters. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _viewScale]): (-[WKWebView _setViewScale:]): * UIProcess/API/mac/WKView.mm: (-[WKView _viewScale]): (-[WKView _setViewScale:]): Push the new view scale to WebPage. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): (-[WKWebView _automaticallyComputesFixedLayoutSizeFromViewScale]): * UIProcess/API/mac/WKView.mm: (-[WKView setFrameSize:]): (-[WKView _updateAutomaticallyComputedFixedLayoutSize]): (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]): * UIProcess/API/mac/WKViewInternal.h: Add a new layout mode, "DynamicSizeComputedFromViewScale", which turns on fixed layout size mode, and sets the fixed layout size based on the view's frame and view scale. The fixed layout size is maintained as the frame of the view scaled by the inverse of the view scale. This makes it very easy to maintain a WK(Web)View that is scaled down by a constant amount, but is laid out as if it were not. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage): Because the transient zoom mechanism touches layers that WebCore owns, it mostly need to operate with totalScaleFactor, because that is what WebCore sees. 2015-04-10 Brent Fulgham Expand test infrastructure to support scrolling tests https://bugs.webkit.org/show_bug.cgi?id=143286 Reviewed by Simon Fraser. Extend the WK2 testing API to include a method for setting a JSC callback function to be triggered by the new WebCore::WheelEventTestTrigger singleton. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageStartMonitoringScrollOperations): WK2 method that causes the testing system to begin tracking wheel events. (WKBundlePageRegisterScrollOperationCompletionCallback): WK2 method to set the callback function for testing. * WebProcess/InjectedBundle/API/c/WKBundlePage.h: 2015-04-13 Enrica Casucci Clients of WKWebView should be able to override drag functions. https://bugs.webkit.org/show_bug.cgi?id=143618 Reviewed by Darin Adler. WKWebView now implements the drag protocol functions and forwards the calls to the inner WKView. In the page client, when we receive a request to start drag from the WebProcess, we call _dragImageForView in WKView with the target view. The function calls dragImage on the given view, so that its clients can override the dragImage function. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView draggingEntered:]): (-[WKWebView draggingUpdated:]): (-[WKWebView draggingExited:]): (-[WKWebView prepareForDragOperation:]): (-[WKWebView performDragOperation:]): * UIProcess/API/mac/WKView.mm: (-[WKView _dragImageForView:withImage:at:linkDrag:]): (-[WKView _setDragImage:at:linkDrag:]): Deleted. * UIProcess/API/mac/WKViewInternal.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setDragImage): 2015-04-13 Alex Christensen [iOS] Unreviewed build fix after r182760. * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeSharedBuffer): (IPC::decodeSharedBuffer): Update SharedMemory function names. 2015-04-13 Anders Carlsson Rename SharedMemory::create overloads https://bugs.webkit.org/show_bug.cgi?id=143679 Reviewed by Beth Dakin. Rename the SharedMemory::create overload that allocates memory to SharedMemory::allocate, and the SharedMemory::create overload that maps in a handle to SharedMemory::map. * Platform/SharedMemory.h: * Platform/mac/SharedMemoryMac.cpp: (WebKit::SharedMemory::allocate): (WebKit::SharedMemory::map): (WebKit::SharedMemory::create): Deleted. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::createShareable): (WebKit::ShareableBitmap::create): * Shared/ShareableResource.cpp: (WebKit::ShareableResource::create): * Shared/ShareableResource.h: * Shared/WebCompiledContentExtension.cpp: (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData): * Shared/WebCompiledContentExtensionData.cpp: (WebKit::WebCompiledContentExtensionData::decode): * Shared/WebHitTestResult.cpp: (WebKit::WebHitTestResult::Data::Data): (WebKit::WebHitTestResult::Data::decode): * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardBufferForType): (WebKit::WebPasteboardProxy::setPasteboardBufferForType): * UIProcess/VisitedLinkProvider.cpp: (WebKit::VisitedLinkProvider::resizeTable): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::dataSelectionForPasteboard): (WebKit::WebPageProxy::setPromisedDataForImage): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::bufferForType): (WebKit::WebPlatformStrategies::setBufferForType): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::setVisitedLinkTable): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::getDataSelectionForPasteboard): 2015-04-13 Brady Eidson Share sheets from Share menus appear outside the browser window. and https://bugs.webkit.org/show_bug.cgi?id=143620 Reviewed by Darin Adler. Refactor existing Sharing Service Picker code to also be used for the Share menu NSMenuItem. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::internalShowContextMenu): (WebKit::WebPageProxy::platformInitializeShareMenuItem): * UIProcess/WebPageProxy.h: * UIProcess/mac/WKSharingServicePickerDelegate.h: Added. * UIProcess/mac/WKSharingServicePickerDelegate.mm: Added. (+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]): (-[WKSharingServicePickerDelegate menuProxy]): (-[WKSharingServicePickerDelegate setMenuProxy:]): (-[WKSharingServicePickerDelegate setPicker:]): (-[WKSharingServicePickerDelegate setFiltersEditingServices:]): (-[WKSharingServicePickerDelegate setHandlesEditingReplacement:]): (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]): (-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]): (-[WKSharingServicePickerDelegate sharingService:willShareItems:]): (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): (-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): (+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]): Deleted. (-[WKSharingServicePickerDelegate menuProxy]): Deleted. (-[WKSharingServicePickerDelegate setMenuProxy:]): Deleted. (-[WKSharingServicePickerDelegate setPicker:]): Deleted. (-[WKSharingServicePickerDelegate setIncludeEditorServices:]): Deleted. (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]): Deleted. (-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]): Deleted. (-[WKSharingServicePickerDelegate sharingService:willShareItems:]): Deleted. (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Deleted. (-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::platformInitializeShareMenuItem): * WebKit2.xcodeproj/project.pbxproj: 2015-04-13 Anders Carlsson Begin cleaning up the shared memory interface https://bugs.webkit.org/show_bug.cgi?id=143677 Reviewed by Andreas Kling. Rename createFromVMBuffer to create and add a protection parameter (which is currently unused). Also, turn SharedMemory::Protection into a proper enum class. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::store): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord): * NetworkProcess/mac/NetworkResourceLoaderMac.mm: (WebKit::tryGetShareableHandleFromCFData): * Platform/SharedMemory.h: * Platform/mac/SharedMemoryMac.cpp: (WebKit::SharedMemory::create): (WebKit::machProtection): (WebKit::SharedMemory::createHandle): (WebKit::SharedMemory::createFromVMBuffer): Deleted. * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::encode): (WebKit::ContextMenuContextData::decode): * Shared/ShareableBitmap.h: * Shared/ShareableResource.cpp: (WebKit::ShareableResource::create): (WebKit::ShareableResource::createHandle): * Shared/WebCompiledContentExtensionData.cpp: (WebKit::WebCompiledContentExtensionData::encode): (WebKit::WebCompiledContentExtensionData::decode): * Shared/WebHitTestResult.cpp: (WebKit::WebHitTestResult::Data::encode): (WebKit::WebHitTestResult::Data::decode): * UIProcess/API/APIUserContentExtensionStore.cpp: (API::createExtension): * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardBufferForType): (WebKit::WebPasteboardProxy::setPasteboardBufferForType): (WebKit::WebPasteboardProxy::readBufferFromPasteboard): * UIProcess/VisitedLinkProvider.cpp: (WebKit::VisitedLinkProvider::sendTable): * UIProcess/mac/WKPrintingView.mm: (pageDidDrawToImage): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::dataSelectionForPasteboard): (WebKit::WebPageProxy::setPromisedDataForImage): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::bufferForType): (WebKit::WebPlatformStrategies::setBufferForType): (WebKit::WebPlatformStrategies::readBufferFromPasteboard): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::setVisitedLinkTable): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::takeSnapshot): (WebKit::WebPage::drawRectToImage): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::getDataSelectionForPasteboard): 2015-04-10 Jon Honeycutt Cannot click "Next" button on Google two-factor auth setup page This issue occurs when this site focuses the submit button. When it receives focus, we try to assist it. While we consider ourselves to be assisting it, we ignore further gesture inputs for that node, including the tap gesture. To fix this, only assist input types that we know are assistable, including text fields, select and date elements, etc. Reviewed by Darin Adler. * UIProcess/ios/WKContentViewInteraction.mm: (isAssistableInputType): If the type is a known-assistable type, return true. (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Call isAssistableInputType() to determine whether we should do any kind of assistance for this node. 2015-04-13 Beth Dakin Add force property to MouseEvents https://bugs.webkit.org/show_bug.cgi?id=143569 -and corresponding- rdar://problem/20472954 Reviewed by Darin Adler. In order to accommodate adding force to all PlatformMouseEvents, we have to add it to pass a caches pressure event to NativeWebMouseEvent and add force to WebMouseEvent. NativeWebMouseEvent now requires a second NSEvent for the pressureEvent. * Shared/NativeWebMouseEvent.h: WebMouseEvent takes a force parameter. * Shared/WebEvent.h: (WebKit::WebMouseEvent::force): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): * Shared/WebMouseEvent.cpp: (WebKit::WebMouseEvent::WebMouseEvent): (WebKit::WebMouseEvent::encode): (WebKit::WebMouseEvent::decode): * Shared/mac/NativeWebMouseEventMac.mm: (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): * Shared/mac/WebEventFactory.h: * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebMouseEvent): Cache the most recent pressureEvent in _data so that it can be sent along to the NativeWebMouseEvent constructor. * UIProcess/API/mac/WKView.mm: (-[WKView pressureChangeWithEvent:]): (-[WKView acceptsFirstMouse:]): (-[WKView shouldDelayWindowOrderingForEvent:]): (-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]): (-[WKView initWithFrame:processPool:configuration:webView:]): WebMouseEvent takes a force parameter. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::showContextMenuAtPoint): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::createWebEvent): MouseEvent and PlatformMouseEvent both take force parameters too. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::navigateToURLWithSimulatedClick): (WebKit::WebPage::contextMenuAtPointInWindow): (WebKit::WebPage::dragEnded): (WebKit::WebPage::simulateMouseDown): (WebKit::WebPage::simulateMouseUp): (WebKit::WebPage::simulateMouseMotion): The functions that dispatch the force events no longer take a PlatformMouseEvent as a parameter. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::inputDeviceForceDidChange): (WebKit::WebPage::immediateActionDidCancel): 2015-04-13 Andreas Kling Don't segregate heap objects based on Structure immortality. Reviewed by Darin Adler. * WebProcess/Plugins/Netscape/JSNPObject.h: 2015-04-13 Timothy Horton javascript: links in inline PDFs shouldn't execute JavaScript in the context of the host website https://bugs.webkit.org/show_bug.cgi?id=143642 Reviewed by Darin Adler. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::clickedLink): Don't follow javascript: URLs. 2015-04-10 Alex Christensen [Content Extensions] Don't unmap shared memory while using it. https://bugs.webkit.org/show_bug.cgi?id=143625 Reviewed by Darin Adler. * Shared/WebCompiledContentExtension.cpp: (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData): * Shared/WebCompiledContentExtensionData.h: (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData): * UIProcess/API/APIUserContentExtensionStore.cpp: (API::createExtension): Keep the Data object alive as long as the SharedMemory that uses it. 2015-04-12 Darin Adler [Cocoa] Localizable strings are inconsistent and need to be regenerated https://bugs.webkit.org/show_bug.cgi?id=143661 Reviewed by Dan Bernstein. * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::nameForEditAction): Also added a comment about the fact that we have two copies of all the localizable strings. 2015-04-12 Sungmann Cho Fix trival typos related to the word "coordinate". https://bugs.webkit.org/show_bug.cgi?id=143644 Reviewed by Alexey Proskuryakov. No new tests, no behavior change. * Shared/WebHitTestResult.cpp: (WebKit::WebHitTestResult::Data::encode): (WebKit::WebHitTestResult::Data::decode): * Shared/WebHitTestResult.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): (WebKit::WebPage::lookupTextAtLocation): 2015-04-12 Sungmann Cho Remove PluginModuleInfo.cpp from WebKit2 https://bugs.webkit.org/show_bug.cgi?id=143643 Reviewed by Darin Adler. Remove PluginModuleInfo.cpp from WebKit2 because it is totally empty. No new tests, no behavior change. * CMakeLists.txt: * Shared/Plugins/PluginModuleInfo.cpp: Removed. * WebKit2.xcodeproj/project.pbxproj: 2015-04-11 Yusuke Suzuki [ES6] Enable Symbol in web pages https://bugs.webkit.org/show_bug.cgi?id=143375 Reviewed by Ryosuke Niwa. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/efl/WebInspectorProxyEfl.cpp: (WebKit::WebInspectorProxy::platformCreateInspectorPage): * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformCreateInspectorPage): * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformCreateInspectorPage): 2015-04-08 Sam Weinig Allow LaunchServices to handle URLs on link navigations https://bugs.webkit.org/show_bug.cgi?id=143544 Reviewed by Anders Carlsson. * UIProcess/Cocoa/NavigationState.mm: (WebKit::tryAppLink): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): Only let LaunchServices have a crack at the URL if the navigation is: 1) a main frame navigation 2) a result of a user gesture 2015-04-10 Tim Horton Replace setFixedLayoutSizeEnabled: with an enum of layout modes https://bugs.webkit.org/show_bug.cgi?id=143576 Reviewed by Simon Fraser. * UIProcess/API/C/WKLayoutMode.h: Added. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _layoutMode]): (-[WKWebView _setLayoutMode:]): (-[WKWebView _isFixedLayoutEnabled]): Deleted. (-[WKWebView _setFixedLayoutEnabled:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKLayoutMode.h: Added. * UIProcess/API/mac/WKView.mm: (-[WKView _layoutMode]): (-[WKView _setLayoutMode:]): (-[WKView _isFixedLayoutEnabled]): Deleted. (-[WKView _setFixedLayoutEnabled:]): Deleted. * WebKit2.xcodeproj/project.pbxproj: Add enums for "layout mode". Currently we have two values: "ViewSize", which is the normal behavior, and "FixedSize", which is fixed layout mode. More values will come in the future. 2015-04-10 Anders Carlsson _WKWebsiteDataStore doesn't track and remove offline application cache entries https://bugs.webkit.org/show_bug.cgi?id=143614 rdar://problem/20243235 Reviewed by Andreas Kling. * Shared/WebsiteData/WebsiteDataTypes.h: Add WebsiteDataTypeOfflineWebApplicationCache. * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): Add WKWebsiteDataTypeOfflineWebApplicationCache. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): Create a custom application cache storage and fetch the origins from it. (WebKit::WebsiteDataStore::removeData): Delete either all the cache entries (since we don't track time in the application cache), or the ones specified by the given entries. 2015-04-10 Eric Carlson [Mac] Refactor MediaPlaybackTarget https://bugs.webkit.org/show_bug.cgi?id=143571 Reviewed by Jer Noble. Pass a MediaPlaybackTargetContext across process boundary instead of a MediaPlaybackTarget. * Shared/WebCoreArgumentCoders.h: (IPC::ArgumentCoder::encode): New. (IPC::ArgumentCoder::decode): New. * Shared/mac/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encodePlatformData): New. (IPC::ArgumentCoder::decodePlatformData): New. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChoosePlaybackTarget): Take a Ref&&. * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::playbackTargetSelected): Take a Ref&&. 2015-04-10 Hunseop Jeong Fix some minor typos related to the WebProcessCreationParameter. https://bugs.webkit.org/show_bug.cgi?id=143598 Reviewed by Csaba Osztrogonác. No new tests, no behavior change. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2015-04-09 Andy Estes [Cocoa] Add a HAVE(AVKIT) and use it https://bugs.webkit.org/show_bug.cgi?id=143593 Reviewed by David Kilzer. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _mayAutomaticallyShowVideoOptimized]): Returned false if !HAVE(AVKIT). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): Removed the check for < iOS 8.2. (WebKit::WebPageProxy::reattachToWebProcess): Ditto. * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::create): Created a version of this function that returns nullptr if the minimum required version of iOS is less than 8.2 or if !HAVE(AVKIT). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Only called Settings::setAVKitEnabled(true) if HAVE(AVKIT). 2015-04-09 Hunseop Jeong Use modern loops in WebProcess https://bugs.webkit.org/show_bug.cgi?id=143302 Reviewed by Darin Adler. Use modern range for-loops in WebProcess. No new tests, no behavior change. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::focusedWebPage): (WebKit::WebProcess::webPageGroup): (WebKit::WebProcess::setTextCheckerState): (WebKit::WebProcess::resetAllGeolocationPermissions): 2015-04-09 Gordon Sheridan Track IconDatabase retain counts for WebContent processes. Balance retain/releases for processes that terminate before successfully doing it themselves. https://bugs.webkit.org/show_bug.cgi?id=143517. Reviewed by Brady Eidson. * UIProcess/WebIconDatabase.messages.in: Move RetainIconForPageURL and ReleaseIconForPageURL messages to WebProcessProxy so they can be associated with the appropriate web process. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::connectionDidClose): Call releaseRemainingIconsForPageURLs() to balance retains/releases for this process. (WebKit::WebProcessProxy::retainIconForPageURL): Track retain counts for page URLs and call through to WebIconDatabase. (WebKit::WebProcessProxy::releaseIconForPageURL): Ditto. (WebKit::WebProcessProxy::releaseRemainingIconsForPageURLs): Call releaseIconForPageURL() once for each outstanding retain count, for each page URL. * UIProcess/WebProcessProxy.h: Declare methods for retainIconForPageURL(), releaseIconForPageURL(), and releaseRemainingIconsForPageURLs(). Declare hash map to track number of retains per page URL. * UIProcess/WebProcessProxy.messages.in: Moved RetainIconForPageURL and ReleaseIconForPageURL messages here from WebIconDatabase. * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: (WebKit::WebIconDatabaseProxy::retainIconForPageURL): Modify the receiver of the message to be WebProcessProxy. (WebKit::WebIconDatabaseProxy::releaseIconForPageURL): Ditto. 2015-04-09 Chris Dumez [WK2] Regression(r182194): The NetworkProcess is calling the wrong memory pressure handler before suspending https://bugs.webkit.org/show_bug.cgi?id=143575 Reviewed by Andreas Kling. After r182194, the NetworkProcess is calling the memory pressure handler before getting suspended to free-up as much memory as possible at this point. However, we were calling the default memory pressure handling code instead of the custom handler registered by the NetworkProcess. This patch fixes the problem. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::lowMemoryHandler): (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::processWillSuspend): * NetworkProcess/NetworkProcess.h: 2015-04-09 Brady Eidson REGRESSION (r182573): Action Menus no longer appear for WebKit2 views displaying an image rdar://problem/20486551 and https://bugs.webkit.org/show_bug.cgi?id=143574 Reviewed by Brent Fulgham. * Shared/WebHitTestResult.cpp: (WebKit::WebHitTestResult::Data::Data): Clear up a name scoping issue. 2015-04-09 Chris Dumez [WK2][iOS] editorState() should not cause a synchronous layout https://bugs.webkit.org/show_bug.cgi?id=142536 Reviewed by Enrica Casucci. platformEditorState() on iOS does a synchronous layout to compute some of the EditorState members (e.g. caretRectAtStart / caretRectAtEnd). This is bad for performance as this is called every time the selection is changed (which happens for e.g. when you set the value of a focused HTMLInputElement). This patch updates the behavior on iOS to only send a partial EditorState on selection change so that the UIProcess gets most of the information (the ones that do not require style recalc or layout) ASAP. A full Editor state is then sent after the asynchronous layout is done. With this change, I see a 38% improvement on Speedometer (26.4 +/- 0.37 -> 36.5 +/- 0.54) on iPhone 6 Plus. * Shared/EditorState.cpp: (WebKit::EditorState::encode): (WebKit::EditorState::decode): (WebKit::EditorState::PostLayoutData::encode): (WebKit::EditorState::PostLayoutData::decode): * Shared/EditorState.h: (WebKit::EditorState::EditorState): Deleted. * UIProcess/ios/WKContentView.mm: (-[WKContentView _didCommitLayerTree:]): * UIProcess/ios/WKContentViewInteraction.mm: (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo): (-[WKContentView webSelectionRects]): (-[WKContentView _addShortcut:]): (-[WKContentView selectedText]): (-[WKContentView isReplaceAllowed]): (-[WKContentView _promptForReplace:]): (-[WKContentView _transliterateChinese:]): (-[WKContentView textStylingAtPosition:inDirection:]): (-[WKContentView canPerformAction:withSender:]): (-[WKContentView _showDictionary:]): (-[WKContentView _characterBeforeCaretSelection]): (-[WKContentView _characterInRelationToCaretSelection:]): (-[WKContentView _selectionAtDocumentStart]): (-[WKContentView selectedTextRange]): (-[WKContentView hasContent]): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::didChangeSelectionAndUpdateLayout): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState): (WebKit::WebPage::didChangeSelection): (WebKit::WebPage::sendPostLayoutEditorStateIfNeeded): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/efl/WebPageEfl.cpp: (WebKit::WebPage::platformEditorState): * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformEditorState): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformEditorState): 2015-04-09 Antti Koivisto Network Cache: Crash in WebCore::CachedResource::tryReplaceEncodedData https://bugs.webkit.org/show_bug.cgi?id=143562 Reviewed by Anders Carlsson. If another thread comes and truncates the file before we map it we end up with a map that crashes when accessed. * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: (WebKit::NetworkCache::IOChannel::IOChannel): When creating a new file unlink any existing file instead of using O_TRUNC. 2015-04-09 Csaba Osztrogonác [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times https://bugs.webkit.org/show_bug.cgi?id=142907 Unreviewed typo fix after r182595. * PlatformGTK.cmake: 2015-04-09 Csaba Osztrogonác [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times https://bugs.webkit.org/show_bug.cgi?id=142907 Reviewed by Carlos Garcia Campos. * PlatformEfl.cmake: * PlatformGTK.cmake: * Scripts/generate-forwarding-headers.pl: Make it work with more path and platform arguments. 2015-04-08 Joseph Pecoraro Exception in console and broken right click after attempting to show context menu in Inspector https://bugs.webkit.org/show_bug.cgi?id=143556 Reviewed by Brady Eidson. * Shared/mac/NativeContextMenuItem.mm: (WebKit::NativeContextMenuItem::NativeContextMenuItem): Add an ASSERT to immediately catch a menu item created with a nil native menu item. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::internalShowContextMenu): Gracefully handle a null share context menu item. 2015-04-08 Brent Fulgham [Mac] Unreviewed test fix after r182584 https://bugs.webkit.org/show_bug.cgi?id=143452 Correct bit comparison to use the correct value for the Control-key * Shared/mac/WebEventFactory.mm: (WebKit::typeForEvent): 2015-04-08 Jaehun Lim [EFL] Create PageUIClientEfl after sending CreateWebPage message https://bugs.webkit.org/show_bug.cgi?id=143514 Reviewed by Gyuyoung Kim. UIProcess sends some messages to WebPage before WebPage is created. It makes some error logs on debug build. So this patch moves the initialization of m_pageUIClient after calling WKViewInitialize(). * UIProcess/API/efl/EwkView.cpp: (EwkView::EwkView): 2015-04-08 Brent Fulgham [Mac] WebKit is not honoring OS preferences for secondary click behaviors https://bugs.webkit.org/show_bug.cgi?id=143452 Reviewed by Tim Horton. We cannot rely on the event's button number to decide behavior. The OS settings might have mapped middle button to context menu, etc. Instead, we should ask the OS (via NSMenu) what the proper button press behavior is. * Shared/mac/WebEventFactory.mm: (WebKit::mouseButtonForEvent): Ask NSMenu what kind of button press we have received. 2015-04-08 Brady Eidson Expose the "Share" menu for links, images, and media. and https://bugs.webkit.org/show_bug.cgi?id=143502 Reviewed by Tim Horton. * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): * Shared/WebHitTestResult.cpp: (WebKit::WebHitTestResult::Data::Data): * Shared/WebHitTestResult.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::internalShowContextMenu): * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::shareMenuItem): * WebProcess/WebCoreSupport/WebContextMenuClient.h: * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): Deleted. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): 2015-04-08 Anders Carlsson Add encoding and decoding of ints to WKRemoteObjectCoder https://bugs.webkit.org/show_bug.cgi?id=143538 Reviewed by Tim Horton. * Shared/API/Cocoa/WKRemoteObjectCoder.mm: (-[WKRemoteObjectEncoder encodeInt:forKey:]): (-[WKRemoteObjectDecoder decodeIntForKey:]): 2015-04-08 Anders Carlsson Delete ApplicationCache static member functions https://bugs.webkit.org/show_bug.cgi?id=143534 Reviewed by Tim Horton. * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp: (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin): (WebKit::WebApplicationCacheManager::deleteAllEntries): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::clearApplicationCacheForOrigin): (WebKit::InjectedBundle::appCacheUsageForOrigin): 2015-04-08 Enrica Casucci 32-bit build fix after r182554. * UIProcess/API/mac/WKView.mm: (-[WKView resignFirstResponder]): 2015-04-08 Beth Dakin Force events should not require preventDefault in order to fire https://bugs.webkit.org/show_bug.cgi?id=143503 -and corresponding- rdar://problem/20458916 Reviewed by Tim Horton. We no longer need m_lastActionMenuHitTestPreventsDefault since we’ll always dispatch the events to Element. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): (WebKit::WebPage::inputDeviceForceDidChange): (WebKit::WebPage::immediateActionDidCancel): 2015-04-08 Enrica Casucci Calling makeFirstResponder on WKWebView doesn't work. https://bugs.webkit.org/show_bug.cgi?id=143482 rdar://problem/20298166 Reviewed by Dan Bernstein. Adding forwarding of the responder status to the WKView. We also need to avoid doing any cleanup in resignFirstResponder if we know we are about to regain responder status again. Same goes for becomeFirstResponder. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView becomeFirstResponder]): (-[WKWebView acceptsFirstResponder]): * UIProcess/API/mac/WKView.mm: (-[WKView becomeFristResponder]): (-[WKView resignFirstResponder]): 2015-04-07 Tim Horton Fix the build. * UIProcess/API/mac/WKView.mm: (-[WKView _setFixedLayoutSize:]): 2015-04-07 Tim Horton Expose and test fixedLayoutSize via modern WebKit SPI https://bugs.webkit.org/show_bug.cgi?id=143500 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _isFixedLayoutEnabled]): (-[WKWebView _setFixedLayoutEnabled:]): (-[WKWebView _fixedLayoutSize]): (-[WKWebView _setFixedLayoutSize:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _isFixedLayoutEnabled]): (-[WKView _setFixedLayoutEnabled:]): (-[WKView _fixedLayoutSize]): (-[WKView _setFixedLayoutSize:]): Add API for adjusting the fixed layout size, and whether or not we use it. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Repair a mistake I made in r139822, where I brought odd TILED_BACKING_STORE-only logic (which disables scrollbars if fixedLayoutSize is enabled) to the rest of the ports. Put it back as TILED_BACKING_STORE-only. Persist the fixedLayoutSize through view creation; we already persist the enabled state, but not the size, which doesn't make any sense. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::fixedLayoutSize): * WebProcess/WebPage/WebPage.h: Add a fixedLayoutSize() getter. 2015-04-07 Brady Eidson ContextMenuItem refactoring https://bugs.webkit.org/show_bug.cgi?id=143485 Reviewed by Beth Dakin. * Shared/mac/NativeContextMenuItem.mm: (WebKit::NativeContextMenuItem::NativeContextMenuItem): 2015-04-07 Simon Fraser Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2. https://bugs.webkit.org/show_bug.cgi?id=143495 Reviewed by Tim Horton. Exposed the antialiasedFontDilationEnabled setting via WK C SPI and Objective-C SPI. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAntialiasedFontDilationEnabled): (WKPreferencesGetAntialiasedFontDilationEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _antialiasedFontDilationEnabled]): (-[WKPreferences _setAntialiasedFontDilationEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2015-04-07 Beth Dakin Should only propagate pressure events with relevant phases https://bugs.webkit.org/show_bug.cgi?id=143494 -and corresponding- rdar://problem/20453738 Reviewed by Tim Horton. We only care about the changed, began, and ended phases. * UIProcess/API/mac/WKView.mm: (-[WKView pressureChangeWithEvent:]): 2015-04-07 Jer Noble Unreviewed build fix; make calls to new SPI conditional on iOS version. * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): 2015-04-06 Anders Carlsson Create the web inspector process pool lazily https://bugs.webkit.org/show_bug.cgi?id=143456 rdar://problem/20146520 Reviewed by Mark Lam. Add and implement WebInspectorProxy::isInspectorProcessPool instead of always creating the inspector process pool when trying to determine if a given process pool is the inspector process pool. This should speed up initialization somewhat and avoid creating a storage manager for example. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::inspectorProcessPool): (WebKit::WebInspectorProxy::isInspectorProcessPool): * UIProcess/WebInspectorProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getLaunchOptions): 2015-04-06 Brady Eidson Combine ActionMenuHitTestResult with WebHitTestResult https://bugs.webkit.org/show_bug.cgi?id=143444 Reviewed by Beth Dakin. * Shared/mac/ActionMenuHitTestResult.h: Removed. * Shared/mac/ActionMenuHitTestResult.mm: Removed. * Shared/WebHitTestResult.cpp: (WebKit::WebHitTestResult::Data::Data): (WebKit::WebHitTestResult::Data::encode): (WebKit::WebHitTestResult::Data::decode): (WebKit::WebHitTestResult::Data::platformEncode): (WebKit::WebHitTestResult::Data::platformDecode): * Shared/WebHitTestResult.h: * Shared/mac/WebHitTestResult.mm: Added. (WebKit::WebHitTestResult::Data::platformEncode): (WebKit::WebHitTestResult::Data::platformDecode): * UIProcess/API/mac/WKView.mm: (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]): (-[WKView _didPerformActionMenuHitTest:forImmediateAction:userData:]): Deleted. * UIProcess/API/mac/WKViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformActionMenuHitTest): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::didPerformActionMenuHitTest): * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController willDestroyView:]): (-[WKActionMenuController _clearActionMenuState]): (-[WKActionMenuController didPerformActionMenuHitTest:userData:]): (-[WKActionMenuController _hitTestResultDataImage]): (-[WKActionMenuController _defaultMenuItemsForImage]): (-[WKActionMenuController _copyImage:]): (-[WKActionMenuController _addImageToPhotos:]): (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]): (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]): (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]): (-[WKActionMenuController _webHitTestResult]): (-[WKActionMenuController _defaultMenuItems]): (-[WKActionMenuController _hitTestResultImage]): Deleted. * UIProcess/mac/WKImmediateActionController.h: * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController willDestroyView:]): (-[WKImmediateActionController _clearImmediateActionState]): (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]): (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]): (-[WKImmediateActionController _webHitTestResult]): (-[WKImmediateActionController _defaultAnimationController]): (-[WKImmediateActionController _updateImmediateActionItem]): (-[WKImmediateActionController _menuItemForDataDetectedText]): (-[WKImmediateActionController _animationControllerForText]): (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]): Deleted. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): 2015-04-06 Jer Noble Synchronize fullscreen animation between processes. https://bugs.webkit.org/show_bug.cgi?id=143131 Reviewed by Simon Fraser. Support synchronize resizing by animating within the UIProcess. Since setVideoLayerFrameFenced() is now only ever called from within a 0-duration transaction, make that the official contract of the function and wrap the WebProcess side of that method in its own 0-duration transaction. * Platform/spi/ios/BackBoardServicesSPI.h: Added. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WebVideoFullscreenManagerProxy.h: * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Remember the initial rect. (WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Added; simple getter. (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Use a different synchronization fence primative. Save the cached frame value. (WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Added; simple getter. (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity): Save the cached gravity value. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Wrap in a 0-length transaction. 2015-04-06 Chris Dumez [WK2][iOS] Regression(r182323): ASSERTION FAILED: WebCore::SQLiteDatabaseTracker::hasTransactionInProgress() in NetworkCache::Statistics::initialize() https://bugs.webkit.org/show_bug.cgi?id=143451 Reviewed by Anders Carlsson. Initialize WebProcess::m_webSQLiteDatabaseTracker and NetworkProcess::m_webSQLiteDatabaseTracker in their respective class constructors instead of doing it later in the initializeWebProcess() / initializeNetworkProcess() methods. If we do it later, it can happen that the tracker gets set after a SQLiteTransactionInProgressAutoCounter initialization and before the actual transaction. When this happens, the SQLiteTransactionInProgressAutoCounter variable fails to increment the transaction count. Then when the transaction is executed, SQLiteDatabaseTracker::hasTransactionInProgress() can return false. This would lead to possible assertions on start up on iOS. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::initializeConnection): * WebProcess/WebProcess.h: 2015-04-06 Beth Dakin https://trac.webkit.org/changeset/182338 introduced a build failure that I attempted to fix with https://trac.webkit.org/changeset/182341 , but that disabled the feature accidentally. This should do the right thing. * UIProcess/API/mac/WKView.mm: (-[WKView pressureChangeWithEvent:]): 2015-04-06 Commit Queue Unreviewed, rolling out r182296. https://bugs.webkit.org/show_bug.cgi?id=143448 This will disturb network cache efficacy logging, we should reland this later. (Requested by cdumez__ on #webkit). Reverted changeset: "[WK2][NetworkCache] Drop HTTP method from NetworkCache::Key" https://bugs.webkit.org/show_bug.cgi?id=143348 http://trac.webkit.org/changeset/182296 2015-04-06 Žan Doberšek [WK2] API::Array::copy() should move the resulting Vector<> of copies into the Array::create() call https://bugs.webkit.org/show_bug.cgi?id=143413 Reviewed by Darin Adler. Move the Vector<> object containing the copied elements into the Array::create() call, avoiding copying all the elements again. While here, change the Vector<> parameters for Array::create() and the Array constructor to rvalue references. This will ensure that the passed-in object is moved into the Array::create() call if possible, or explicitly copied otherwise. The constructor is moved into the header for inlining opportunities and the unnecessary parameter in the create(Vector<>&&) method declaration removed. * Shared/API/APIArray.cpp: (API::Array::create): (API::Array::copy): (API::Array::Array): Deleted. * Shared/API/APIArray.h: 2015-04-06 Žan Doberšek UserScript, UserStyleSheet constructors should take in Vector rvalues https://bugs.webkit.org/show_bug.cgi?id=143411 Reviewed by Darin Adler. Move the whitelist and blacklist Vector objects into the UserScript and UserStyleSheet constructors in ArgumentCoder::decode functions. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): 2015-04-05 Darin Adler [Mac] Spins seen in WKSetApplicationInformationItem, so it should not be called on the main thread https://bugs.webkit.org/show_bug.cgi?id=143423 rdar://problem/18773785 Reviewed by Alexey Proskuryakov. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::origin): Factored out this helper function from updateActivePages below, so the function below is easier to read. (WebKit::WebProcess::updateActivePages): Refactored to use the new origin function. Use dispatch_async to call WKSetApplicationInformationItem without blocking. 2015-04-05 Gyuyoung Kim Use constants of sqlite3 directly for status of SQL result in webdatabase https://bugs.webkit.org/show_bug.cgi?id=143329 Reviewed by Darin Adler. In webdatabase, it has used own constant variables as well as using sqlite3 constants directly. If sqlite3 constants are changed in the library, we should modify many files as well. Besides it can cause to use if~else statement which consumes more cpu cycles compared to switch~case. * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp: (WebKit::SQLiteIDBCursor::createSQLiteStatement): (WebKit::SQLiteIDBCursor::resetAndRebindStatement): (WebKit::SQLiteIDBCursor::bindArguments): (WebKit::SQLiteIDBCursor::internalAdvanceOnce): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::createOrMigrateRecordsTableIfNecessary): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::changeDatabaseVersion): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGeneratorNumber): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::uncheckedPutIndexRecord): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore): * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::executeSQLStatement): (WebKit::NetworkCache::Statistics::initialize): (WebKit::NetworkCache::Statistics::queryWasEverRequested): (WebKit::NetworkCache::Statistics::addHashesToDatabase): (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase): * UIProcess/Storage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::importItems): (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems): (WebKit::LocalStorageDatabase::databaseIsEmpty): * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases): (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers): (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier): (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier): (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier): * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp: (webkitSoupCookieJarSqliteLoad): (webkitSoupCookieJarSqliteInsertCookie): (webkitSoupCookieJarSqliteDeleteCookie): 2015-04-05 Simon Fraser Remove "go ahead and" from comments https://bugs.webkit.org/show_bug.cgi?id=143421 Reviewed by Darin Adler, Benjamin Poulain. Remove the phrase "go ahead and" from comments where it doesn't add anything (which is almost all of them). * Platform/unix/EnvironmentUtilities.cpp: (WebKit::EnvironmentUtilities::stripValuesEndingWithString): * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::didClose): * UIProcess/API/mac/WKView.mm: (-[WKView insertText:replacementRange:]): (-[WKView _pluginFocusOrWindowFocusChanged:pluginComplexTextInputIdentifier:]): * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier): 2015-04-05 Antti Koivisto Bloom filter should support longer hashes https://bugs.webkit.org/show_bug.cgi?id=143419 Reviewed by Dan Bernstein. Use the hash digest directly in the contents filter instead of going via shortHash. * NetworkProcess/cache/NetworkCacheKey.h: (WebKit::NetworkCache::Key::hash): (WebKit::NetworkCache::Key::shortHash): Deleted. (WebKit::NetworkCache::Key::toShortHash): Deleted. No longer needed. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::synchronize): (WebKit::NetworkCache::Storage::addToContentsFilter): (WebKit::NetworkCache::Storage::mayContain): * NetworkProcess/cache/NetworkCacheStorage.h: 2015-04-05 Antti Koivisto Network cache Bloom filter is too big https://bugs.webkit.org/show_bug.cgi?id=143400 Follow-up: Fix an ineffective assert. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::setMaximumSize): Average resource size is closer to 50KB than 50MB. 2015-04-05 Antti Koivisto Rename Cache::setMaximumSize to setCapacity https://bugs.webkit.org/show_bug.cgi?id=143418 Reviewed by Dan Bernstein. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::setCapacity): (WebKit::NetworkCache::Cache::setMaximumSize): Deleted. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::retrieve): (WebKit::NetworkCache::Storage::store): (WebKit::NetworkCache::Storage::update): (WebKit::NetworkCache::Storage::setCapacity): (WebKit::NetworkCache::Storage::shrinkIfNeeded): (WebKit::NetworkCache::Storage::shrink): (WebKit::NetworkCache::Storage::setMaximumSize): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformSetCacheModel): 2015-04-04 Antti Koivisto Network cache Bloom filter is too big https://bugs.webkit.org/show_bug.cgi?id=143400 Reviewed by Chris Dumez. It is currently 1MB. This patch switches the cache from a counting filter (CountingBloomFilter) to a bit filter (BloomFilter). It also reduces the filter size from 2^20 to 2^18 elements which is good for ~26000 cache entries while still keeping false positive rate below 1%. The current cache capacity allows around 4000 entries with typical web contents. The new filter size is 32KB. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::synchronize): Turn initialization function into general purpose synchronization function. (WebKit::NetworkCache::Storage::addToContentsFilter): Collect newly added hashes so we don't miss entries that were added during synchronization. (WebKit::NetworkCache::Storage::mayContain): (WebKit::NetworkCache::Storage::remove): (WebKit::NetworkCache::Storage::retrieve): (WebKit::NetworkCache::Storage::store): (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations): (WebKit::NetworkCache::Storage::dispatchFullWriteOperation): (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation): (WebKit::NetworkCache::Storage::setMaximumSize): (WebKit::NetworkCache::Storage::clear): (WebKit::NetworkCache::Storage::shrinkIfNeeded): (WebKit::NetworkCache::Storage::shrink): Non-counting Bloom filter does not support removals so this requires a new strategy. Shrink code now simply deletes entries. The filter is updated by calling synchronize() at the end. While we could synchronize the filter during traversal it is better to just have one function for that. (WebKit::NetworkCache::Storage::initialize): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::mayContain): (WebKit::NetworkCache::Storage::cacheMayContain): Deleted. 2015-04-04 Andy Estes [Content Filtering] Blocked page is not always displayed when it should be https://bugs.webkit.org/show_bug.cgi?id=143410 Reviewed by Andreas Kling. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): Stopped clearing m_contentFilterUnblockHandler here. (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Started doing it here instead. 2015-04-04 Chris Dumez [WK2][Cocoa] Add a way to temporarily disable the WebKit Network Cache for testing https://bugs.webkit.org/show_bug.cgi?id=143392 Reviewed by Antti Koivisto. Add a way to temporarily disable the WebKit Network Cache for testing. It will be used temporarily for comparing page load times with and without the WebKit network disk cache enabled. This is in addition to the existing "WebKitNetworkCacheEnabled" NSUserDefaults: webkitNetworkCacheIsEnabled = [defaults boolForKey:WebKitNetworkCacheEnabledDefaultsKey] && ![defaults boolForKey:WebKitNetworkCacheTemporarilyDisabledForTestingKey]; * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2015-04-04 Simon Fraser REGRESSION (r182215): Feedly crashes when closing article https://bugs.webkit.org/show_bug.cgi?id=143405 rdar://problem/20382734, rdar://problem/20395497 Reviewed by Tim Horton. Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go is bad, because it can cause FrameView::layout() to get called in the middle of RenderObject destruction, which leaves the render tree in a bad state. Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit. AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets a flag to say that the non-fast region needs to be recomputed, and that schedules a scrolling tree commit. When the commit happens, we recompute the region. If the region didn't change, and no other changes are pending, there's no need to commit. * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: (WebKit::RemoteScrollingCoordinator::buildTransaction): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Outdent #ifdefs. 2015-04-03 Beth Dakin Attempted build fix. * UIProcess/API/mac/WKView.mm: 2015-04-03 Simon Fraser Fix the firing of the ReachedSessionRestorationRenderTreeSizeThreshold milestone on iOS https://bugs.webkit.org/show_bug.cgi?id=143394 Reviewed by Tim Horton. A client reshuffle at some point broke the dispatch of the ReachedSessionRestorationRenderTreeSizeThreshold milestone. Fix by using WebPageProxy::didLayout() to fire the milestone. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didCommitLayerTree): 2015-04-03 Beth Dakin https://bugs.webkit.org/show_bug.cgi?id=143387 Improvements to webkitmouseforce web API -and corresponding- rdar://problem/20281808 rdar://problem/20281853 Reviewed by Darin Adler. This patch: 1. Dispatches webkitmouseforceup and webkitmouseforceclick at the right time. 2. Dispatches webkitmouseforcechanged from mousedown all the way through through mouseup. 3. Uses force values from pressureChangeWithEvent instead of the immediate action gesture recognizer. Listen for this NSResponder method, and pass the relevant info to WebPageProxy to dispatch to the web process. * UIProcess/API/mac/WKView.mm: (-[WKView pressureChangeWithEvent:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::inputDeviceForceDidChange): (WebKit::WebPageProxy::immediateActionDidUpdate): * UIProcess/WebPageProxy.h: The web process still needs to know when the immediate action gesture recognizer is updating, but it doesn’t need the force information. That will come from pressureChangeWithEvent. * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]): Cache m_lastForceStage so that we can determine if we are transitioning to a new stage. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: New message for InputDeviceForceDidChange and modified message for ImmediateActionDidUpdate * WebProcess/WebPage/WebPage.messages.in: inputDeviceForceDidChange now takes care of dispatching mouseforcechanged, mouseforcedown, mouseforceup, and mouseforceclick. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::inputDeviceForceDidChange): We still need to keep track of the ImmediateActionStages in WebCore::EventHandler so that we can have the right default behavior on mouseup based on whether or not that action began and was completed. (In other words, to ensure we don’t navigate to a link after force clicking it.) (WebKit::WebPage::immediateActionDidUpdate): (WebKit::WebPage::immediateActionDidComplete): 2015-04-03 Said Abou-Hallawa InjectedBundleNodeHandle::renderedImage() needs to be exposed from the Cocoa WebAPI layer. https://bugs.webkit.org/show_bug.cgi?id=143341. Reviewed by Anders Carlsson. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Expose rendered image injected bundle API from the Cocoa layer. A node in the page can be rendered to an NSImage on MacOS and to a UIImage on iOS. 2015-04-03 Chris Dumez [WK2][iOS] We should prevent NetworkProcess suspension while it has pending SQL transactions https://bugs.webkit.org/show_bug.cgi?id=143278 Reviewed by Anders Carlsson. Prevent NetworkProcess suspension while it has pending SQL transactions, similarly to what we already did for WebProcesses. This patch moves the WebSQLiteDatabaseTracker from WebProcess/ to Shared/ and make it usable by the NetworkProcess class as well. Whenever there are locked files to due SQL transactions, the NetworkProcess will send an IPC message to the NetworkProcessProxy which will hold a background process assertion until the NetworkProcess' SQL transactions are complete. This way, it is no longer possible for the NetworkProcess to get suspended while SQL transactions are running and a database file is locked. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: * Shared/WebSQLiteDatabaseTracker.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp. (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker): (WebKit::m_childProcessType): (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction): (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction): (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated): * Shared/WebSQLiteDatabaseTracker.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didClose): (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::initializeConnection): * WebProcess/WebProcess.h: 2015-04-03 Antti Koivisto Add non-counting Bloom filter implementation https://bugs.webkit.org/show_bug.cgi?id=143366 Reviewed by Sam Weinig. * NetworkProcess/cache/NetworkCacheStorage.h: 2015-04-03 Zan Dobersek Fix the EFL and GTK build after r182243 https://bugs.webkit.org/show_bug.cgi?id=143361 Reviewed by Csaba Osztrogonác. * PlatformGTK.cmake: Add a custom command that copies the InspectorBackendCommands.js file into the proper directory under DerivedSources/WebInspectorUI/. 2015-04-03 Philippe Normand Unreviewed, GTK build fix. * UIProcess/API/gtk/WebKitContextMenuClient.cpp: * UIProcess/gtk/WebContextMenuProxyGtk.cpp: * UIProcess/gtk/WebContextMenuProxyGtk.h: 2015-04-02 Csaba Osztrogonác Typo fix. * PlatformGTK.cmake: 2015-04-02 Csaba Osztrogonác URTBF after r182303, stub NativeContextMenuItem implemetations added for EFL and GTK. * PlatformEfl.cmake: * PlatformGTK.cmake: * Shared/efl/NativeContextMenuItemEfl.cpp: Added. (WebKit::NativeContextMenuItem::NativeContextMenuItem): * Shared/gtk/NativeContextMenuItemGtk.cpp: Added. (WebKit::NativeContextMenuItem::NativeContextMenuItem): 2015-04-02 Timothy Horton De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort https://bugs.webkit.org/show_bug.cgi?id=143342 * Platform/mac/LayerHostingContext.h: * Platform/mac/LayerHostingContext.mm: Actually, not available on Mavericks. Fix the build. 2015-04-02 Brady Eidson Unreviewed: Re-applied change after rollout. Expose the "Share" menu for text selections on platforms where it's available. rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318 * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu. * Shared/API/c/WKSharedAPICast.h: (WebKit::toAPI): (WebKit::toImpl): * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::encode): (WebKit::ContextMenuContextData::decode): * Shared/ContextMenuContextData.h: (WebKit::ContextMenuContextData::selectedText): Add a "cross platform" menu item wrapper, right now only for NSMenuItem. * Shared/NativeContextMenuItem.h: (WebKit::NativeContextMenuItem::~NativeContextMenuItem): (WebKit::NativeContextMenuItem::nsMenuItem): * Shared/mac/NativeContextMenuItem.mm: (WebKit::NativeContextMenuItem::NativeContextMenuItem): Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform. * Shared/WebContextMenuItem.cpp: (WebKit::WebContextMenuItem::WebContextMenuItem): * Shared/WebContextMenuItem.h: (WebKit::WebContextMenuItem::create): (WebKit::WebContextMenuItem::nativeContextMenuItem): * UIProcess/API/APIContextMenuClient.h: (API::ContextMenuClient::getContextMenuFromProposedMenu): (API::ContextMenuClient::showContextMenu): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageContextMenuClient): * UIProcess/WebContextMenuProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem can be attached to them. * UIProcess/mac/WebContextMenuProxyMac.h: * UIProcess/mac/WebContextMenuProxyMac.mm: (-[WKMenuTarget forwardContextMenuAction:]): (WebKit::nsMenuItem): (WebKit::nsMenuItemVector): (WebKit::WebContextMenuProxyMac::populate): (WebKit::WebContextMenuProxyMac::showContextMenu): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebContextMenuClient.h: * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the context menu with a placeholder item. It will be translated into the real Share menu in the UI process. 2015-04-02 Commit Queue Unreviewed, rolling out r182293. https://bugs.webkit.org/show_bug.cgi?id=143355 Broke GTK and EFL builds. (Requested by bfulgham on #webkit). Reverted changeset: "Expose the "Share" menu for text selections on platforms where it's available." https://bugs.webkit.org/show_bug.cgi?id=143318 http://trac.webkit.org/changeset/182293 2015-04-02 Chris Dumez [WK2][NetworkCache] Drop HTTP method from NetworkCache::Key https://bugs.webkit.org/show_bug.cgi?id=143348 Reviewed by Antti Koivisto. Drop HTTP method from NetworkCache::Key as we only cache GET responses for now. Even when we start caching HEAD responses, we likely will not want the method to be part of the key because: - A HEAD response can be used to update the headers of a previously cached response to GET - A cached GET response may be used to satisfy subsequent HEAD requests * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeCacheKey): * NetworkProcess/cache/NetworkCacheKey.cpp: (WebKit::NetworkCache::Key::Key): (WebKit::NetworkCache::Key::operator=): (WebKit::NetworkCache::Key::computeHash): (WebKit::NetworkCache::Key::operator==): (WebKit::NetworkCache::Key::encode): (WebKit::NetworkCache::Key::decode): * NetworkProcess/cache/NetworkCacheKey.h: (WebKit::NetworkCache::Key::method): Deleted. 2015-04-02 Jer Noble [Mac][WK2] Fullscreen animation incorrect when initiated on non-primary monitor https://bugs.webkit.org/show_bug.cgi?id=143237 Reviewed by Brent Fulgham. The animation calculations have an implicit assumptions of a screen whose origin is 0,0. Account for the screen origin by passing the window's screen's frame into the zoomAnimation() and maskAnimation() methods. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController initWithWindow:webView:]): (zoomAnimation): (maskAnimation): (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): 2015-04-02 Brady Eidson Expose the "Share" menu for text selections on platforms where it's available. rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318 Reviewed by Sam Weinig. * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu. * Shared/API/c/WKSharedAPICast.h: (WebKit::toAPI): (WebKit::toImpl): * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::encode): (WebKit::ContextMenuContextData::decode): * Shared/ContextMenuContextData.h: (WebKit::ContextMenuContextData::selectedText): Add a "cross platform" menu item wrapper, right now only for NSMenuItem. * Shared/NativeContextMenuItem.h: (WebKit::NativeContextMenuItem::~NativeContextMenuItem): (WebKit::NativeContextMenuItem::nsMenuItem): * Shared/mac/NativeContextMenuItem.mm: (WebKit::NativeContextMenuItem::NativeContextMenuItem): Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform. * Shared/WebContextMenuItem.cpp: (WebKit::WebContextMenuItem::WebContextMenuItem): * Shared/WebContextMenuItem.h: (WebKit::WebContextMenuItem::create): (WebKit::WebContextMenuItem::nativeContextMenuItem): * UIProcess/API/APIContextMenuClient.h: (API::ContextMenuClient::getContextMenuFromProposedMenu): (API::ContextMenuClient::showContextMenu): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageContextMenuClient): * UIProcess/WebContextMenuProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem can be attached to them. * UIProcess/mac/WebContextMenuProxyMac.h: * UIProcess/mac/WebContextMenuProxyMac.mm: (-[WKMenuTarget forwardContextMenuAction:]): (WebKit::nsMenuItem): (WebKit::nsMenuItemVector): (WebKit::WebContextMenuProxyMac::populate): (WebKit::WebContextMenuProxyMac::showContextMenu): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebContextMenuClient.h: * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the context menu with a placeholder item. It will be translated into the real Share menu in the UI process. 2015-04-02 Timothy Horton De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort https://bugs.webkit.org/show_bug.cgi?id=143342 Reviewed by Myles C. Maxfield. * Platform/mac/LayerHostingContext.h: * Platform/mac/LayerHostingContext.mm: (WebKit::LayerHostingContext::setFencePort): There's nothing iOS specific about this. 2015-04-02 Oliver Hunt Ensure that we always set network ATS context in the network process https://bugs.webkit.org/show_bug.cgi?id=143343 Reviewed by Dan Bernstein. If a custom cache location or size we were early returning before setting the CFNetwork ATS context. This is clearly an error. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): 2015-04-02 Alexey Proskuryakov Make checkURLReceivedFromWebProcess not rely on details of platform URL implementation. https://bugs.webkit.org/show_bug.cgi?id=143222 rdar://problem/19978997 Reviewed by Sam Weinig. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess): 2015-04-02 Yusuke Suzuki Clean up EnumerationMode to easily extend https://bugs.webkit.org/show_bug.cgi?id=143276 Reviewed by Geoffrey Garen. Use default EnumerationMode(). * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::enumerate): 2015-04-02 Chris Dumez [WK2][iOS] Update the WebContent process' sandbox profile for AWD https://bugs.webkit.org/show_bug.cgi?id=143340 Reviewed by Alexey Proskuryakov. Update the WebContent process' sandbox profile for AWD. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2015-04-01 Antti Koivisto Use std::chrono types to represent time in response and cache classes https://bugs.webkit.org/show_bug.cgi?id=143316 Reviewed by Andreas Kling. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFinishLoading): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::responseHasExpired): (WebKit::NetworkCache::responseNeedsRevalidation): (WebKit::NetworkCache::makeStoreDecision): (WebKit::NetworkCache::Cache::store): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::Entry): (WebKit::NetworkCache::Entry::asJSON): * NetworkProcess/cache/NetworkCacheEntry.h: (WebKit::NetworkCache::Entry::timeStamp): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::decodeRecordMetaData): (WebKit::NetworkCache::decodeRecord): Sanity check the timestamp on decode. (WebKit::NetworkCache::encodeRecordMetaData): (WebKit::NetworkCache::encodeRecordHeader): (WebKit::NetworkCache::Storage::traverse): * NetworkProcess/cache/NetworkCacheStorage.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::lastModifiedDateMS): (WebKit::PluginView::Stream::didReceiveResponse): (WebKit::PluginView::manualLoadDidReceiveResponse): (WebKit::lastModifiedDate): Deleted. 2015-04-01 Chris Dumez [WK2][Cocoa] Add didFailProvisionalLoadWithErrorForFrame callback to WKWebProcessPlugInLoadDelegate https://bugs.webkit.org/show_bug.cgi?id=143319 Reviewed by Dan Bernstein. Add didFailProvisionalLoadWithErrorForFrame callback to WKWebProcessPlugInLoadDelegate so that the client side can track all types page load completions: - didFailProvisionalLoadWithErrorForFrame - didFailLoadWithErrorForFrame - didFinishLoadForFrame Note that this event is already exposed on UIProcess side via the WKPageLoaderClient.didFailLoadWithErrorForFrame callback. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (didFailProvisionalLoadWithErrorForFrame): (setUpPageLoaderClient): 2015-04-01 Enrica Casucci Injected bundle messages should be at the page level. https://bugs.webkit.org/show_bug.cgi?id=143283 Reviewed by Alexey Proskuryakov. All the messages between the injected bundle and the UI process should be page level messages instead of context. The author of this patch is Tim Horton, I just finished it. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageInjectedBundleClient): * UIProcess/API/C/WKPage.h: * UIProcess/API/C/WKPageInjectedBundleClient.h: Added. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pageForTesting]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/WebPageInjectedBundleClient.cpp: Added. (WebKit::WebPageInjectedBundleClient::didReceiveMessageFromInjectedBundle): (WebKit::WebPageInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle): * UIProcess/WebPageInjectedBundleClient.h: Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setInjectedBundleClient): (WebKit::WebPageProxy::handleMessage): (WebKit::WebPageProxy::handleSynchronousMessage): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::injectedBundleClient): * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::handleMessage): * WebKit2.xcodeproj/project.pbxproj: * CMakeLists.txt: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePagePostMessage): (WKBundlePagePostSynchronousMessage): * WebProcess/InjectedBundle/API/c/WKBundlePage.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::postMessage): (WebKit::WebPage::postSynchronousMessage): * WebProcess/WebPage/WebPage.h: 2015-04-01 Alexey Proskuryakov [iOS] WebContent should have access to the entirety of its caches directory https://bugs.webkit.org/show_bug.cgi?id=143312 rdar://problem/20314916 Reviewed by Oliver Hunt. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/Network/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * Shared/Network/NetworkProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::networkingCachesDirectory): (WebKit::WebProcessPool::webContentCachesDirectory): (WebKit::WebProcessPool::openGLCacheDirectory): Deleted. (WebKit::WebProcessPool::networkingHSTSDatabasePath): Deleted. (WebKit::WebProcessPool::webContentHSTSDatabasePath): Deleted. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::createNewWebProcess): * UIProcess/WebProcessPool.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2015-04-01 Timothy Horton Smart magnification gesture sometimes shoots to the middle of the page https://bugs.webkit.org/show_bug.cgi?id=143296 Reviewed by Dean Jackson. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture): Constrain the target rect to the viewport, and if it had overflowed the viewport, scroll halfway towards the gesture origin. 2015-03-31 Simon Fraser Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers https://bugs.webkit.org/show_bug.cgi?id=143288 rdar://problem/16049624 Reviewed by Beth Dakin. Remove the wheel event counting that Document does, and passes into the scrolling tree. The ScrollingTree now just uses the non-fast scrollable region to determine when to fast scroll on pages with wheel event handlers. If a handler includes position:fixed renderers, we just cover the whole document with the slow-scrolling region currently. This could be improved. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): (WebKit::RemoteScrollingTreeTextStream::dump): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::wheelEventHandlersChanged): (WebKit::WebChromeClient::numWheelEventHandlersChanged): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::wheelEventHandlersChanged): (WebKit::WebPage::recomputeShortCircuitHorizontalWheelEventsState): (WebKit::WebPage::numWheelEventHandlersChanged): Deleted. * WebProcess/WebPage/WebPage.h: 2015-03-31 Dan Bernstein [iOS] Include Add to Reading List link action only where supported https://bugs.webkit.org/show_bug.cgi?id=143289 Reviewed by Tim Horton. * UIProcess/API/Cocoa/_WKElementAction.h: Excluded _WKElementActionTypeAddToReadingList from the _WKElementActionType enum when Reading List is not supported. * UIProcess/API/Cocoa/_WKElementAction.mm: (+[_WKElementAction elementActionWithType:customTitle:]): Made Add to Reading List code conditional on HAVE(SAFARI_SERVICES_FRAMEWORK). * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant showImageSheet]): Ditto. (-[WKActionSheetAssistant showLinkSheet]): Ditto. * config.h: Defined HAVE_SAFARI_SERVICES_FRAMEWORK. 2015-03-31 Timothy Horton TextIndicator for inside an only highlights the , should highlight the whole https://bugs.webkit.org/show_bug.cgi?id=143287 Reviewed by Beth Dakin. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): Instead of just highlighting the hit element, highlight the whole element that the link URL comes from. 2015-03-31 Timothy Horton WKView should stop using endGestureWithEvent https://bugs.webkit.org/show_bug.cgi?id=143285 Reviewed by Simon Fraser. * UIProcess/API/mac/WKView.mm: (-[WKView magnifyWithEvent:]): (-[WKView endGestureWithEvent:]): Deleted. * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::endMagnificationGesture): (WebKit::ViewGestureController::endActiveGesture): Deleted. While there is no visible symptom, it is recommended that we check the phase of normal magnification events instead of using the special gesture end events. 2015-03-31 Timothy Horton Swipes occur in the wrong direction in RTL https://bugs.webkit.org/show_bug.cgi?id=143257 Reviewed by Simon Fraser. * UIProcess/ios/ViewGestureControllerIOS.mm: (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]): When choosing which edge to attach our gesture recognizers to, flip them in RTL. (-[WKSwipeTransitionController directionForTransition:]): (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::canSwipeInDirection): * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::scrollEventCanBecomeSwipe): (WebKit::ViewGestureController::trackSwipeGesture): (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent): (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::handleSwipeGesture): Adjust SwipeDirection to be in logical back-forward list direction instead of physical edge direction. 2015-03-31 Myles C. Maxfield Move ExpansionBehaviorFlags and TextDirection to their own file https://bugs.webkit.org/show_bug.cgi?id=143273 Reviewed by Simon Fraser. This is a mechanical change. It just moves code around. This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608 * Shared/WebPopupItem.h: * UIProcess/API/C/efl/WKAPICastEfl.h: * UIProcess/API/efl/EwkView.h: * UIProcess/WebPopupMenuProxy.h: * UIProcess/efl/WebUIPopupMenuClient.h: 2015-03-31 Yusuke Suzuki Clean up Identifier factories to clarify the meaning of StringImpl* https://bugs.webkit.org/show_bug.cgi?id=143146 Reviewed by Filip Pizlo. Just change to Identifier::fromString. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::getOwnPropertyNames): * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::identifierFromIdentifierRep): 2015-03-31 Timothy Horton WebKit briefly shows wrong webpage after swiping back (gigaom.com, or any site on a slow network) https://bugs.webkit.org/show_bug.cgi?id=143256 Reviewed by Dan Bernstein. Instead of allowing a flash of the previous page when the swipe snapshot timeouts fire (removing the snapshot before the new page is loaded), show the snapshotted background color. This fixes the problem on iOS, where UI-side compositing makes it easy to fix, but not yet on OS X. * UIProcess/API/Cocoa/WKWebView.mm: (baseScrollViewBackgroundColor): (scrollViewBackgroundColor): If the ViewGestureController returns a valid background color, use that instead of the page's background color. * UIProcess/API/Cocoa/WKWebViewInternal.h: Expose _updateScrollViewBackground. * UIProcess/PageClient.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeBackgroundColor): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::didChangeBackgroundColor): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeBackgroundColor): * UIProcess/WebPageProxy.h: Add and plumb didChangeBackgroundColor, which calls _updateScrollViewBackground on iOS. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::endSwipeGesture): Hide the content of the drawing area until the next commit. This way, even if the snapshot is removed (say, because a timeout fired), we won't ever show the old page content (but we will show background color). Store the background color associated with the current snapshot. Let WKWebView know that it needs to recompute the background color. (WebKit::ViewGestureController::removeSwipeSnapshot): Clear the background color so that the next time we commit, WKWebView will get an invalid color from ViewGestureController and fall back to the page's extended background color instead. * UIProcess/mac/ViewGestureController.h: (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): Keep backgroundColorForCurrentSnapshot up to date on Mac too, even though we don't use it yet. 2015-03-31 Timothy Horton [iOS] Rotating PDF in Safari scrolls to the wrong position https://bugs.webkit.org/show_bug.cgi?id=143259 Reviewed by Dan Bernstein. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView web_setMinimumSize:]): Maintan the relative top/left within the rescaled document. 2015-03-31 Chris Dumez [WK2][iOS] Extend ProcessThrottler use to the NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=143249 Reviewed by Gavin Barraclough. Extend ProcessThrottler use to the NetworkProcess instead of only the WebProcesses. This is needed so that the NetworkProcess gets notified before suspension. We now use this notification to free-up memory before suspending by calling the critical memory pressure handler, as we already do for WebProcesses (rdar://problem/20231539). In the future, this infrastructure will be used to delay suspension until the pending SQL transactions are done as well (rdar://problem/20180799). Previously, the NetworkProcessProxy would hold a foreground assertion on behalf of the NetworkProcess but would never release that assertion. In this patch, we change this so that WebProcessProxies hold assertions on behalf of the NetworkProcess, and release those assertions before suspending. As a result, the NetworkProcess gets suspended when all WebProcesses are suspended. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::processWillSuspend): (WebKit::NetworkProcess::cancelProcessWillSuspend): (WebKit::NetworkProcess::processDidResume): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): (WebKit::NetworkProcessProxy::didFinishLaunching): (WebKit::NetworkProcessProxy::sendProcessWillSuspend): (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend): (WebKit::NetworkProcessProxy::didCancelProcessSuspension): (WebKit::NetworkProcessProxy::sendProcessDidResume): (WebKit::NetworkProcessProxy::processReadyToSuspend): * UIProcess/Network/NetworkProcessProxy.h: (WebKit::NetworkProcessProxy::throttler): * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::ProcessThrottler): (WebKit::ProcessThrottler::didConnectToProcess): (WebKit::ProcessThrottler::didConnnectToProcess): Deleted. * UIProcess/ProcessThrottler.h: * UIProcess/ProcessThrottlerClient.h: Added. (WebKit::ProcessThrottlerClient::~ProcessThrottlerClient): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken): (WebKit::WebProcessProxy::sendProcessDidResume): (WebKit::WebProcessProxy::processReadyToSuspend): * UIProcess/WebProcessProxy.h: * WebKit2.xcodeproj/project.pbxproj: 2015-03-31 Csaba Osztrogonác Unreviewed, revert accidental change by r182138. * Scripts/generate-forwarding-headers.pl: (createForwardingHeadersForFramework): 2015-03-31 Carlos Garcia Campos Unreviewed. Fix GTK+ build with REDIRECTED_XCOMPOSITE_WINDOW disabled in X11 platform. Also fix some unused parameter warnings when REDIRECTED_XCOMPOSITE_WINDOW is disabled. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewRenderAcceleratedCompositingResults): (resizeWebKitWebViewBaseFromAllocation): 2015-03-31 Carlos Garcia Campos [GTK] DnD icon/widget has odd background https://bugs.webkit.org/show_bug.cgi?id=143217 Reviewed by Martin Robinson. Use gtk_drag_set_icon_surface() to set the drag icon image, instead of DragIcon class. * UIProcess/API/gtk/WebKitWebView.cpp: * UIProcess/gtk/DragAndDropHandler.cpp: (WebKit::DragAndDropHandler::startDrag): * UIProcess/gtk/DragAndDropHandler.h: 2015-03-30 Commit Queue Unreviewed, rolling out r182172. https://bugs.webkit.org/show_bug.cgi?id=143250 Since this class is an API object, we don't know for sure when it will be destroyed. (Requested by kling on #webkit). Reverted changeset: "WebBackForwardList doesn't need to manually clear the snapshot of an entry when removing it." https://bugs.webkit.org/show_bug.cgi?id=143231 http://trac.webkit.org/changeset/182172 2015-03-30 Andreas Kling WebBackForwardList doesn't need to manually clear the snapshot of an entry when removing it. Reviewed by Tim Horton. Now that we don't keep WebBackForwardListItem objects alive forever, it's not necessary to clear the snapshot when removing them from the WebBackForwardList, since the entire object will be deleted shortly after that anyway. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::didRemoveItem): 2015-03-30 Enrica Casucci [iOS] WebContent crashing at WebCore: WebCore::Range::collectSelectionRects. https://bugs.webkit.org/show_bug.cgi?id=143234 Reviewed by Tim Horton. This is a speculative fix that adds a null check before referencing the range. In both places where the check has been added the range returned by the call that should create it could be null. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState): 2015-03-30 Sam Weinig [Content Extensions] Flesh out the UserContentExtensionStore https://bugs.webkit.org/show_bug.cgi?id=143123 Reviewed by Benjamin Poulain. * Shared/WebCompiledContentExtension.cpp: (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData): * Shared/WebCompiledContentExtensionData.cpp: (WebKit::WebCompiledContentExtensionData::encode): (WebKit::WebCompiledContentExtensionData::decode): * Shared/WebCompiledContentExtensionData.h: (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData): Switch the order in memory of actions and bytecode (and switch the order of the variables as well, to keep it clear). This will become necessary when streaming the data to disk, as actions are created before the bytecode and we would have to keep them in memory until the bytecode was finished compiling if they didn't come before in the file. * UIProcess/API/APIUserContentExtensionStore.h: * UIProcess/API/APIUserContentExtensionStore.cpp: (API::UserContentExtensionStore::defaultStore): Add accessor for the processes default shared store. (API::constructedPath): Helper for constructing the path to a file in the store based on identifier. (API::encodeContentExtensionMetaData): (API::decodeContentExtensionMetaData): Helpers for encoding/decoding the file metadata (version, bytecode size, actions size). (API::openAndMapContentExtension): Helper to open and map a filed back content extension. (API::writeDataToFile): Helper to write a Data object to a file. (API::compiledToFile): Helper to run the content extension compiler and write it to disk. It first writes it to a temporary file and then does an atomic rename operation to put the file in the final location. Doing this means that if the process crashes while the compile is taking place, the partially written file won't end up in the cache, but rather, will be cleaned up by the OS. (API::UserContentExtensionStore::lookupContentExtension): API entry point to lookup an extension that has been compiled to disk. On a background queue, it attempts to open and map the extension (based on the identifier passed in) and return it to the caller via the callback function passed in. (API::UserContentExtensionStore::compileContentExtension): API entry point to compile an extension and write it to store. On a background queue, it compiles the file to disk and if successful, returns the memory mapped data via the callback function passed in. (API::UserContentExtensionStore::removeContentExtension): API entry point to remove an extension from the store. On a background queue, it unlinks the extension (based on the identifier passed in) and tells the caller it completed the action vial the callback function passed in. (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions): Helper for testing which synchronously unlinks all the files in the store. (API::userContentExtensionStoreErrorCategory): std::error_code adaptor for some generic errors that can happen in the store. We will want to flesh these out further. * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm: Added. (API::UserContentExtensionStore::defaultStorePath): Helper to get the platform specific path for the store. * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: (WKUserContentExtensionStoreGetTypeID): Add ENABLE(CONTENT_EXTENSIONS) guards. * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm: (-[_WKUserContentExtensionStore dealloc]): (+[_WKUserContentExtensionStore defaultStore]): (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]): (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): (-[_WKUserContentExtensionStore _removeAllContentExtensions]): (-[_WKUserContentExtensionStore init]): Deleted. * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: Added. SPI wrappers for the store. * WebKit2.xcodeproj/project.pbxproj: Add new files. 2015-03-30 Antti Koivisto Don't cache resources that are very unlikely to be reused https://bugs.webkit.org/show_bug.cgi?id=143226 Reviewed by Chris Dumez. Follow-up to cover Cache-control: no-cache case which also has zero cache lifetime. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeStoreDecision): 2015-03-30 Antti Koivisto Include cache entry worth to json dump https://bugs.webkit.org/show_bug.cgi?id=143202 Follow-up fix. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::computeRecordWorth): This accidentally gave the error case worth 1 rather than 0 as it should be. 2015-03-30 Antti Koivisto Don't cache resources that are very unlikely to be reused https://bugs.webkit.org/show_bug.cgi?id=143226 Reviewed by Geoff Garen. We are writing lots of resources to the cache that are never used again. In browse-around-randomly test this reduced number of cache entries created by ~20% and bytes written by ~5%. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeUseDecision): (WebKit::NetworkCache::makeRetrieveDecision): Rename for clarity. (WebKit::NetworkCache::makeStoreDecision): Store only if the resource has non-zero expiration or has validation headers. Very High priority resources (main resources) keep the existing policy to minimize impact on back navigation and tab restore. (WebKit::NetworkCache::Cache::retrieve): (WebKit::NetworkCache::Cache::store): (WebKit::NetworkCache::canUse): Deleted. (WebKit::NetworkCache::canRetrieve): Deleted. (WebKit::NetworkCache::canStore): Deleted. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::storeDecisionToDiagnosticKey): 2015-03-30 Tim Horton Swipe snapshot removed too early (jumps around) on arstechnica and NYT https://bugs.webkit.org/show_bug.cgi?id=143199 Reviewed by Dan Bernstein. Make ViewGestureControllerIOS's snapshot removal timing behave more like the Mac version. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): Let ViewGestureController know when the page has finished state restoration. (-[WKWebView _didFinishLoadForMainFrame]): (-[WKWebView _didSameDocumentNavigationForMainFrame:]): Forward these to ViewGestureController. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didFinishLoadForMainFrame): Forward didFinishLoadForMainFrame to WKWebView. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::endSwipeGesture): Split the swipe snapshot removal state into a bunch of bools. (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree): (WebKit::ViewGestureController::setRenderTreeSize): (WebKit::ViewGestureController::removeSwipeSnapshotIfReady): (WebKit::ViewGestureController::removeSwipeSnapshot): Unify the snapshot removal logic into one function; removeSwipeSnapshotIfReady completely owns the decision. For now, we're waiting for everything, but we can do better in the future (using firstVisuallyNonEmptyLayout like Mac used to). (WebKit::ViewGestureController::didRestoreScrollPosition): (WebKit::ViewGestureController::didFinishLoadForMainFrame): (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame): (WebKit::ViewGestureController::activeLoadMonitoringTimerFired): Add more conditions for swipe snapshot removal. We'll now wait for didFinishLoadForMainFrame (or didSameDocumentNavigationForMainFrame), for active loads to finish, and for the scroll position to be restored. This brings the iOS implementation in line with the slightly better Mac implementation, and also sets the stage for deduplication of all of this code. * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::ViewGestureController): 2015-03-30 Chris Dumez [WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header https://bugs.webkit.org/show_bug.cgi?id=143159 Reviewed by Antti Koivisto. Add support for "Cache-Control: max-stale" request header: https://tools.ietf.org/html/rfc7234#section-5.2.1.2 * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::responseHasExpired): (WebKit::NetworkCache::requestRequiresRevalidation): (WebKit::NetworkCache::canUse): 2015-03-30 Csaba Osztrogonác [EFL][GTK] WebKit2's generate-forwarding-headers.pl should fail if clashing headers found https://bugs.webkit.org/show_bug.cgi?id=142909 Reviewed by Philippe Normand. * Scripts/generate-forwarding-headers.pl: (createForwardingHeadersForFramework): 2015-03-29 Antti Koivisto Include cache entry worth to json dump https://bugs.webkit.org/show_bug.cgi?id=143202 Reviewed by Darin Adler. This is useful for analyzing cache performance. Also include the body size, total item count and average worth. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::traverse): (WebKit::NetworkCache::Cache::dumpContentsToFile): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::asJSON): * NetworkProcess/cache/NetworkCacheEntry.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::traverse): Add flags for specificying what sort of information is needed. (WebKit::NetworkCache::computeRecordWorth): Factor to a function. (WebKit::NetworkCache::deletionProbability): * NetworkProcess/cache/NetworkCacheStorage.h: 2015-03-29 Simon Fraser Fix iOS scrollperf crash after a web process crash https://bugs.webkit.org/show_bug.cgi?id=143110 Reviewed by Dean Jackson. When we destroy the drawing area after a web process crash, we also need to destroy the scrollingPerformanceData which has a reference to the drawing area. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): 2015-03-29 Simon Fraser Convert arguments to ScrollingCoordinator functions to references https://bugs.webkit.org/show_bug.cgi?id=143198 Reviewed by Darin Adler. Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to references, and use references in a few other places. * WebProcess/Scrolling/RemoteScrollingCoordinator.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView): 2015-03-29 Enrica Casucci [iOS WK2] WKContentView should implement _selectionClipRect https://bugs.webkit.org/show_bug.cgi?id=143143 rdar://problem/20330075 Reviewed by Benjamin Poulain. UIKit checks if the text delegate responds to this selector to retrieve the clipping rectangle for the editable element where the selection is being create. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _selectionClipRect]): 2015-03-29 Antti Koivisto Use st_mtime instead of st_atime to track file access time https://bugs.webkit.org/show_bug.cgi?id=143200 Reviewed by Darin Adler. On OS X atime updates automatically on read so calling Storage::traverse() would always ends up updating access times for all cache entries to the current time. This would make entry worth computation produce unexpected results. We update mtime manually on successful cache retrieve only so switching to it fixes the problem. * NetworkProcess/cache/NetworkCacheFileSystemPosix.h: (WebKit::NetworkCache::fileTimes): (WebKit::NetworkCache::updateFileModificationTimeIfNeeded): (WebKit::NetworkCache::updateFileAccessTimeIfNeeded): Deleted. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::updateFileModificationTime): (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::deletionProbability): (WebKit::NetworkCache::Storage::updateFileAccessTime): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: 2015-03-27 Gwang Yoon Hwang [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper https://bugs.webkit.org/show_bug.cgi?id=142386 Reviewed by Žan Doberšek. TextureMapper and TextureMapperGL are bloated and tightly coupled with BitmapTexture. We should move these classes to seperated file of their own. Also, this patch removes friend relationship from TextureMapperGL and its subsidiary classes. The main purpose of this refactoring is to expose BitmapTexturePool to renderers of platformlayers like Video and Canvas. By doing this, each renderer can acquire textures from the global texture pool to paint their contents directly. * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Include BitmapTextureGL.h explicitly 2015-03-27 Anders Carlsson Use a typedef for the WKPluginLoadClientPolicy enum https://bugs.webkit.org/show_bug.cgi?id=143161 Reviewed by Tim Horton. * UIProcess/API/C/WKPluginLoadPolicy.h: 2015-03-27 Chris Dumez [WK2][NetworkCache] Use WTF::WorkQueue abstraction inside NetworkCacheStatistics https://bugs.webkit.org/show_bug.cgi?id=143154 Reviewed by Antti Koivisto. Use WTF::WorkQueue abstraction inside NetworkCacheStatistics, like we already do in NetworkCacheStorage. * NetworkProcess/cache/NetworkCacheStatistics.cpp: Renamed from Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm. (WebKit::NetworkCache::executeSQLCommand): (WebKit::NetworkCache::executeSQLStatement): (WebKit::NetworkCache::Statistics::open): (WebKit::NetworkCache::Statistics::Statistics): (WebKit::NetworkCache::Statistics::initialize): (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache): (WebKit::NetworkCache::Statistics::shrinkIfNeeded): (WebKit::NetworkCache::Statistics::recordRetrievalRequest): (WebKit::NetworkCache::Statistics::recordNotCachingResponse): (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey): (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest): (WebKit::NetworkCache::storeDecisionToDiagnosticKey): (WebKit::NetworkCache::Statistics::recordRetrievalFailure): (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey): (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry): (WebKit::NetworkCache::Statistics::markAsRequested): (WebKit::NetworkCache::Statistics::writeTimerFired): (WebKit::NetworkCache::Statistics::queryWasEverRequested): (WebKit::NetworkCache::Statistics::clear): (WebKit::NetworkCache::Statistics::addHashesToDatabase): (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase): * NetworkProcess/cache/NetworkCacheStatistics.h: (WebKit::NetworkCache::Statistics::serialBackgroundIOQueue): * WebKit2.xcodeproj/project.pbxproj: 2015-03-27 Ryosuke Niwa Safari clears selection when its window gets activated via mouse down https://bugs.webkit.org/show_bug.cgi?id=143157 Reviewed by Anders Carlsson. The bug was caused by PlatformMouseEvent created in WebKit2 not having its event number even though we were correctly calling setActivationEventNumber in WebPage::acceptsFirstMouse. Fixed the bug by storing [NSEvent eventNumber] in WebMouseEvent on Mac in WebKit2 as done in WebKit1. * Shared/WebEvent.h: (WebKit::WebMouseEvent::eventNumber): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): * Shared/WebMouseEvent.cpp: (WebKit::WebMouseEvent::WebMouseEvent): (WebKit::WebMouseEvent::encode): (WebKit::WebMouseEvent::decode): * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebMouseEvent): 2015-03-27 Anders Carlsson Only do the Connection::setShouldCloseConnectionOnMachExceptions() hack where necessary https://bugs.webkit.org/show_bug.cgi?id=143141 rdar://problem/19471284 Reviewed by Andreas Kling. * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::platformInvalidate): (IPC::Connection::platformInitialize): (IPC::Connection::open): * Shared/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::didFinishLaunching): * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::didFinishLaunching): 2015-03-27 Tim Horton Implement iOS WebKit2 PDF Find-in-Page https://bugs.webkit.org/show_bug.cgi?id=143065 Reviewed by Dan Bernstein. * Platform/spi/ios/CorePDFSPI.h: Add some SPI. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _countStringMatches:options:maxCount:]): (-[WKWebView _findString:options:maxCount:]): (-[WKWebView _hideFindUI]): If we have a custom content view, forward find-in-page methods to it. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKFindOptions.h: Move _WKFindOptions into its own file. * UIProcess/Cocoa/WKWebViewContentProvider.h: Add find-related methods to the WKWebViewContentProvider protocol. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView web_initWithFrame:webView:]): (-[WKPDFView dealloc]): Maintain a dispatch queue for searching the PDF. (-[WKPDFView web_setContentProviderData:suggestedFilename:]): Fix a type. (-[WKPDFView _ensureViewForPage:]): Split the code to create/parent a page view out from _revalidateViews, so that the find code can create/parent the targetted UIPDFPageView in order to install the find highlight in it, but before it is scrolled into view. (-[WKPDFView _revalidateViews]): Use the stored page index instead of counting again. Don't unparent page views that have find-in-page highlights in them, because we won't know enough to recreate them later. (-[WKPDFView _computePageAndDocumentFrames]): Put the page index in PDFPageInfo, for reference elsewhere. (-[WKPDFView _stringCompareOptionsFromWKFindOptions:]): (-[WKPDFView _computeMatchesForString:options:maxCount:completionHandler:]): Asynchronously (and on our serial queue) search the PDF for the given string. We'll cache the most recent results to avoid searching more than once, cancel existing searches when another begins (since it's a serial queue, this ensures we'll only have one search active at a time). (-[WKPDFView web_countStringMatches:options:maxCount:]): Count the number of matches for the given string, and inform the FindClient of the result. (-[WKPDFView _didFindMatch:]): When we find a match, create a view for it, highlight the match, and zoom so that it's in-view. (-[WKPDFView web_findString:options:maxCount:]): Incrementally search the document for the given string. We do an incremental search even if we have all of the results so that we can anchor the search in the right place if the new string is a prefix of the old string, etc. Wrap around appropriately when searching past the beginning or end of the document. If we have all of the results (there were less than maxCount results), look through the cached matches for the incrementally-found result and report its index to the client. (-[WKPDFView web_hideFindUI]): Dismiss the selection and clear some state so we start the next search afresh. * WebKit2.xcodeproj/project.pbxproj: 2015-03-27 Andreas Kling WebProcessProxy should not retain WebBackForwardListItems forever. Reviewed by Anders Carlsson. Have WebProcessProxy actually forget about a WebBackForwardListItem after it's removed from the WebBackForwardList. This ensures that we don't accumulate too many of these objects, which can get quite large due to the session state encoded in them. We already have graceful handling of the case where an incoming IPC message references a removed back/forward list item. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::didRemoveItem): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::backForwardRemovedItem): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::removeBackForwardItem): * UIProcess/WebProcessProxy.h: 2015-03-27 Simon Fraser Use the correct timebase to log scrollperf blank pixel counts on iOS https://bugs.webkit.org/show_bug.cgi?id=143149 Reviewed by Tim Horton. MobileSafari and WebKit need to collect scrollperf data using the same timebase; MobileSafari can't call WTF::monotonicallyIncreasingTime(), so use CFAbsoluteTimeGetCurrent() everywhere. * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm: (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount): 2015-03-27 Chris Dumez [WK2][NetworkCache] Rename requestNeedsRevalidation() to requestRequiresRevalidation() https://bugs.webkit.org/show_bug.cgi?id=143137 Reviewed by Antti Koivisto. Rename requestNeedsRevalidation() to requestRequiresRevalidation() as I think it is more accurate. It is not the request that needs revalidating. The requests just requires us to revalidate the response. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::requestRequiresRevalidation): (WebKit::NetworkCache::canUse): (WebKit::NetworkCache::requestNeedsRevalidation): Deleted. 2015-03-27 Oliver Hunt Forward additional CFNetwork ATS information to child processes https://bugs.webkit.org/show_bug.cgi?id=143136 Reviewed by Anders Carlsson. Add additional process creation parameter information, and pass it to the child processes that actually use CFNetwork. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/Network/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * Shared/Network/NetworkProcessCreationParameters.h: * Shared/Plugins/PluginProcessCreationParameters.cpp: (WebKit::PluginProcessCreationParameters::encode): (WebKit::PluginProcessCreationParameters::decode): * Shared/Plugins/PluginProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::platformInitializePluginProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2015-03-27 Chris Dumez [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default https://bugs.webkit.org/show_bug.cgi?id=143125 Reviewed by Antti Koivisto. We Previously only cached responses with status codes that are cacheable by default [1]. However, RFC 7234 [2] allows us to cache responses with other status codes, as long as they have explicit headers allowing caching: - 'Expires' header field - 'max-age' response directive This patch updates our caching policy accordingly to improve efficiency. [1] http://tools.ietf.org/html/rfc7231#page-48 [2] http://tools.ietf.org/html/rfc7234#section-4.3.2 Test: http/tests/cache/disk-cache/disk-cache-307-status-code.html * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::canStore): 2015-03-26 Antti Koivisto Respect cache-control directives in request https://bugs.webkit.org/show_bug.cgi?id=143121 rdar://problem/19714040 Reviewed by Chris Dumez. Better support for https://tools.ietf.org/html/rfc7234#section-5.2.1 * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::canUse): Consider requests with Cache-control: no-cache and max-age=0 expired. (WebKit::NetworkCache::canStore): Don't store requests with Cache-control: no-store. (WebKit::NetworkCache::Cache::store): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm: (WebKit::NetworkCache::storeDecisionToDiagnosticKey): 2015-03-25 Jon Honeycutt iOS file upload panel menu items need icons Reviewed by Andy Estes. * Platform/spi/ios/UIKitSPI.h: Declare new SPI methods _UIImageGetWebKitTakePhotoOrVideoIcon and _UIImageGetWebKitPhotoLibraryIcon(). * UIProcess/ios/forms/WKFileUploadPanel.mm: (photoLibraryIcon): (cameraIcon): If UIKit SPI exists, use it. Otherwise, return nil. (-[WKFileUploadPanel _showDocumentPickerMenu]): Use icons. 2015-03-26 Enrica Casucci OS X build fix after r182037. Unreviewed. * UIProcess/API/mac/WKView.mm: (-[WKView _addFontPanelObserver]): (-[WKView removeWindowObservers]): (-[WKView observeValueForKeyPath:ofObject:change:context:]): 2015-03-26 Enrica Casucci iOS build fix after r182037. Unreviewed. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setEditable:]): 2015-03-26 Enrica Casucci REGRESSION(r1807689): Slower startup time for WKWebView. https://bugs.webkit.org/show_bug.cgi?id=143115 rdar://problem/20233711 Reviewed by Anders Carlsson. In http://trac.webkit.org/changeset/180768 we added an observer to track visibility of the NSFontPanel to ensure we could fetch the font information for the current selection when the panel first becomes visible. It turns out that adding the observer requires the shared font panel object to be created. That is apparently a very expensive operation that is regressing the initialization time for the WKWebView. We should initialize the NSFontPanel lazily, only when we make the entire view editable. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setEditable:]): * UIProcess/API/mac/WKView.mm: (-[WKView addWindowObserversForWindow:]): (-[WKView _addFontPanelObserver]): (-[WKView removeWindowObservers]): (-[WKView observeValueForKeyPath:ofObject:change:context:]): * UIProcess/API/mac/WKViewInternal.h: 2015-03-26 Alex Christensen Progress towards CMake on Mac. https://bugs.webkit.org/show_bug.cgi?id=143112 Reviewed by Chris Dumez. * CMakeLists.txt: * PlatformMac.cmake: * UIProcess/Cocoa/WebPageProxyCocoa.mm: 2015-03-26 Chris Dumez [WK2][Cocoa] Add private API to override the network disk cache size https://bugs.webkit.org/show_bug.cgi?id=143113 Reviewed by Antti Koivisto. Add private API to let the client override the network disk cache size. By default, the network disk cache is automatically determined based on the CacheModel and the available disk space. However, for testing purposes, it can be used for the client-side to be able to override the disk cache size. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::setMaximumSize): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformSetCacheModel): * Shared/Network/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * Shared/Network/NetworkProcessCreationParameters.h: * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration diskCacheSizeOverride]): (-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebProcessPool.h: 2015-03-26 Andreas Kling [Darwin] Boost the web process QoS level while handling a synchronous IPC message. Reviewed by Antti Koivisto and Anders Carlsson. Add a mechanism for IPC::Connection to boost the main thread for the duration of processing a synchronous message. This fixes an issue where the UI process would block on a synchronous request to the web process that was being carried out at a lower QoS level. * Platform/IPC/Connection.cpp: (IPC::Connection::Connection): Save the main thread's pthread_t while we have a chance to retreive it. (IPC::Connection::processIncomingMessage): Optionally boost the main thread when processing an incoming message with the IsSyncMessage flag set. * Platform/IPC/Connection.h: (IPC::Connection::setShouldBoostMainThreadOnSyncMessage): Added. When this mode is enabled, Connection will give a temporary QoS override to the main thread when receiving a synchronous message. Ownership of the override is handed to the MessageDecoder, which resets the main thread QoS in its destructor. * Platform/IPC/MessageDecoder.cpp: (IPC::MessageDecoder::~MessageDecoder): Remove any QoS override owned by this message. * Platform/IPC/MessageDecoder.h: (IPC::MessageDecoder::setQOSClassOverride): Added. Takes ownership of a QoS override to make sure it stays in effect until this message has been dispatched. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): Set up main thread QoS boosting for the web process's connection to the UI process. 2015-03-26 Ryosuke Niwa Cursor doesn't change back to pointer when leaving Mail https://bugs.webkit.org/show_bug.cgi?id=132038 Reviewed by Anders Carlsson. Fixed the bug by adding a cursor rect and making the primary tracking area update the cursor so that AppKit will reset the cursor as it leaves the WebView. We use nil cursor here since we manually update the cursor by calling [NSCursor set]. * UIProcess/API/mac/WKView.mm: (-[WKView initWithFrame:processPool:configuration:webView:]): * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange): 2015-03-26 Michael Catanzaro [Linux] SeccompFilters: improve the port-agnostic whitelist https://bugs.webkit.org/show_bug.cgi?id=140064 Reviewed by Žan Doberšek. Allow the web process to access several files and directories that it was previously prohibited from accessing. This makes the web process much less likely to break. * Shared/linux/SeccompFilters/SyscallPolicy.cpp: (WebKit::SyscallPolicy::addDefaultWebProcessPolicy): 2015-03-26 Antti Koivisto Remove unneeded isConditionalRequest check from NetworkResourceLoader https://bugs.webkit.org/show_bug.cgi?id=143096 Reviewed by Anders Carlsson. This check is leftover from implementation that allowed disk cache to validate conditional request itself. The case can't happen as NetworkCache canRetrieve test does not allow conditional requests in the first place. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponseAsync): (WebKit::isConditionalRequest): Deleted. 2015-03-26 Antti Koivisto Rename Storage::Entry to Storage::Record https://bugs.webkit.org/show_bug.cgi?id=143101 Reviewed by Chris Dumez. Lets have just one type called Entry in the cache code. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::retrieve): (WebKit::NetworkCache::Cache::store): (WebKit::NetworkCache::Cache::update): (WebKit::NetworkCache::Cache::traverse): (WebKit::NetworkCache::Cache::dumpContentsToFile): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::Entry): (WebKit::NetworkCache::Entry::encodeAsStorageRecord): (WebKit::NetworkCache::Entry::decodeStorageRecord): (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord): (WebKit::NetworkCache::Entry::buffer): (WebKit::NetworkCache::Entry::shareableResourceHandle): (WebKit::NetworkCache::Entry::encode): Deleted. (WebKit::NetworkCache::Entry::decode): Deleted. (WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry): Deleted. * NetworkProcess/cache/NetworkCacheEntry.h: (WebKit::NetworkCache::Entry::sourceStorageRecord): (WebKit::NetworkCache::Entry::sourceStorageEntry): Deleted. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::RecordMetaData::RecordMetaData): (WebKit::NetworkCache::decodeRecordMetaData): (WebKit::NetworkCache::decodeRecordHeader): (WebKit::NetworkCache::decodeRecord): (WebKit::NetworkCache::encodeRecordMetaData): (WebKit::NetworkCache::encodeRecordHeader): (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::retrieveFromMemory): (WebKit::NetworkCache::Storage::store): (WebKit::NetworkCache::Storage::update): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations): (WebKit::NetworkCache::Storage::dispatchFullWriteOperation): (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation): (WebKit::NetworkCache::EntryMetaData::EntryMetaData): Deleted. (WebKit::NetworkCache::decodeEntryMetaData): Deleted. (WebKit::NetworkCache::decodeEntryHeader): Deleted. (WebKit::NetworkCache::decodeEntry): Deleted. (WebKit::NetworkCache::encodeEntryMetaData): Deleted. (WebKit::NetworkCache::encodeEntryHeader): Deleted. * NetworkProcess/cache/NetworkCacheStorage.h: 2015-03-26 Chris Dumez [WK2] Let the compiler generate the NetworkCache::Key move constructor https://bugs.webkit.org/show_bug.cgi?id=143079 Reviewed by Antti Koivisto. Let the compiler generate the NetworkCache::Key move constructor. The generated one will do exactly the same thing as the one we had except that it will move the m_hash member as well. I don't see any reason why we weren't moving this member before (it is an std::array). Also have the compiler generate a move assignment operator for consistency. Although it is not currently useful, it could be at some point. * NetworkProcess/cache/NetworkCacheKey.cpp: (WebKit::NetworkCache::Key::Key): Deleted. * NetworkProcess/cache/NetworkCacheKey.h: 2015-03-26 Chris Dumez [WK2][NetworkCache] Compute if a cached response has expired only when actually needed https://bugs.webkit.org/show_bug.cgi?id=143070 Reviewed by Antti Koivisto. Compute if a cached response has expired only when actually needed: - This is not a history navigation and - It does not have "Cache-Control: no-cache" header Previously, we would always determine if the response has expired and we often end up not using this information. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::responseHasExpired): (WebKit::NetworkCache::canUse): 2015-03-26 Zan Dobersek Avoid the Vector<> copy in WebTouchEvent constructor https://bugs.webkit.org/show_bug.cgi?id=143043 Reviewed by Carlos Garcia Campos. Have the WebTouchEvent accept a Vector<> rvalue. The relevant code is updated so the Vector<> object is moved through the call chain and finally into the WebTouchEvent constructor. * Shared/NativeWebTouchEvent.h: * Shared/WebEvent.h: * Shared/WebTouchEvent.cpp: (WebKit::WebTouchEvent::WebTouchEvent): * Shared/efl/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebTouchEvent): * Shared/gtk/NativeWebTouchEventGtk.cpp: (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebTouchEvent): * Shared/gtk/WebEventFactory.h: * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseTouchEvent): 2015-03-25 Chris Dumez [WK2] WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always call the FramePolicyFunction https://bugs.webkit.org/show_bug.cgi?id=143036 Reviewed by Alexey Proskuryakov. WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always call the FramePolicyFunction. Previously, it would fail to do in 2 cases: - m_frame->page() returns null or - webPage->sendSync() returns false If the FramePolicyFunction is not called, we will fail to clear the callback in the PolicyChecker and DocumentLoader::continueAfterContentPolicy() will not be called. DocumentLoader::continueAfterContentPolicy() is in charge of resetting m_waitingForContentPolicy flag to false. This could therefore explain the following assertion being hit in DocumentLoader::detachFromFrame() (see ): RELEASE_ASSERT(!m_waitingForContentPolicy) Also, as the PolicyChecker callback is not cleared, it could make it possible for DocumentLoader::continueAfterContentPolicy() to be called *after* the load is finished, when later canceling the PolicyCallback: FrameLoader::stopAllLoaders() -> PolicyChecker::stopCheck() -> PolicyCallback::cancel() -> DocumentLoader::continueAfterContentPolicy(PolicyIgnore) Calling continueAfterContentPolicy(PolicyIgnore) after the load is finished would be bad and could explain some of the crashes we've seen in DocumentLoader::continueAfterContentPolicy() -> DocumentLoader:: stopLoadingForPolicyChange() (see ). This patch also applies the same fix to dispatchDecidePolicyForNewWindowAction() and dispatchDecidePolicyForNavigationAction() as they use the same pattern. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2015-03-25 Tim Horton Add a preference to prevent "user-scalable=no" from having any effect https://bugs.webkit.org/show_bug.cgi?id=143032 Reviewed by Sam Weinig. * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Add a preference and push it to the ViewportConfiguration. 2015-03-25 Beth Dakin REGRESSION (r181660): Force click url preview doesn't have a TextIndicator in Mail https://bugs.webkit.org/show_bug.cgi?id=143064 -and corresponding- rdar://problem/20251440 Reviewed by Tim Horton. The TextIndicator was getting set to nil by the call to _dismissContentRelativeChildWindows in mouseDown. That line of code was added by http://trac.webkit.org/changeset/177242 to work around a bug in another component that has now been resolved, so it no longer appears to be necessary. * UIProcess/API/mac/WKView.mm: (-[WKView mouseDown:]): 2015-03-25 Anders Carlsson Add network and application cache directories to WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=143063 Reviewed by Sam Weinig. Create a WebKit directory under ~/Library/Caches/ for non-sandboxed applications, and ~/Library/Caches for sandboxed applications. Create NetworkCache and OfflineWebApplicationCache subdirectories. These directories will be used with the modern WebKit API. * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): (API::WebsiteDataStore::defaultDataStoreConfiguration): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): * UIProcess/WebsiteData/WebsiteDataStore.h: 2015-03-25 Sam Weinig Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059. * Shared/WebCompiledContentExtension.cpp: (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData): * UIProcess/API/C/WKUserContentFilterRef.cpp: (WKUserContentFilterCreate): * UIProcess/API/Cocoa/_WKUserContentFilter.mm: (-[_WKUserContentFilter initWithName:serializedRules:]): 2015-03-25 Sam Weinig [Content Extensions] Convert content extension compiling to return error codes and write its output using a client https://bugs.webkit.org/show_bug.cgi?id=143059 Reviewed by Alex Christensen. * Shared/WebCompiledContentExtension.cpp: * Shared/WebCompiledContentExtension.h: (WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient): (WebKit::LegacyContentExtensionCompilationClient::writeBytecode): (WebKit::LegacyContentExtensionCompilationClient::writeActions): Add subclass of ContentExtensionCompilationClient for use with the non-file backed content extensions. * UIProcess/API/C/WKUserContentFilterRef.cpp: (WKUserContentFilterCreate): * UIProcess/API/Cocoa/_WKUserContentFilter.mm: (-[_WKUserContentFilter initWithName:serializedRules:]): Update to use the new interface of compileRuleList(). 2015-03-25 Ryosuke Niwa Web Inspector: Switching tabs to window with inspector open prohibits typing into console https://bugs.webkit.org/show_bug.cgi?id=126800 Reviewed by Anders Carlsson. This is a regression from r85356 and r83814. These two patches made WKWebView clear its selection when WKView resigns the first responder without ever restoring it even if WKView later becomes the first responder again. This is problematic when a text field or a editing host element had been focused and selected prior to the resignation since the editing code uses the selection to determine the editability of the element. Fixed the bug by restoring selection in [WKView becomeFirstResponder] if the selection is empty. * UIProcess/API/mac/WKView.mm: (-[WKView becomeFirstResponder]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::restoreSelectionInFocusedEditableElement): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2015-03-25 Beth Dakin REGRESSION (r181660): Safari navigates to link after a starting and canceling a force preview https://bugs.webkit.org/show_bug.cgi?id=143057 -and corresponding- rdar://problem/20251436 Reviewed by Tim Horton. Always call _page->immediateActionDidUpdate() so that the EventHandler’s ImmediateActionStage is appropriately updated. * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]): Update the EventHandler’s ImmediateActionStage. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::immediateActionDidUpdate): 2015-03-25 Antti Koivisto Separate entry decoding from validation https://bugs.webkit.org/show_bug.cgi?id=143052 Reviewed by Chris Dumez. Make NetworkCache::Cache a class and move it to a file of its own. Move the encoding/decoding code there. * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::clearDiskCacheEntries): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::sendReplyToSynchronousRequest): (WebKit::NetworkResourceLoader::start): (WebKit::NetworkResourceLoader::sendBufferMaybeAborting): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): (WebKit::NetworkResourceLoader::validateCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::collectVaryingRequestHeaders): (WebKit::NetworkCache::canUse): Focused function for deciding if we can use a cache entry and if it needs validation. (WebKit::NetworkCache::Cache::retrieve): (WebKit::NetworkCache::Cache::store): (WebKit::NetworkCache::Cache::update): (WebKit::NetworkCache::Cache::traverse): (WebKit::NetworkCache::encodeStorageEntry): Deleted. (WebKit::NetworkCache::decodeStorageEntry): Deleted. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheEntry.cpp: Added. (WebKit::NetworkCache::Entry::Entry): (WebKit::NetworkCache::Entry::encode): (WebKit::NetworkCache::Entry::decode): (WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry): (WebKit::NetworkCache::Entry::buffer): (WebKit::NetworkCache::Entry::shareableResourceHandle): (WebKit::NetworkCache::Entry::needsValidation): (WebKit::NetworkCache::Entry::setNeedsValidation): * NetworkProcess/cache/NetworkCacheEntry.h: Added. (WebKit::NetworkCache::Entry::key): (WebKit::NetworkCache::Entry::timeStamp): (WebKit::NetworkCache::Entry::response): (WebKit::NetworkCache::Entry::varyingRequestHeaders): (WebKit::NetworkCache::Entry::sourceStorageEntry): * NetworkProcess/cache/NetworkCacheStatistics.h: * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm: (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey): (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry): * WebKit2.xcodeproj/project.pbxproj: 2015-03-25 David Hyatt Add a pref to enable the new block-inside-inline model https://bugs.webkit.org/show_bug.cgi?id=143050 Reviewed by Sam Weinig. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetNewBlockInsideInlineModelEnabled): (WKPreferencesGetNewBlockInsideInlineModelEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2015-03-25 Zan Dobersek [WK2] WebUserMediaClient::pageDestroyed() virtual method should be marked as override https://bugs.webkit.org/show_bug.cgi?id=143046 Reviewed by Carlos Garcia Campos. * WebProcess/WebCoreSupport/WebUserMediaClient.h: Mark the WebUserMediaClient::pageDestroyed() method, inherited from the WebCore::UserMediaClient, as an override. 2015-03-25 Zan Dobersek [GTK][WK2] WebPageProxy::failedToShowPopupMenu() virtual method should be marked as override https://bugs.webkit.org/show_bug.cgi?id=143045 Reviewed by Carlos Garcia Campos. * UIProcess/WebPageProxy.h: Mark the failedToShowPopupMenu(), inherited from the WebPopupMenuProxy::Client class, as overridden. 2015-03-25 Zan Dobersek [WK2] Clean up DrawingAreaImpl vtable overrides https://bugs.webkit.org/show_bug.cgi?id=143044 Reviewed by Carlos Garcia Campos. Declare virtual methods of the DrawingAreaImpl class as overridden where necessary. * WebProcess/WebPage/DrawingAreaImpl.h: (WebKit::DrawingAreaImpl::layerTreeStateIsFrozen): Deleted. (WebKit::DrawingAreaImpl::layerTreeHost): Deleted. 2015-03-24 Ryosuke Niwa Inspector doesn't get focused when opened in dock mode https://bugs.webkit.org/show_bug.cgi?id=143030 Reviewed by Anders Carlsson. The bug was caused by platformBringToFront and platformAttach calling makeFirstResponder on WKWebView, which aren't intended to become the first responder. Fixed the bug by calling makeFirstResponder on the WKView subview of the WKWebView, which is intended to be used as the first responder on behalf of the web view. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformBringToFront): (WebKit::WebInspectorProxy::platformAttach): 2015-03-24 Chris Dumez [WK2] Responses with 302 HTTP Status Code should not be cached https://bugs.webkit.org/show_bug.cgi?id=143028 Reviewed by Antti Koivisto. Responses with 302 HTTP Status Code should not be cached as per RFC 7231: http://tools.ietf.org/html/rfc7231#section-6.1 This patch updates our disk cache policy accordingly. Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::canStore): 2015-03-24 Anders Carlsson Fix crash in WebKit::RemoteObjectRegistry::sendInvocation https://bugs.webkit.org/show_bug.cgi?id=143027 rdar://problem/20208674 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController dealloc]): Make sure to invalidate the _WKRemoteObjectRegistry like we do in the UI process. 2015-03-24 Chris Dumez [WK2] Responses with 204 HTTP Status Code should be cacheable by default https://bugs.webkit.org/show_bug.cgi?id=143020 Reviewed by Antti Koivisto. Make responses with 204 HTTP Status Code cacheable by default, as per RFC 7231: http://tools.ietf.org/html/rfc7231#section-6.3.5 Test: http/tests/cache/disk-cache/disk-cache-204-status-code.html * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::canStore): 2015-03-24 Enrica Casucci [iOS] Remove unused keyboard code in WKSelectPopover class. https://bugs.webkit.org/show_bug.cgi?id=143021 Reviewed by Joseph Pecoraro. WKSelectPopover created an instance of UIKeyboard that was initialized in initWithView but never used. Removing the obsolete code. * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectPopover initWithView:hasGroups:]): 2015-03-24 Dan Bernstein WebKit2 part of Transforms are flattened in snapshots of on-screen WKWebViews https://bugs.webkit.org/show_bug.cgi?id=143023 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): If the view is in a window, use CARenderServerRenderLayerWithTransform to synchronously capture a snapshot of its layer tree into an IOSurfcae, then call the completion handler with an image created from the IOSurface. 2015-03-24 Beth Dakin Add events related to force click gesture https://bugs.webkit.org/show_bug.cgi?id=142836 -and corresponding- rdar://problem/20210239 Reviewed by Dean Jackson. ActionMenuHitTestResult has a new bool indicating whether to not the HitTestResult will prevent default. * Shared/mac/ActionMenuHitTestResult.h: * Shared/mac/ActionMenuHitTestResult.mm: (WebKit::ActionMenuHitTestResult::encode): (WebKit::ActionMenuHitTestResult::decode): Send immediateActionDidUpdate and the normalized force over the the WebProcess. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::immediateActionDidUpdate): * UIProcess/WebPageProxy.h: We need a dummy animation controller when web content is overriding the default behavior. * UIProcess/mac/WKImmediateActionController.mm: Send along the update information. (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]): Use the dummy animation controller if default has been prevented. (-[WKImmediateActionController _defaultAnimationController]): (-[WKImmediateActionController _updateImmediateActionItem]): Keep track of whether m_lastActionMenuHitTes prevented the default immediate action behavior. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Call dispatchMouseForceMayBegin() at hit test time. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): Call dispatchMouseForceChanged() if appropriate. (WebKit::WebPage::immediateActionDidUpdate): Call dispatchMouseForceCancelled() if appropriate. (WebKit::WebPage::immediateActionDidCancel): Call dispatchMouseForceDown() if appropriate. (WebKit::WebPage::immediateActionDidComplete): 2015-03-24 Anders Carlsson Fix designated initializer violations https://bugs.webkit.org/show_bug.cgi?id=143016 rdar://problem/20268858 Reviewed by Dan Bernstein. Move -[WKProcessPool _initWithConfiguration:] to a class extension so we can make it the designated initializer. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _initWithConfiguration:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: 2015-03-24 Chris Dumez [WK2] Responses with 404 HTTP Status Code should be cacheable by default https://bugs.webkit.org/show_bug.cgi?id=143014 Reviewed by Antti Koivisto. Make responses with 404 HTTP Status Code cacheable by default, as per RFC 7231: http://tools.ietf.org/html/rfc7231#section-6.5.4 Test: http/tests/cache/disk-cache/disk-cache-404-status-code.html * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::canStore): 2015-03-24 Chris Dumez [WK2] Remove NetworkCache FIXME comment about caching responses to OPTIONS requests https://bugs.webkit.org/show_bug.cgi?id=143009 Reviewed by Andreas Kling. Remove NetworkCache FIXME comment about caching responses to OPTIONS method as RFC 7234 says "Responses to the OPTIONS method are not cacheable" [1]. [1] http://tools.ietf.org/html/rfc7231#page-31 * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::canRetrieve): 2015-03-24 Chris Dumez [WK2] NetworkCache retrievals fail for entries with no body https://bugs.webkit.org/show_bug.cgi?id=142979 Reviewed by Antti Koivisto. NetworkCache retrievals were failing for entries with no body because decodeEntry() doesn't correctly handle this case. In particular, the following check fails: "metaData.bodyOffset + metaData.bodySize == fileData.size()". This is because bodyOffset is pageSize-aligned. As a result, the following resource on apple.com is stored in the cache but we fail to reuse it and reload it from the network every time: http://images.apple.com/home/styles/promos.css This patch updates decodeEntry() to create a null Data object for the body if bodySize is 0. * NetworkProcess/cache/NetworkCacheDataCocoa.mm: (WebKit::NetworkCache::Data::data): Do not attempt to initialize m_data if m_dispatchData is null as the call to dispatch_data_create_map() would then crash. We now return null in this case. This is needed as decodeStorageEntry() in NetworkCache.cpp constructs a SharedBuffer from storageEntry.body.data() and the body may be null. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::decodeEntry): 2015-03-24 Chris Dumez [WK2] The WebKit network cache does not cache responses with "Content-Disposition: attachment" header https://bugs.webkit.org/show_bug.cgi?id=142989 Reviewed by Antti Koivisto. Update our WebKit network cache policy to cache responses with "Content-Disposition: attachment" header. There is no reason we cannot cache these and our memory cache already does. This was causing a decent amount of cache misses in the wild. I have noticed for example that when loading disney.com, we fail to cache the following resources because of this policy: http://pagead2.googlesyndication.com/pagead/osd.js http://pagead2.googlesyndication.com/pagead/show_companion_ad.js Those resources have Cache-Control headers that indicate they are meant to be cacheable. Test: http/tests/cache/disk-cache-validation-attachment.html * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::canStore): 2015-03-23 Joseph Pecoraro Unreviewed, another attempt to fix 32-bit build after r181881. * UIProcess/WebInspectorProxy.h: 2015-03-23 Joseph Pecoraro Unreviewed, attempt to fix 32-bit build after r181881. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: 2015-03-19 Timothy Hatcher Web Inspector: Support attaching to another view other than the WKView https://bugs.webkit.org/show_bug.cgi?id=142892 Reviewed by Tim Horton. * UIProcess/API/C/WKInspector.cpp: (WKInspectorAttach): Drive by fix so it used the last attachment side. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _inspectorAttachmentView]): Added. (-[WKView _setInspectorAttachmentView:]): Added. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::createInspectorPage): (WebKit::WebInspectorProxy::attachAvailabilityChanged): Use platformCanAttach as a final check incase there is a different attachment view that the platform knows about. * UIProcess/WebInspectorProxy.h: (WebKit::WebInspectorProxy::attachmentSide): Added. (WebKit::WebInspectorProxy::platformCanAttach): Added. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::attachmentViewDidChange): Added. (WebKit::WebInspectorProxy::closeTimerFired): (WebKit::WebInspectorProxy::platformCreateInspectorPage): (WebKit::WebInspectorProxy::platformCanAttach): (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): (WebKit::WebInspectorProxy::platformInspectedWindowHeight): (WebKit::WebInspectorProxy::platformInspectedWindowWidth): (WebKit::WebInspectorProxy::platformAttach): (WebKit::WebInspectorProxy::platformDetach): Use the _inspectorAttachmentView and change how the frame change notification is observed and follow the attachment view as it changes. 2015-03-23 Tim Horton Images shared to photos via action menu are padded with zeroes at the end https://bugs.webkit.org/show_bug.cgi?id=142985 Reviewed by Anders Carlsson. * Shared/mac/ActionMenuHitTestResult.h: * Shared/mac/ActionMenuHitTestResult.mm: (WebKit::ActionMenuHitTestResult::encode): (WebKit::ActionMenuHitTestResult::decode): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): Send the size of the image separately from the SharedMemory. The SharedMemory's size can be rounded up, so we need to keep the original size around in order to write the data to disk. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _hitTestResultImage]): (-[WKActionMenuController _addImageToPhotos:]): Use the image size instead of the SharedMemory size. 2015-03-23 Enrica Casucci [iOS] WebContent crash attempting to select text with a gesture at RenderObject::absoluteBoundingBoxRect. https://bugs.webkit.org/show_bug.cgi?id=142913 rdar://problem/16400033 Reviewed by Sam Weinig. When looking for the best candidate range at the given position, we should skip nodes that don't have a renderer. This is a speculative fix. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): 2015-03-23 Alexey Proskuryakov REGRESSION (Yosemite): WKView visibility notifications are messed up https://bugs.webkit.org/show_bug.cgi?id=142945 Reviewed by Tim Horton. As these notifications cannot be used by NSView subclasses, create a separate object for observing them. * UIProcess/API/mac/WKView.mm: (-[WKWindowVisibilityObserver initWithView:]): (-[WKWindowVisibilityObserver startObserving:]): (-[WKWindowVisibilityObserver stopObserving:]): (-[WKWindowVisibilityObserver _windowDidOrderOnScreen:]): (-[WKWindowVisibilityObserver _windowDidOrderOffScreen:]): (-[WKView addWindowObserversForWindow:]): (-[WKView removeWindowObservers]): Also, don't try to remove NSWindowWillOrderOffScreenNotification, which we never start to observe. (-[WKView initWithFrame:processPool:configuration:webView:]): * UIProcess/API/mac/WKViewInternal.h: 2015-03-23 Anders Carlsson Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again. https://bugs.webkit.org/show_bug.cgi?id=133692 rdar://problem/17255947 Reviewed by Alexey Proskuryakov. Add plug-in destruction protectors around message receiver code that can call out to NPObjects or JavaScript where we need the plug-in to stay around after the call. * Shared/Plugins/NPObjectMessageReceiver.cpp: (WebKit::NPObjectMessageReceiver::invoke): (WebKit::NPObjectMessageReceiver::invokeDefault): (WebKit::NPObjectMessageReceiver::getProperty): (WebKit::NPObjectMessageReceiver::setProperty): (WebKit::NPObjectMessageReceiver::construct): 2015-03-23 Anders Carlsson Put the WK_NULLABLE_SPECIFIER in the right place for block parameters https://bugs.webkit.org/show_bug.cgi?id=142975 rdar://problem/19863930 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKNavigationDelegate.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKWebView.h: 2015-03-23 Tim Horton Add a share item to the link action menu https://bugs.webkit.org/show_bug.cgi?id=142961 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _hitLinkURL]): Factor out _hitLinkURL from various places. (-[WKActionMenuController _openURLFromActionMenu:]): (-[WKActionMenuController _addToReadingListFromActionMenu:]): (-[WKActionMenuController _defaultMenuItemsForVideo]): (-[WKActionMenuController _defaultMenuItemsForImage]): (-[WKActionMenuController _createActionMenuItemForTag:]): (-[WKActionMenuController _createShareActionMenuItemForTag:withItems:]): Adopt -[NSMenuItem standardShareMenuItemWithItems]. All of the null-checking is unnecessary as it's impossible to enter these functions with a null image/etc. (-[WKActionMenuController _defaultMenuItemsForLink]): * Shared/API/c/WKActionMenuItemTypes.h: Add a 'Share' item to the link menu. 2015-03-23 Zan Dobersek [GTK] Use std::abs() in ClickCounter::currentClickCountForGdkButtonEvent() https://bugs.webkit.org/show_bug.cgi?id=142964 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (ClickCounter::currentClickCountForGdkButtonEvent): Use the STL's std::abs() instead of C's abs(). The templated nature of std::abs() ensures the proper computation that matches the types of the passed-in values, and shuts down a warning when compiling with Clang. 2015-03-23 Zan Dobersek [GTK][WK2] webkitBackForwardListChanged() should operate on a Vector reference https://bugs.webkit.org/show_bug.cgi?id=142963 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitBackForwardList.cpp: (webkitBackForwardListChanged): This function only reads from the passed-in Vector of removed items, so only a const lvalue reference to the Vector is needed. * UIProcess/API/gtk/WebKitBackForwardListPrivate.h: 2015-03-23 Carlos Garcia Campos [GTK] Add a configure option to build without Redirected XComposite Window https://bugs.webkit.org/show_bug.cgi?id=142865 Reviewed by Žan Doberšek. Use USE(REDIRECTED_XCOMPOSITE_WINDOW) instead of USE(TEXTURE_MAPPER_GL) && PLATFORM(X11). * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseRealize): Use the XID of the WebKitWebView window as native surface handle when REDIRECTED_XCOMPOSITE_WINDOW is disabled. (webkitWebViewRenderAcceleratedCompositingResults): (resizeWebKitWebViewBaseFromAllocation): (webkitWebViewBaseEnterAcceleratedCompositingMode): (webkitWebViewBaseExitAcceleratedCompositingMode): * UIProcess/gtk/RedirectedXCompositeWindow.cpp: * UIProcess/gtk/RedirectedXCompositeWindow.h: 2015-03-22 Eric Carlson [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1 https://bugs.webkit.org/show_bug.cgi?id=142940 Reviewed by Sam Weinig. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::playbackTargetSelected): Argument to didChoosePlaybackTarget is now const. 2015-03-22 Anders Carlsson _WKWebsiteDataStore should clear WebSQL databases https://bugs.webkit.org/show_bug.cgi?id=142947 rdar://problem/20242174 Reviewed by Sam Weinig. * Shared/WebsiteData/WebsiteDataTypes.h: Add WebsiteDataTypeWebSQLDatabases. * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultDataStoreConfiguration): Initialize configuration.webSQLDatabaseDirectory. * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: Add WKWebsiteDataTypeWebSQLDatabases. * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm: (dataTypesToString): Handle WKWebsiteDataTypeWebSQLDatabases. * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): Handle WKWebsiteDataTypeWebSQLDatabases and WebsiteDataTypes::WebsiteDataTypeWebSQLDatabases. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): Initialize m_webSQLDatabaseDirectory and add a queue member variable. (WebKit::WebsiteDataStore::fetchData): Fetch database origins. (WebKit::WebsiteDataStore::removeData): Remove databases. * UIProcess/WebsiteData/WebsiteDataStore.h: Add new members. 2015-03-22 Dan Bernstein [iOS] Expose WebPageProxy::setInitialFocus as SPI https://bugs.webkit.org/show_bug.cgi?id=142951 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): New SPI. Just calls through to WKWebContentView, but allows a nil completion handler. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView becomeFirstResponder]): Pass an empty lambda for the new callback parameter to WebPageProxy::setInitialFocus. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setInitialFocus): Added a void callback parameter and made sure to call it. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): Added. Calls WebPageProxy::setInitialFocus, and once that completes, checks if anything was focused and if so, becomes first responder, then calls the completion handler. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setInitialFocus): Added a callbackID parameter, and made sure to send the callback message. Added a temporary change of m_userIsInteracting to true, so that the UI process won’t ignore any StartAssistingNode message resulting from the focus change. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Added a callbackID parameter to SetInitialFocus. 2015-03-21 Dean Jackson Remove the prefix for CSS Transforms https://bugs.webkit.org/show_bug.cgi?id=142927 Reviewed by Simon Fraser. Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder::encode): 2015-03-21 Csaba Osztrogonác [EFL][GTK] Make WebKit2's generate-forwarding-headers.pl less verbose https://bugs.webkit.org/show_bug.cgi?id=142908 Reviewed by Žan Doberšek. * Scripts/generate-forwarding-headers.pl: (createForwardingHeadersForFramework): 2015-03-21 Commit Queue Unreviewed, rolling out r181824. https://bugs.webkit.org/show_bug.cgi?id=142935 Broke Windows build (Requested by ap on #webkit). Reverted changeset: "Remove the prefix for CSS Transforms" https://bugs.webkit.org/show_bug.cgi?id=142927 http://trac.webkit.org/changeset/181824 2015-03-20 Dean Jackson Remove the prefix for CSS Transforms https://bugs.webkit.org/show_bug.cgi?id=142927 Reviewed by Simon Fraser. Rename AnimatedPropertyWebkitTransform to AnimatedPropertyTransform. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder::encode): 2015-03-20 Chris Dumez [WK2] NetworkCache retrievals sometimes fail on browser startup https://bugs.webkit.org/show_bug.cgi?id=142925 Reviewed by Antti Koivisto. NetworkCache retrievals sometimes fail on browser startup for resources that are actually cached. The reason is that we are using a bloom filter for performance reasons to avoid unnecessary disk I/O and this bloom filter is populated on start up in a background thread by traversing the cache files on disk. However, when restoring the tabs on start-up we sometimes query this bloom filter before it is completely populated and we thus fail to retrieve cached entries because we think they don't exist and don't check the disk. This patch adds an "isPopulatingContentsFilter" flag that is turned ON on start up while we are populating the bloon filter. We then bypass the bloom filter and send queries directly to disk on start up if this flag is ON. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::initialize): (WebKit::NetworkCache::Storage::retrieve): (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations): (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation): * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::cacheMayContain): 2015-03-20 Chris Dumez [WK2] Allow stale content when restoring the browser's session state https://bugs.webkit.org/show_bug.cgi?id=142916 Reviewed by Darin Adler. Allow stale content when restoring the browser's session state (restoring all tabs from previous session), e.g. - Via History > Reopen All windows from previous session on Safari - Happens on startup for MobileSafari I have verified that using "Open in tabs" on a bookmarks folder still does fresh loads (rdar://problem/8131355) as it is not using the restoreFromSessionState() code path. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcessForReload): (WebKit::WebPageProxy::reattachToWebProcessWithItem): (WebKit::WebPageProxy::goForward): (WebKit::WebPageProxy::goBack): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::restoreFromSessionState): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::goToBackForwardItem): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2015-03-20 Beth Dakin [Immediate Actions] Should re-enable immediate actions for iBooks https://bugs.webkit.org/show_bug.cgi?id=142915 -and corresponding- rdar://problem/19585689 Reviewed by Tim Horton. * UIProcess/API/mac/WKView.mm: (-[WKView initWithFrame:processPool:configuration:webView:]): 2015-03-20 Alex Christensen Progress towards CMake on Mac. https://bugs.webkit.org/show_bug.cgi?id=136003 Reviewed by Chris Dumez. * PlatformMac.cmake: Add include directories and forwarding headers. * Shared/API/APIObject.h: (API::ObjectImpl::operator new): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: Fix some unused parameter warnings. 2015-03-20 Gyuyoung Kim [CMake] Remove duplicated cmake function calls in WebKit2/CMakeLists.txt https://bugs.webkit.org/show_bug.cgi?id=142901 Reviewed by Csaba Osztrogonác. add_depencencies(), install() can support multiple targets or location. We don't need to call it twice. * CMakeLists.txt: Additionaly move -DBUILDING_WEBKIT to PlatformGTK.cmake, because it is only used by GTK port. 2015-03-20 Zan Dobersek [GTK] Disable accelerated compositing on Wayland https://bugs.webkit.org/show_bug.cgi?id=142877 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseCreateWebPage): As was done in the past, we should disable accelerated compositing on Wayland until the proper support for it lands. 2015-03-19 Andy Estes [Content Filtering] Add tests for unblock requests https://bugs.webkit.org/show_bug.cgi?id=142900 Reviewed by Andreas Kling. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::contentFilterDidBlockLoad. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): Assigned a default-constructed ContentFilterUnblockHandler instead of calling clear(). (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Renamed from contentFilterDidHandleNavigationAction. Updated to use ContentFilterUnblockHandler's new API. (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Deleted. * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::contentFilterDidBlockLoad): Renamed from setContentFilterUnblockHandler. (WebKit::WebFrameProxy::setContentFilterUnblockHandler): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): Called WebFrameProxy::didHandleContentFilterUnblockNavigation. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): If the unblock handler needs the UI process, send WebPageProxy::ContentFilterDidBlockLoadForFrame. Oterwise, call PolicyChecker::setContentFilterUnblockHandler. 2015-03-20 Zan Dobersek [GTK] Properly guard X11-specific code in BackingStore::createBackend() https://bugs.webkit.org/show_bug.cgi?id=142875 Reviewed by Martin Robinson. * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::BackingStore::createBackend): Guard the GTK- and X11-specific bit of code with PLATFORM(GTK) and PLATFORM(X11). Testing GDK_WINDOWING_X11 ensures that the GTK+ dependency has X11 support, but does not ensure that WebKitGTK+ has been configured to build for X11 environments (which is what PLATFORM(X11) ensures). 2015-03-19 Chris Dumez [WK2] We should allow stale content when restoring a killed / crashed WebProcess https://bugs.webkit.org/show_bug.cgi?id=142893 Reviewed by Antti Koivisto. Allow stale content when restoring a killed / crashed WebProcess (similarly to a history navigation). This is actually what was intended as we call WebPage::goToBackForwardItem() in this case, which uses IndexedBackForward load type. However, this value was then ignored in FrameLoader::loadDifferentDocumentItem(). This patch gets rid of the special casing in FrameLoader::loadDifferentDocumentItem() and makes it clear at call sites when calling goToBackForwardItem() if we should allow stale content or not. If goToBackForwardItem() is called with the allowStaleContent flag off, we'll keep using the IndexedBackForward frame load type. However, if the flag is on, we'll use the Standard frame load type and do a fresh load. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcessForReload): Set allowStaleContent flag to true as we want to allow stale content when reloading a WebProcess after it crashed or was killed (behavior change). (WebKit::WebPageProxy::reattachToWebProcessWithItem): Add allowStaleContent parameter so that call sites can decide which policy to use. (WebKit::WebPageProxy::goForward): (WebKit::WebPageProxy::goBack): Set allowStaleContent flag to true as this is our policy for history navigations. (WebKit::WebPageProxy::goToBackForwardItem): Add allowStaleContent parameter so that the call site can let us know what to do. This is useful as this is called not only for indexed back / forward navigations (allowing stale content) but also for restoring session state (forbidding state content: ). (WebKit::WebPageProxy::restoreFromSessionState): Call goToBackForwardItem() with allowStaleContent flag set to false as users expect fresh contents in this case. This method is called when: - Tabs are restored on Safari / MobileSafari startup - Tabs are restored via "History > Reopen All windows from last session" * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::goToBackForwardItem): Add allowStaleContent parameter and use "Standard" frame load type instead of "IndexedBackForward" if it is false. This is needed as "IndexedBackForward" frame load type allows using stale content. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Add allowStaleContent flag to GoToBackForwardItem message. 2015-03-19 Eric Carlson [Mac] Move MediaPlaybackTargetPicker https://bugs.webkit.org/show_bug.cgi?id=142889 Move WebMediaPlaybackTargetPickerProxy to WebCore so it can be used by both WK2 and WK1. Reviewed by Tim Horton. * UIProcess/PageClient.h: * UIProcess/WebMediaPlaybackTargetPickerProxy.cpp: Removed. * UIProcess/WebMediaPlaybackTargetPickerProxy.h: Removed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::devicePickerProxy): * UIProcess/WebPageProxy.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::createPlaybackTargetPicker): * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Removed. * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Removed. * WebKit2.xcodeproj/project.pbxproj: 2015-03-19 Jessie Berlin 32-bit build fix after r181770. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController initWithWindow:webView:]): 2015-03-19 Anders Carlsson Add support for deleting individual cache entries https://bugs.webkit.org/show_bug.cgi?id=142886 Reviewed by Antti Koivisto. * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): Remove an unnecessary call to cfURLCacheOrigins(). (WebKit::clearDiskCacheEntries): Helper function for clearing disk cache entries. This handles both the old and new cache implementations. (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): Call clearDiskCacheEntries if needed. 2015-03-19 Jer Noble [WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished". https://bugs.webkit.org/show_bug.cgi?id=142132 Reviewed by Tim Horton. Use CALayer animations for the transition into and out of fullscreen. The fullscreen transition consists of three separate animations: 1. An opacity animation for the black backdrop behind the fullscreen content 2. A scale/translation animation from fullscreen element's initial screen to its final one. 3. A clip animation from the fullscreen element's initial aspect ratio to its final one. The opacity animation will apply to the fullscreen window's content view's layer's background color. To separately animate the transform and mask of the web view's content, a layer-backed subview is added to the content view, and the scale/translation & clip animations are applied to its transform property and mask layer respectively. Utility methods to create each animation have been added, and each includes a parameter for the direction of the animation, so that the same methods can be used for entering and exiting fullscreen transitions. The user-visible changes to this new transition are when the aspect ratios of the initial and final screen locations are different: previously the transition would use a scale transform to "squish" the fullscreen content into the initial aspect ratio. The new transition instead "clips" the fullscreen content to the initial aspect ratio. For common operations such a