diff options
author | Steve Block <steveblock@google.com> | 2011-06-08 08:26:01 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-06-08 08:26:01 -0700 |
commit | 3742ac093d35d923c81693096ab6671e9b147700 (patch) | |
tree | c2add9100f789dad45ef1ec5328bddde02c47a4c /Source/WebKit2 | |
parent | 901401d90459bc22580842455d4588b9a697514d (diff) | |
parent | e5926f4a0d6adc9ad4a75824129f117181953560 (diff) | |
download | external_webkit-3742ac093d35d923c81693096ab6671e9b147700.zip external_webkit-3742ac093d35d923c81693096ab6671e9b147700.tar.gz external_webkit-3742ac093d35d923c81693096ab6671e9b147700.tar.bz2 |
Merge changes I55c6d71a,Ifb3277d4,Ia1b847a2,I7ba9cf3f,Ida2b2a8a,I1280ec90,I72f818d5,I2e3b588b,I9a4e6289,Ia724c78b,Icd8612c8,Ie31b15d7,Ie125edae,I77941a88,I89dae78b,I3516e5ca,I1a4c17b5,I2c4ecc1a,I9c8e6537,Ifac13115,Ie1f80e09,Ia541ed77,I60ce9d78
* changes:
Merge WebKit at r82507: Update ThirdPartyProject.prop
Merge WebKit at r82507: Cherry-pick change r88166 to add INSPECTOR guards to ScriptProfiler
Merge WebKit at r82507: Work around a V8 bug
Merge WebKit at r82507: JNIType renamed to JavaType
Merge WebKit at r82507: IconDatabaseClient interface expanded
Merge WebKit at r82507: Don't use new loss-free code path in HTMLCanvasElement::toDataURL()
Merge WebKit at r82507: IcondDatabaseBase::iconForPageURL() renamed
Merge WebKit at r82507: IconDatabaseBase::Open() signature changed
Merge WebKit at r82507: Node::isContentEditable() renamed
Merge WebKit at r82507: Use icon database through IconDatabaseBase
Merge WebKit at r82507: toInputElement() is now a member of Node
Merge WebKit at r82507: FrameLoaderClient::objectContentType() signature changed
Merge WebKit at r82507: StringImpl::computeHash() removed
Merge WebKit at r82507: Stub out FontPlatformData::setOrientation()
Merge WebKit at r82507: Path::strokeBoundingRect() is now const
Merge WebKit at r82507: Add missing UnusedParam.h include in ApplicationCacheGroup.cpp
Merge WebKit at r82507: Continue to use Android's version of FontPlatformData.h
Merge WebKit at r82507: Update signature of FontCustomPlatformData::fontPlatformData()
Merge WebKit at r82507: Fix conflicts due to JNI refactoring
Merge WebKit at r82507: Fix conflicts due to new StorageTracker
Merge WebKit at r82507: Fix conflicts
Merge WebKit at r82507: Fix makefiles
Merge WebKit at r82507: Initial merge by git
Diffstat (limited to 'Source/WebKit2')
358 files changed, 15435 insertions, 2730 deletions
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index 3ade49a..bacf704 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,4871 @@ +2011-03-30 Ivan Krstić <ike@apple.com> + + Reviewed by Oliver Hunt. + + Ensure consistent, readable working directory for WebProcess before entering sandbox + <rdar://problem/8951176> + + * WebProcess/mac/WebProcessMac.mm: + (WebKit::WebProcess::platformInitializeWebProcess): + +2011-03-30 Sam Weinig <sam@webkit.org> + + Reviewed by Brady Eidson. + + WebKit2: Attempting to view css file from url causes it to download + <rdar://problem/9102611> + https://bugs.webkit.org/show_bug.cgi?id=57501 + + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::canShowMIMEType): + Match WebKit1 by allowing any MIME type that starts with "text/" + except the ones we explicitly blacklist. + +2011-03-30 Steve Falkenburg <sfalken@apple.com> + + Reviewed by Adam Roben. + + Update Windows production build logic for new production configurations + https://bugs.webkit.org/show_bug.cgi?id=57494 + + * win/WebKit2.make: + * win/WebKit2Production.vsprops: + * win/WebKit2WebProcessProduction.vsprops: + +2011-03-30 Steve Falkenburg <sfalken@apple.com> + + Reviewed by Adam Roben. + + Rename Windows configuration Release_LTCG to Production for clarity + https://bugs.webkit.org/show_bug.cgi?id=57465 + + * win/WebKit2.submit.sln: + * win/WebKit2.vcproj: + * win/WebKit2Generated.vcproj: + * win/WebKit2Production.vsprops: Copied from Source/WebKit2/win/WebKit2ReleaseLTCG.vsprops. + * win/WebKit2ReleaseLTCG.vsprops: Removed. + * win/WebKit2WebProcess.vcproj: + * win/WebKit2WebProcessProduction.vsprops: Copied from Source/WebKit2/win/WebKit2WebProcessReleaseLTCG.vsprops. + * win/WebKit2WebProcessReleaseLTCG.vsprops: Removed. + +2011-03-30 Jer Noble <jer.noble@apple.com> + + Reviewed by Dan Bernstein. + + WebKit2: WebProcess is using 89%, while viewing a PDF + https://bugs.webkit.org/show_bug.cgi?id=57471 + + Break a never ending display/update cycle between the UIProcess and the WebProcess + by clearing the dirty region when a page has a custom representation (like a PDF). + Also, avoid the issue where possible by not setting the dirty region in the same case. + + * WebProcess/WebPage/DrawingAreaImpl.cpp: + (WebKit::DrawingAreaImpl::setNeedsDisplay): Bail early if mainFrameHasCustomRepresentation(). + (WebKit::DrawingAreaImpl::scroll): Ditto. + (WebKit::DrawingAreaImpl::display): Both bail early and clear m_dirtyRegion if + mainFrameHasCustomRepresentation(). + +2011-03-30 Sam Weinig <sam@webkit.org> + + Fix Snow Leopard build. + + * UIProcess/mac/WebContextMenuProxyMac.mm: + (WebKit::WebContextMenuProxyMac::showContextMenu): + +2011-03-30 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + WebKit2 contextual menu looks different than the rest of the OS + <rdar://problem/9172935> + https://bugs.webkit.org/show_bug.cgi?id=57475 + + * UIProcess/mac/WebContextMenuProxyMac.mm: + (WebKit::WebContextMenuProxyMac::showContextMenu): + Use correct SPI for showing a context menu. The dummy view is also + not necessary, so remove it. + +2011-03-30 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Crash when NPN_Evaluate removes the plug-in frame + https://bugs.webkit.org/show_bug.cgi?id=57474 + <rdar://problem/9191396> + + Get a reference to the frame since it can be nulled out if running the JavaScript code + causes the plug-in's containing frame to be removed from the frame tree. + + * WebProcess/Plugins/PluginView.cpp: + (WebKit::PluginView::evaluate): + +2011-03-30 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Add default localization strategy that can be shared by WebKit1 and WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=57406 + + * Shared/WebLocalizableStrings.h: Removed. + Removed in favor of using WebCore/LocalizedStrings.h directly. + + * PluginProcess/mac/PluginProcessMac.mm: + * UIProcess/API/mac/WKView.mm: + * UIProcess/mac/WebInspectorProxyMac.mm: + * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: + * WebProcess/mac/WebProcessMac.mm: + Use WebCore/LocalizedStrings.h directly. + + * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: + * WebProcess/WebCoreSupport/WebPlatformStrategies.h: + Remove localization strategy override in favor of using new default implementation. + + * GNUmakefile.am: + * WebKit2.pro: + * WebKit2.xcodeproj/project.pbxproj: + * win/WebKit2.vcproj: + Remove WebLocalizableStrings.h + +2011-03-30 Anders Carlsson <andersca@apple.com> + + Reviewed by Adam Roben. + + Assertion failure in plug-in process when calling WKPluginSiteDataManagerGetSitesWithData + https://bugs.webkit.org/show_bug.cgi?id=57468 + <rdar://problem/9199089> + + Call decrementLoadCount from removeWebProcessConnection instead of startShutdownTimerIfNecessary, + otherwise we'll get a load count underflow when a connection is never created. + + * PluginProcess/PluginProcess.cpp: + (WebKit::PluginProcess::removeWebProcessConnection): + (WebKit::PluginProcess::createWebProcessConnection): + (WebKit::PluginProcess::startShutdownTimerIfNecessary): + +2011-03-30 Jessie Berlin <jberlin@apple.com> + + Reviewed by Anders Carlsson. + + WebKit2: Make sure to try to terminate the Web Process when any work that might require the + Web Process to be relaunched is done + https://bugs.webkit.org/show_bug.cgi?id=57462 + + For the ManagerProxies in the UIProcess, only return true from shouldTerminate if there are + no more callbacks waiting to be invoked. + + For the the Managers in the WebProcess, call WebProcess::shared().terminateIfPossible() when + any work called for by a ManagerProxy function that called relaunchProcessIfNecessary is + finished. + + * UIProcess/WebContext.cpp: + (WebKit::WebContext::shouldTerminate): + Check with each of the ManagerProxies. + + * UIProcess/WebApplicationCacheManagerProxy.cpp: + (WebKit::WebApplicationCacheManagerProxy::shouldTerminate): + * UIProcess/WebApplicationCacheManagerProxy.h: + * UIProcess/WebCookieManagerProxy.cpp: + (WebKit::WebCookieManagerProxy::shouldTerminate): + * UIProcess/WebCookieManagerProxy.h: + * UIProcess/WebDatabaseManagerProxy.cpp: + (WebKit::WebDatabaseManagerProxy::shouldTerminate): + * UIProcess/WebDatabaseManagerProxy.h: + * UIProcess/WebKeyValueStorageManagerProxy.cpp: + (WebKit::WebKeyValueStorageManagerProxy::shouldTerminate): + * UIProcess/WebKeyValueStorageManagerProxy.h: + * UIProcess/WebMediaCacheManagerProxy.cpp: + (WebKit::WebMediaCacheManagerProxy::shouldTerminate): + * UIProcess/WebMediaCacheManagerProxy.h: + * UIProcess/WebResourceCacheManagerProxy.cpp: + (WebKit::WebResourceCacheManagerProxy::shouldTerminate): + * UIProcess/WebResourceCacheManagerProxy.h: + + * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp: + (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins): + (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin): + (WebKit::WebApplicationCacheManager::deleteAllEntries): + * WebProcess/Cookies/WebCookieManager.cpp: + (WebKit::WebCookieManager::getHostnamesWithCookies): + (WebKit::WebCookieManager::deleteCookiesForHostname): + (WebKit::WebCookieManager::deleteAllCookies): + (WebKit::WebCookieManager::startObservingCookieChanges): + (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy): + (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy): + * WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp: + (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins): + (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin): + (WebKit::WebKeyValueStorageManager::deleteAllEntries): + * WebProcess/MediaCache/WebMediaCacheManager.cpp: + (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache): + (WebKit::WebMediaCacheManager::clearCacheForHostname): + (WebKit::WebMediaCacheManager::clearCacheForAllHostnames): + * WebProcess/ResourceCache/WebResourceCacheManager.cpp: + (WebKit::WebResourceCacheManager::getCacheOrigins): + (WebKit::WebResourceCacheManager::clearCacheForOrigin): + (WebKit::WebResourceCacheManager::clearCacheForAllOrigins): + * WebProcess/WebCoreSupport/WebDatabaseManager.cpp: + (WebKit::WebDatabaseManager::getDatabasesByOrigin): + (WebKit::WebDatabaseManager::getDatabaseOrigins): + (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin): + (WebKit::WebDatabaseManager::deleteDatabasesForOrigin): + (WebKit::WebDatabaseManager::deleteAllDatabases): + (WebKit::WebDatabaseManager::setQuotaForOrigin): + +2011-03-30 Adam Roben <aroben@apple.com> + + Mac build fix after r82442 + + * WebProcess/Plugins/PluginProxy.cpp: + (WebKit::PluginProxy::geometryDidChange): Added a missing argument. + +2011-03-29 Adam Roben <aroben@apple.com> + + Add a way to specify that a ShareableBitmap has no alpha channel + + Before this patch, all ShareableBitmaps had an alpha channel. With this patch, all + ShareableBitmaps *still* have an alpha channel. But now there's a way to specify you don't + want one (which will be used in the future)! + + Fixes <http://webkit.org/b/57388> Need a way to specify that a ShareableBitmap has no alpha + channel + + Reviewed by Anders Carlsson. + + * Shared/ShareableBitmap.cpp: + (WebKit::ShareableBitmap::Handle::Handle): Moved here from the header file, and added + initialization of m_flags. + + (WebKit::ShareableBitmap::Handle::encode): + (WebKit::ShareableBitmap::Handle::decode): + Encode/decode m_flags. + + (WebKit::ShareableBitmap::create): + (WebKit::ShareableBitmap::createShareable): + Pass along the new Flags argument. + + (WebKit::ShareableBitmap::createHandle): Store our Flags on the Handle. + (WebKit::ShareableBitmap::ShareableBitmap): Store the Flags in m_flags. + + * Shared/ShareableBitmap.h: Added Flag, Flags, and m_flags, and added a Flags argument to + some create functions. + + * Shared/WebCoreArgumentCoders.cpp: + (CoreIPC::encodeImage): + * Shared/WebImage.cpp: + (WebKit::WebImage::create): + Specify that we want a bitmap that supports alpha to maintain current behavior. + + * Shared/cg/ShareableBitmapCG.cpp: + (WebKit::bitmapInfo): New helper function. Includes an alpha channel only if specified in + the flags. + + (WebKit::ShareableBitmap::createGraphicsContext): + (WebKit::ShareableBitmap::makeCGImage): + Use the new helper function. + + * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: + (WebKit::NetscapePlugin::snapshot): + * WebProcess/Plugins/PluginProxy.cpp: + (WebKit::PluginProxy::geometryDidChange): + * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: + (WebKit::convertImageToBitmap): + * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: + (WebKit::WebPopupMenu::setUpPlatformData): + * WebProcess/WebPage/DrawingAreaImpl.cpp: + (WebKit::DrawingAreaImpl::display): + * WebProcess/WebPage/FindController.cpp: + (WebKit::FindController::updateFindIndicator): + Specify that we want a bitmap that supports alpha to maintain current behavior. + +2011-03-29 Adam Roben <aroben@apple.com> + + Add ShareableBitmap::Handle + + This object is used for encoding/decoding a ShareableBitmap via CoreIPC. It currently just + encapsulates a SharedMemory::Handle (which is what we were using previously) and the image's + size (which means callers no longer need to deal with the size explicitly), but in the + future could be used to store more information about the bitmap. + + This should cause no behavior changes. + + Fixes <http://webkit.org/b/57397> ShareableBitmap needs its own Handle type + + Reviewed by Anders Carlsson. + + * PluginProcess/PluginControllerProxy.cpp: + (WebKit::PluginControllerProxy::geometryDidChange): No longer need to pass a size to create, + since the Handle records the size. + (WebKit::PluginControllerProxy::snapshot): No longer need the bufferSize argument, since the + Handle records the size. + + * PluginProcess/PluginControllerProxy.h: + * PluginProcess/PluginControllerProxy.messages.in: + Updated Handle types and removed unnecessary size argument to Snapshot. + + * Shared/PlatformPopupMenuData.cpp: + (WebKit::PlatformPopupMenuData::encode): + (WebKit::PlatformPopupMenuData::decode): + * Shared/PlatformPopupMenuData.h: + Changed to use ShareableBitmap::Handle and removed m_backingStoreSize, which is now stored + in the Handles. + + * Shared/ShareableBitmap.cpp: + (WebKit::ShareableBitmap::Handle::encode): + (WebKit::ShareableBitmap::Handle::decode): + Simple encode/decode functions. + + (WebKit::ShareableBitmap::create): Get the size from the Handle instead of as a separate + argument. + (WebKit::ShareableBitmap::createHandle): Store our size in the Handle. + + * Shared/ShareableBitmap.h: Added ShareableBitmap::Handle and made some functions use it. + + * Shared/UpdateInfo.h: Changed to use ShareableBitmap::Handle. + + * Shared/UserMessageCoders.h: + (WebKit::UserMessageEncoder::baseEncode): + (WebKit::UserMessageDecoder::baseDecode): + * Shared/WebCoreArgumentCoders.cpp: + (CoreIPC::encodeImage): + (CoreIPC::decodeImage): + Use the size stored in the Handle instead of encoding/decoding one separately. + + * UIProcess/API/mac/PageClientImpl.h: + * UIProcess/API/mac/PageClientImpl.mm: + (WebKit::PageClientImpl::setDragImage): + Removed the unnecessary imageSize argument. We can get it from the image itself. + + * UIProcess/BackingStore.cpp: + (WebKit::BackingStore::incorporateUpdate): + * UIProcess/FindIndicator.cpp: + (WebKit::FindIndicator::create): + No longer need to pass a size when creating a ShareableBitmap from a Handle. + + * UIProcess/FindIndicator.h: Changed to use ShareableBitmap::Handle. + + * UIProcess/PageClient.h: Removed unnecessary imageSize argument from setDragImage. + + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::setFindIndicator): + * UIProcess/WebPageProxy.h: + * UIProcess/WebPageProxy.messages.in: + * UIProcess/mac/WebPageProxyMac.mm: + (WebKit::WebPageProxy::setDragImage): + * WebProcess/Plugins/PluginProxy.cpp: + (WebKit::PluginProxy::snapshot): + (WebKit::PluginProxy::geometryDidChange): + * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: + (WebKit::WebDragClient::startDrag): + Changed to use ShareableBitmap::Handle and removed now-unnecessary size arguments (since we + can get the size from the Handle). + + * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: + (WebKit::WebPopupMenu::setUpPlatformData): Don't need to store the backing store size in the + data anymore; the Handles will make sure it reaches the other process. + + * WebProcess/WebPage/FindController.cpp: + (WebKit::FindController::updateFindIndicator): + (WebKit::FindController::hideFindIndicator): + Changed to use ShareableBitmap::Handle. + +2011-03-30 Alejandro G. Castro <alex@igalia.com> + + Fix GTK build after r81980. + + * GNUmakefile.am: + +2011-03-29 Beth Dakin <bdakin@apple.com> + + Reviewed by Maciej Stachowiak. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=57408 + webkit-min-device-pixel-ratio media query doesn't work post-SnowLeopard + -and corresponding- + <rdar://problem/8665411> + + * Shared/WebPageCreationParameters.cpp: + (WebKit::WebPageCreationParameters::encode): + (WebKit::WebPageCreationParameters::decode): + * Shared/WebPageCreationParameters.h: + * UIProcess/API/mac/PageClientImpl.h: + * UIProcess/API/mac/PageClientImpl.mm: + (WebKit::PageClientImpl::userSpaceScaleFactor): + * UIProcess/API/qt/qwkpage_p.h: + (QWKPagePrivate::userSpaceScaleFactor): + * UIProcess/PageClient.h: + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::creationParameters): + * UIProcess/gtk/WebView.h: + (WebKit::WebView::userSpaceScaleFactor): + * UIProcess/win/WebView.h: + (WebKit::WebView::userSpaceScaleFactor): + * WebProcess/WebCoreSupport/WebChromeClient.cpp: + (WebKit::WebChromeClient::scaleFactor): + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::WebPage): + * WebProcess/WebPage/WebPage.h: + (WebKit::WebPage::userSpaceScaleFactor): + +2011-03-29 Brent Fulgham <bfulgham@webkit.org> + + Unreviewed WinCairo build fix. + + Bring DownloadCurl implementation stubs in line with current + CFNetwork API. + + * WebProcess/Downloads/curl/DownloadCurl.cpp: + (WebKit::Download::receivedCredential): + (WebKit::Download::receivedRequestToContinueWithoutCredential): + (WebKit::Download::receivedCancellation): + +2011-03-29 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Darin Adler. + + AX: WK2: When creating the window remote token, use what's returned from accessibility + https://bugs.webkit.org/show_bug.cgi?id=57398 + + This will allow a specific WKView to override what's used for the window attribute of the + HTML elements. + + * UIProcess/API/mac/WKView.mm: + (-[WKView viewDidMoveToWindow]): + +2011-03-29 Jeff Miller <jeffm@apple.com> + + Reviewed by Sam Weinig. + + Make Windows-only InjectedBundle functions platform-specific + https://bugs.webkit.org/show_bug.cgi?id=57385 + + Added files for Windows-specific WKBundle functions. + Removed stub wrappers for InjectedBundle::setHostAllowsAnyHTTPSCertificate() and InjectedBundle::setClientCertificate() from non-Windows platforms. + + * WebProcess/InjectedBundle/API/c/WKBundle.cpp: Moved WKBundleSetHostAllowsAnyHTTPSCertificate() and WKBundleSetClientCertificate() to WKBundlePrivateWin.cpp. + * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Moved WKBundleSetHostAllowsAnyHTTPSCertificate() and WKBundleSetClientCertificate() to WKBundlePrivateWin.h. + * WebProcess/InjectedBundle/API/c/win: Added. + * WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp: Added. + (WKBundleSetHostAllowsAnyHTTPSCertificate): Moved from WKBundle.cpp. + (WKBundleSetClientCertificate): Moved from WKBundle.cpp. + * WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h: Added. + * WebProcess/InjectedBundle/InjectedBundle.h: setHostAllowsAnyHTTPSCertificate() and setClientCertificate() are Windows-only. + * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp: Removed setHostAllowsAnyHTTPSCertificate() and setClientCertificate(). + * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp: Removed setHostAllowsAnyHTTPSCertificate() and setClientCertificate(). + * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp: Removed setHostAllowsAnyHTTPSCertificate() and setClientCertificate(). + * win/WebKit2.vcproj: Added WKBundlePrivateWin.cpp and WKBundlePrivateWin.h. + * win/WebKit2Generated.make: Copy WKBundlePrivateWin.h. + +2011-03-29 Anders Carlsson <andersca@apple.com> + + Fix Windows build. + + * WebProcess/Downloads/cfnet/DownloadCFNet.cpp: + (WebKit::Download::receivedCredential): + (WebKit::Download::receivedRequestToContinueWithoutCredential): + (WebKit::Download::receivedCancellation): + +2011-03-29 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Downloads: Authentication support + https://bugs.webkit.org/show_bug.cgi?id=57403 + <rdar://problem/8691166> + + * UIProcess/API/C/WKContext.h: + Add didReceiveAuthenticationChallenge callback. + + * UIProcess/Downloads/DownloadProxy.cpp: + (WebKit::DownloadProxy::didReceiveAuthenticationChallenge): + Call the download client. + + * UIProcess/Downloads/DownloadProxy.messages.in: + Add DidReceiveAuthenticationChallenge message. + + * UIProcess/WebDownloadClient.cpp: + (WebKit::WebDownloadClient::didReceiveAuthenticationChallenge): + Call the client callback function. + + * UIProcess/WebDownloadClient.h: + * WebProcess/Authentication/AuthenticationManager.cpp: + (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): + Send the DidReceiveAuthenticationChallenge message to the download proxy. + + (WebKit::AuthenticationManager::useCredentialForChallenge): + (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge): + (WebKit::AuthenticationManager::cancelChallenge): + If the authentication client is null, call the static download member functions. + + * WebProcess/Authentication/AuthenticationManager.h: + * WebProcess/Downloads/Download.cpp: + (WebKit::Download::didReceiveAuthenticationChallenge): + Call the authentication manager. + + * WebProcess/Downloads/Download.h: + * WebProcess/Downloads/mac/DownloadMac.mm: + (WebKit::Download::receivedCredential): + (WebKit::Download::receivedRequestToContinueWithoutCredential): + (WebKit::Download::receivedCancellation): + Call the right sender methods. + + (-[WKDownloadAsDelegate download:didReceiveAuthenticationChallenge:]): + (-[WKDownloadAsDelegate downloadShouldUseCredentialStorage:]): + Call the right Download member functions. + + * WebProcess/Downloads/qt/DownloadQt.cpp: + (WebKit::Download::receivedCredential): + (WebKit::Download::receivedRequestToContinueWithoutCredential): + (WebKit::Download::receivedCancellation): + * WebProcess/Downloads/soup/DownloadSoup.cpp: + (WebKit::Download::receivedCredential): + (WebKit::Download::receivedRequestToContinueWithoutCredential): + (WebKit::Download::receivedCancellation): + Add stubs. + +2011-03-29 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + AuthenticationChallengeProxy objects should be associated with processes, not pages + https://bugs.webkit.org/show_bug.cgi?id=57401 + + * UIProcess/Authentication/AuthenticationChallengeProxy.cpp: + (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy): + (WebKit::AuthenticationChallengeProxy::~AuthenticationChallengeProxy): + (WebKit::AuthenticationChallengeProxy::useCredential): + (WebKit::AuthenticationChallengeProxy::cancel): + * UIProcess/Authentication/AuthenticationChallengeProxy.h: + (WebKit::AuthenticationChallengeProxy::create): + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): + +2011-03-29 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Use LocalizedStrings.h as a bottleneck for localized strings instead of + using UI_STRING. + + * UIProcess/API/mac/WKView.mm: + (-[WKView validateUserInterfaceItem:]): + Call existing localization functions instead of using UI_STRING. + + (-[WKView _getTextInputState:selectionEnd:underlines:]): + Remove unnecessary WebCore:: prefix. + +2011-03-29 Chang Shu <cshu@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + WebKitTestRunner needs layoutTestController.setAllowUniversalAccessFromFileURLs + https://bugs.webkit.org/show_bug.cgi?id=42692 + + * Shared/WebPreferencesStore.cpp: + (WebKit::WebPreferencesStore::decode): + (WebKit::WebPreferencesStore::overrideAllowUniversalAccessFromFileURLsForTestRunner): + * Shared/WebPreferencesStore.h: + * WebProcess/InjectedBundle/API/c/WKBundle.cpp: + (WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner): + * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: + * WebProcess/InjectedBundle/InjectedBundle.cpp: + (WebKit::InjectedBundle::overrideAllowUniversalAccessFromFileURLsForTestRunner): + * WebProcess/InjectedBundle/InjectedBundle.h: + +2011-03-29 Timothy Hatcher <timothy@apple.com> + + Update the order of the context menu to better match AppKit on Mac. + + <rdar://problem/9054893> + + Reviewed by John Sullivan. + + * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: + (WebKit::WebPlatformStrategies::contextMenuItemTagLookUpInDictionary): Added argument for selected string. + * WebProcess/WebCoreSupport/WebPlatformStrategies.h: + +2011-03-29 Jeff Miller <jeffm@apple.com> + + Fix formatting of WebKit2.vcproj after r82283. + + * win/WebKit2.vcproj: + +2011-03-29 Martin Robinson <mrobinson@igalia.com> + + [GTK] Build failed with ‘GDK_KEY_KP_Space’ was not declared in this scope + https://bugs.webkit.org/show_bug.cgi?id=55314 + + Build fix for older versions of GTK+. Use the deprecated names for GDK key + defines and include GtkVersioning.h to allow building on newer versions + of GTK+. + + * Shared/gtk/WebEventFactory.cpp: + (WebKit::isGdkKeyCodeFromKeyPad): Update key defines. + +2011-03-29 Steve Falkenburg <sfalken@apple.com> + + Reviewed by Darin Adler. + + Use per-configuration vsprops in WebKit to avoid WebKitVSPropsRedirectionDir removal by MSVC IDE + https://bugs.webkit.org/show_bug.cgi?id=57383 + + Visual Studio's IDE was removing instances of $(WebKitVSPropsRedirectionDir) from + InheritedPropertySheet rules in our vcproj files when the vcproj was edited from within + the IDE. To avoid this, add a separate vsprops file for each project configuration that + contains the required inherited property sheets. + + * win/WebKit2.vcproj: + * win/WebKit2Debug.vsprops: Added. + * win/WebKit2DebugAll.vsprops: Added. + * win/WebKit2DebugCairoCFLite.vsprops: Added. + * win/WebKit2Release.vsprops: Added. + * win/WebKit2ReleaseCairoCFLite.vsprops: Added. + * win/WebKit2ReleaseLTCG.vsprops: Added. + * win/WebKit2WebProcess.vcproj: + * win/WebKit2WebProcessDebug.vsprops: Added. + * win/WebKit2WebProcessDebugAll.vsprops: Added. + * win/WebKit2WebProcessDebugCairoCFLite.vsprops: Added. + * win/WebKit2WebProcessRelease.vsprops: Added. + * win/WebKit2WebProcessReleaseCairoCFLite.vsprops: Added. + * win/WebKit2WebProcessReleaseLTCG.vsprops: Added. + +2011-03-29 Jessie Berlin <jberlin@apple.com> + + Reviewed by Anders Carlsson. + + WebKit2: The WebProcess should be relaunched if necessary when WebKit2 is asked for + information about Cookies, Databases, Local Storage, etc. + https://bugs.webkit.org/show_bug.cgi?id=57374 + + Instead of bailing when the WebProcess is not valid, call relaunchProcessIfNecessary(). + + * UIProcess/Plugins/WebPluginSiteDataManager.cpp: + (WebKit::WebPluginSiteDataManager::getSitesWithData): + (WebKit::WebPluginSiteDataManager::clearSiteData): + * UIProcess/WebApplicationCacheManagerProxy.cpp: + (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins): + (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin): + (WebKit::WebApplicationCacheManagerProxy::deleteAllEntries): + * UIProcess/WebCookieManagerProxy.cpp: + (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): + (WebKit::WebCookieManagerProxy::deleteCookiesForHostname): + (WebKit::WebCookieManagerProxy::deleteAllCookies): + (WebKit::WebCookieManagerProxy::startObservingCookieChanges): + (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): + (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): + * UIProcess/WebDatabaseManagerProxy.cpp: + (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin): + (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins): + (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin): + (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin): + (WebKit::WebDatabaseManagerProxy::deleteAllDatabases): + (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin): + * UIProcess/WebKeyValueStorageManagerProxy.cpp: + (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins): + (WebKit::WebKeyValueStorageManagerProxy::deleteEntriesForOrigin): + (WebKit::WebKeyValueStorageManagerProxy::deleteAllEntries): + * UIProcess/WebMediaCacheManagerProxy.cpp: + (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache): + (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname): + (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames): + * UIProcess/WebResourceCacheManagerProxy.cpp: + (WebKit::WebResourceCacheManagerProxy::getCacheOrigins): + (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin): + (WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins): + +2011-03-29 Jeff Miller <jeffm@apple.com> + + Reviewed by Darin Adler. + + WebKit2: Support setting the client certificate on Windows + https://bugs.webkit.org/show_bug.cgi?id=57368 + + Allow setting the client certificate for a host via the injected bundle. + This requires the ability for Webkit2 Windows clients to create a WKCertificateInfo from a PCCERT_CONTEXT so they can send it to the web process. + + * Shared/API/c/win/WKCertificateInfoWin.cpp: + (WKCertificateInfoCreateWithCertificate): Added. + * Shared/API/c/win/WKCertificateInfoWin.h: Added WKCertificateInfoCreateWithCertificate(). + * WebProcess/InjectedBundle/API/c/WKBundle.cpp: + (WKBundleSetClientCertificate): Added. + * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Added WKBundleSetClientCertificate(). + * WebProcess/InjectedBundle/InjectedBundle.h: Added setClientCertificate(). + * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp: + (WebKit::InjectedBundle::setClientCertificate): Added, should never be called. + * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp: + (WebKit::InjectedBundle::setClientCertificate): Added, should never be called. + * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp: + (WebKit::InjectedBundle::setClientCertificate): Added, should never be called. + * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: + (WebKit::InjectedBundle::setClientCertificate): Added. + +2011-03-29 Timothy Hatcher <timothy@apple.com> + + Make WebKit2 work with update-webkit-localizable-strings. + + https://webkit.org/b/57354 + + Reviewed by Sam Weinig. + + * PluginProcess/mac/PluginProcessMac.mm: Remove UI_STRING macro. Use WebLocalizableStrings.h. + * Shared/WebLocalizableStrings.h: Added. + * UIProcess/API/mac/WKView.mm: Remove UI_STRING macro. Use WebLocalizableStrings.h. + * UIProcess/mac/WebInspectorProxyMac.mm: + (WebKit::WebInspectorProxy::platformInspectedURLChanged): Use UI_STRING. Remove FIXME. + * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Remove UI_STRING macros. + Use WebLocalizableStrings.h. + * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: + (registerErrors): Remove UI_STRING macro. Use WebLocalizableStrings.h. + * WebProcess/mac/WebProcessMac.mm: + (WebKit::WebProcess::platformInitializeWebProcess): Use UI_STRING. Remove FIXME. + + * GNUmakefile.am: Added Shared/WebLocalizableStrings.h. + * WebKit2.pro: Ditto. + * WebKit2.xcodeproj/project.pbxproj: Ditto. + * win/WebKit2.vcproj: Ditto. + +2011-03-29 Jeff Miller <jeffm@apple.com> + + Reviewed by Darin Adler. + + CoreIPC::decodeResourceError() leaks a CFDataRef + https://bugs.webkit.org/show_bug.cgi?id=57366 + + * Shared/win/WebCoreArgumentCodersWin.cpp: + (CoreIPC::decodeResourceError): Don't leak the result of WebCore::copyCertificateToData(), since the ResourceError will retain it. + +2011-03-29 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Allow the AppleConnect plug-in to use the QuickDraw drawing model + https://bugs.webkit.org/show_bug.cgi?id=57365 + <rdar://problem/8712320> + + * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: + (WebKit::NetscapePluginModule::determineQuirks): + * Shared/Plugins/PluginQuirks.h: + * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: + (WebKit::NetscapePlugin::platformPostInitialize): + +2011-03-29 Darin Adler <darin@apple.com> + + Reviewed by Adam Roben. + + WebKit2 bundle page needs to offer generated file hooks + https://bugs.webkit.org/show_bug.cgi?id=57279 + + * WebProcess/InjectedBundle/API/c/WKBundlePage.h: Added shouldGenerateFileForUpload and + generateFileForUpload callback pointers. + + * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: + (WebKit::InjectedBundlePageUIClient::shouldGenerateFileForUpload): Added. + (WebKit::InjectedBundlePageUIClient::generateFileForUpload): Added. + * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: Added functions above. + + * WebProcess/WebCoreSupport/WebChromeClient.cpp: + (WebKit::WebChromeClient::shouldReplaceWithGeneratedFileForUpload): Implemented by + calling the functions above. + (WebKit::WebChromeClient::generateReplacementFile): Ditto. + +2011-03-29 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + Assertion failure in plug-in process with clang-built 32/64-bit WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=57359 + + Don't use __alignof when encoding and decoding scalar types. + + Darwin 32-bit, double and unsigned long long are 4-byte aligned but on 64-bit they're + 8-byte aligned which causes problems when doing IPC between 32-bit and 64-bit processes. + GCC is buggy and returns 8, but clang is correct and returns 4. Use sizeof instead which we know + is equal to or greater than the alignment. + + * Platform/CoreIPC/ArgumentDecoder.cpp: + (CoreIPC::ArgumentDecoder::decodeBool): + (CoreIPC::ArgumentDecoder::decodeUInt32): + (CoreIPC::ArgumentDecoder::decodeUInt64): + (CoreIPC::ArgumentDecoder::decodeInt32): + (CoreIPC::ArgumentDecoder::decodeInt64): + (CoreIPC::ArgumentDecoder::decodeFloat): + (CoreIPC::ArgumentDecoder::decodeDouble): + * Platform/CoreIPC/ArgumentEncoder.cpp: + (CoreIPC::ArgumentEncoder::encodeBool): + (CoreIPC::ArgumentEncoder::encodeUInt32): + (CoreIPC::ArgumentEncoder::encodeUInt64): + (CoreIPC::ArgumentEncoder::encodeInt32): + (CoreIPC::ArgumentEncoder::encodeInt64): + (CoreIPC::ArgumentEncoder::encodeFloat): + (CoreIPC::ArgumentEncoder::encodeDouble): + +2011-03-29 Brent Fulgham <bfulgham@webkit.org> + + Unreviewed build fix after r81928. + + * win/WebKit2.vcproj: Don't build CG-specific icon routines + for WinCairo port. + +2011-03-29 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Reproducible crash running under libgmalloc, in -[WKView(Internal) removeTrackingRect:] --> objc_assign_ivar_non_gc + <rdar://problem/9193352> + https://bugs.webkit.org/show_bug.cgi?id=57358 + + -[WKView removeTrackingRect] can be called from below -[WKView dealloc] after we have + destroyed _data. So, nil out _data after releasing it and nil check it appropriately. + + * UIProcess/API/mac/WKView.mm: + (-[WKView dealloc]): + Nil out _data after releasing it. + + (-[WKView removeTrackingRect:]): + Add early return for nil _data. + +2011-03-29 Jeff Miller <jeffm@apple.com> + + Reviewed by Jon Honeycutt. + + Add WebCore::copyCertificateToData() on Windows + https://bugs.webkit.org/show_bug.cgi?id=57296 + + Remove duplicate code that implemented this functionality in WebCoreArgumentCodersWin.cpp and use WebCore::copyCertificateToData() instead. + + * Shared/win/WebCoreArgumentCodersWin.cpp: + (CoreIPC::decodeResourceError): Use WebCore::copyCertificateToData(). + +2011-03-29 Balazs Kelemen <kbalazs@webkit.org> + + Unreviewed build fix (64 bit gcc). + + GCC does not accept uint64_t formatted as %lli. + + * UIProcess/WebIconDatabase.cpp: + (WebKit::WebIconDatabase::getLoadDecisionForIconURL): Add explicit cast to long long. + +2011-03-28 Maciej Stachowiak <mjs@apple.com> + + Reviewed by Dan Bernstein. + + WKPageGetSourceForFrame and WKPageGetContentsAsString should throw an error in case of a race with page loading + https://bugs.webkit.org/show_bug.cgi?id=57305 + <rdar://problem/8738060>, <rdar://problem/8780168> + + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::close): Clear m_loadDependentStringCallbackIDs + (WebKit::WebPageProxy::getSourceForFrame): track the callback as load dependent + (WebKit::WebPageProxy::getContentsAsString): ditto + (WebKit::WebPageProxy::clearLoadDependentCallbacks): Invalidate all load dependent callbacks + (WebKit::WebPageProxy::didCommitLoadForFrame): Call clearLoadDependentCallbacks + (WebKit::WebPageProxy::didFailLoadForFrame): ditto + (WebKit::WebPageProxy::stringCallback): Remove callback from load dependent set if appropriate + (WebKit::WebPageProxy::processDidCrash): Clear m_loadDependentStringCallbackIDs + * UIProcess/WebPageProxy.h: Add m_loadDependentStringCallbackIDs hash set. + +2011-03-28 Patrick Gansterer <paroga@webkit.org> + + Reviewed by Darin Adler. + + Use String instead of CString as return value of openTemporaryFile + https://bugs.webkit.org/show_bug.cgi?id=55332 + + * Shared/WebMemorySampler.cpp: + (WebKit::WebMemorySampler::initializeTempLogFile): + * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: + (WebKit::NetscapePluginStream::stop): + * WebProcess/Plugins/Netscape/NetscapePluginStream.h: + +2011-03-28 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Jon Honeycutt. + + WebKit2: Downloads started with DownloadCFNet::start never start + https://bugs.webkit.org/show_bug.cgi?id=57268 + + * WebProcess/Downloads/cfnet/DownloadCFNet.cpp: + (WebKit::Download::start): Call CFURLDownloadStart on the download we create. + +2011-03-28 Anders Carlsson <andersca@apple.com> + + Fix Windows build. + + * Shared/ShareableBitmap.h: + +2011-03-28 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Beep when pressing a menu key equivalent when a plug-in has focus + https://bugs.webkit.org/show_bug.cgi?id=57264 + <rdar://problem/8935597> + + We don't want the WKTextInputWindowController inputContext to be involved in interpretKeyEvents. + + * UIProcess/API/mac/WKView.mm: + (-[WKView inputContext]): + +2011-03-28 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + CGImageRefs must hold a strong reference to underlying data + https://bugs.webkit.org/show_bug.cgi?id=57263 + <rdar://problem/9146179> + + Make paintBitmapContext use CGBitmapContextCreateImage, which creates a copy-on-write copy + of the bitmap data. Also, add ShareableBitmap::makeCGImageCopy which does the same thing, and + ShareableBitmap::makeCGImage in the cases where we know that the ShareableBitmap data will never change. + + * Platform/cg/CGUtilities.cpp: + (WebKit::paintImage): + Factor image painting code out into a separate function. + + (WebKit::paintBitmapContext): + Call paintImage. + + * Shared/API/c/cg/WKImageCG.cpp: + (WKImagemakeCGImage): + Use ShareableBitmap::makeCGImageCopy. + + * Shared/ShareableBitmap.h: + * Shared/cg/ShareableBitmapCG.cpp: + (WebKit::ShareableBitmap::createGraphicsContext): + (WebKit::ShareableBitmap::paint): + (WebKit::ShareableBitmap::makeCGImageCopy): + (WebKit::ShareableBitmap::makeCGImage): + (WebKit::ShareableBitmap::releaseBitmapContextData): + (WebKit::ShareableBitmap::releaseDataProviderData): + Add makeCGImage and makeCGImageCopy. + + * Shared/cg/WebCoreArgumentCodersCG.cpp: + (CoreIPC::createImage): + Use ShareableBitmap::makeCGImage. + + * UIProcess/API/mac/PageClientImpl.mm: + (WebKit::PageClientImpl::setDragImage): + Use ShareableBitmap::makeCGImage and plug a CGImageRef leak. + +2011-03-28 Alexey Proskuryakov <ap@apple.com> + + Build fix. + + * UIProcess/API/mac/WKView.mm: (-[WKView keyDown:]): It's not "event" in this function, it's + "theEvent". + +2011-03-28 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=57260 + Clean up text input code a little + + * UIProcess/API/mac/WKView.mm: + (-[WKView doCommandBySelector:]): This NSTextInput protocol method lacked a LOG() call. + (-[WKView keyDown:]): Added (possibly useless) event protection to match performKeyEquivalent: + and also WebKit1. + + * WebProcess/WebPage/mac/WebPageMac.mm: Removed an obsolete comment. + +2011-03-28 Jeff Miller <jeffm@apple.com> + + Reviewed by Adam Roben. + + ResourceError::certificate() should return a PCCERT_CONTEXT + https://bugs.webkit.org/show_bug.cgi?id=57262 + + * Shared/win/PlatformCertificateInfo.cpp: + (WebKit::PlatformCertificateInfo::PlatformCertificateInfo): Don't assert if no PCCERT_CONTEXT is specified. + * Shared/win/WebCoreArgumentCodersWin.cpp: + (CoreIPC::encodeResourceError): Removed unneeded code now that ResourceError::certificate() returns a PCCERT_CONTEXT. + +2011-03-28 Jeff Miller <jeffm@apple.com> + + Rubber-stamped by Adam Roben. + + Remove unused CFErrorRef. + + * Shared/win/WebCoreArgumentCodersWin.cpp: + (CoreIPC::encodeResourceError): Remove unused CFErrorRef. + +2011-03-28 Jeff Miller <jeffm@apple.com> + + Reviewed by Adam Roben. + + Include certificate when sending a WebCore::ResourceError to UI process on Windows + https://bugs.webkit.org/show_bug.cgi?id=57195 + + Add support for sending the certificate with the WebCore::ResourceError. + + * Shared/win/WebCoreArgumentCodersWin.cpp: + (CoreIPC::encodeResourceError): Encode certificate data. + (CoreIPC::deallocCertContext): Added. + (CoreIPC::createCertContextDeallocator): Added. + (CoreIPC::copyCert): Added. + (CoreIPC::decodeResourceError): Decode certificate data. + +2011-03-27 Andy Estes <aestes@apple.com> + + Reviewed by Maciej Stachowiak. + + Correctly get a plug-in's MIME type when it uses WebPluginMIMETypesFilename + https://bugs.webkit.org/show_bug.cgi?id=57205 + + If the plug-in's Info.plist uses WebPluginMIMETypesFilename to specify + plug-in MIME types, WebKit has to check for a property list file in + ~/Library/Preferences for the MIME type dictionary. + + * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: + (WebKit::getMIMETypesFromPluginBundle): If the bundle's Info dictionary + has the key WebPluginMIMETypesFilename, open the property list + specified by that key's value and return the MIME type dictionary from + there. Otherwise, return the MIME type dictionary specified by the key + WebPluginMIMETypes. + (WebKit::getPluginInfoFromPropertyLists): Call + getMIMETypesFromPluginBundle(). + +2011-03-27 Jer Noble <jer.noble@apple.com> + + Reviewed by Maciej Stachowiak. + + Full Screen: disable keyboard access by default + https://bugs.webkit.org/show_bug.cgi?id=56684 + + Take into account whether keyboard access was requested when deciding whether full + screen mode is supported. + + * UIProcess/WebFullScreenManagerProxy.cpp: + (WebKit::WebFullScreenManagerProxy::supportsFullScreen): + * UIProcess/WebFullScreenManagerProxy.h: + * UIProcess/WebFullScreenManagerProxy.messages.in: + * WebProcess/FullScreen/WebFullScreenManager.cpp: + (WebKit::WebFullScreenManager::supportsFullScreen): + * WebProcess/FullScreen/WebFullScreenManager.h: + * WebProcess/WebCoreSupport/WebChromeClient.cpp: + (WebKit::WebChromeClient::supportsFullScreenForElement): + * WebProcess/WebCoreSupport/WebChromeClient.h: + +2011-03-27 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Dock doesn't come back after leaving fullscreen on Hulu + https://bugs.webkit.org/show_bug.cgi?id=57189 + <rdar://problem/9192413> + + Port some code over from the old WebKit1 plug-in host. + + * PluginProcess/mac/PluginProcessShim.mm: + (WebKit::shimShowMenuBar): + (WebKit::shimHideMenuBar): + (WebKit::shimIsMenuBarVisible): + +2011-03-27 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Keep a strong reference to the connection to avoid crashes. + + * Platform/CoreIPC/Connection.cpp: + +2011-03-26 Jeff Miller <jeffm@apple.com> + + Reviewed by Sam Weinig. + + WKErrorCopyCFError() doesn't actually return a copy of the CFErrorRef + https://bugs.webkit.org/show_bug.cgi?id=57172 + + * Shared/API/c/cf/WKErrorCF.cpp: + (WKErrorCopyCFError): Use RetainPtr<> and leakRef() to return a real copy. + +2011-03-26 Maciej Stachowiak <mjs@apple.com> + + Revert inadvertently commited changes. + + * WebProcess/com.apple.WebProcess.sb: + +2011-03-26 Jer Noble <jer.noble@apple.com> + + Reviewed by Eric Carlson. + + Enable the Full Screen API by default in WebKit/mac and WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=56956 + + * Shared/WebPreferencesStore.h: Default the fullScreenEnabled preference to true. + +2011-03-26 Jeff Miller <jeffm@apple.com> + + Reviewed by Steve Falkenburg. + + Add PlatformCertificateInfo::PlatformCertificateInfo(PCCERT_CONTEXT) constructor on Windows + https://bugs.webkit.org/show_bug.cgi?id=57152 + + We're going to need to create a PlatformCertificateInfo with a single certificate on Windows to support client certificates. + Also, stop relying on the fact that the Win32 API CertDuplicateCertificateContext() currently returns the same PCCERT_CONTEXT that you pass to it, since that may change in the future. + + * Shared/win/PlatformCertificateInfo.cpp: + (WebKit::PlatformCertificateInfo::PlatformCertificateInfo): Added PlatformCertificateInfo(PCCERT_CONTEXT) construtor. Use return value from CertDuplicateCertificateContext(). + (WebKit::PlatformCertificateInfo::operator=): Use return value from CertDuplicateCertificateContext(). + * Shared/win/PlatformCertificateInfo.h: Added PlatformCertificateInfo(PCCERT_CONTEXT) construtor. + +2011-03-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Graphic corruption appeared with Silverlight contents while resizing window + https://bugs.webkit.org/show_bug.cgi?id=57167 + <rdar://problem/9094052> + + Pass DispatchMessageEvenWhenWaitingForSyncReply when sending GeometryDidChange messages since that will guarantee + that those messages will be handled before PaintEntirePlugin messages which prevents the PaintEntirePlugin handler from + painting into the wrong backing store. + + * WebProcess/Plugins/PluginProxy.cpp: + (WebKit::PluginProxy::geometryDidChange): + +2011-03-26 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Web process considered unresponsive (SPOD shown) when displaying a JavaScript alert() as a result of a click + <rdar://problem/9067557> + https://bugs.webkit.org/show_bug.cgi?id=57166 + + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::runJavaScriptAlert): + (WebKit::WebPageProxy::runJavaScriptConfirm): + (WebKit::WebPageProxy::runJavaScriptPrompt): + Invalidate the responsiveness timer before calling out to the client. + +2011-03-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + ASSERTION FAILED: m_operationInProgress == NoOperation loading nytimes.com + https://bugs.webkit.org/show_bug.cgi?id=57165 + <rdar://problem/9024311> + + The assertion fired because during GC, the web process sends a synchronous NPObjectMessageReceiver::Deallocate + message to the plug-in process. Since this is a synchronous message, the web process needs to process incoming synchronous + messages. While waiting, we get an incoming PluginProxy::Evaluate message from the plug-in. This causes JavaScript to run + during GC which is very bad. + + The fix for this is to add a flag on the connection that will cause synchronous messages sent by the connection (in this case the + plug-in process) to not be processed while the other side (the web process) is waiting for a synchronous reply _unless_ the connection + is actually processing a synchronous message. (The last part is to avoid deadlocks). + + Since the call to NPN_Evaluate by the plug-in (that ends up sending the PluginProxy::Evaluate message) comes from a run loop timer firing, + it's OK to wait for it to be processed by the web process when it returns to the run loop. + + * Platform/CoreIPC/Connection.cpp: + (CoreIPC::Connection::Connection): + Initialize m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage and m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount. + + (CoreIPC::Connection::setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage): + Set m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage. + + (CoreIPC::Connection::sendMessage): + Don't add the MessageID::DispatchMessageWhenWaitingForSyncReply flag when the right flags has been set on the connection, and it's not processing a synchronous message. + + (CoreIPC::Connection::dispatchMessage): + Increment and decrement m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount accordingly. + + * PluginProcess/WebProcessConnection.cpp: + (WebKit::WebProcessConnection::WebProcessConnection): + Call setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage on the connection. + +2011-03-26 Sam Weinig <sam@webkit.org> + + Rollout r82042 (If a user doesn't have a Database/LocalStorage directory, it can't be created (sandbox violations)) + + -[NSString stringByResolvingSymlinksInPath] does not do what we needed for paths within /private. + This caused all SSL sites to stop working. + + * WebProcess/mac/WebProcessMac.mm: + (WebKit::appendSandboxParameterPath): + (WebKit::initializeSandbox): + +2011-03-26 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + If a user doesn't have a Database/LocalStorage directory, it can't be created (sandbox violations) + <rdar://problem/9127411> + https://bugs.webkit.org/show_bug.cgi?id=57164 + + * WebProcess/mac/WebProcessMac.mm: + (WebKit::appendSandboxParameterPath): + (WebKit::initializeSandbox): + Use -[NSString stringByResolvingSymlinksInPath] instead of realpath to ensure we can resolve + symlinks even if the file/directory doesn't exist yet. + +2011-03-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Factor processing of incoming sync replies out into processIncomingSyncReply + https://bugs.webkit.org/show_bug.cgi?id=57161 + + * Platform/CoreIPC/Connection.cpp: + (CoreIPC::Connection::sendSyncMessage): + Pass DispatchMessageEvenWhenWaitingForSyncReply to sendMessage. + + (CoreIPC::Connection::processIncomingSyncReply): + Move code from processIncomingMessage to here. + + (CoreIPC::Connection::processIncomingMessage): + Call processIncomingSyncReply. + +2011-03-26 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + WebKit2: Assert in CoreIPC::typeFromCFTypeRef() when loading a site with an invalid certificate + <rdar://problem/9188041> + https://bugs.webkit.org/show_bug.cgi?id=57159 + + * Shared/cf/ArgumentCodersCF.cpp: + (CoreIPC::typeFromCFTypeRef): + (CoreIPC::encode): + (CoreIPC::decode): + * Shared/cf/ArgumentCodersCF.h: + Add encoding/decoding for SecCertificateRef type. + + * Shared/mac/PlatformCertificateInfo.mm: + (WebKit::PlatformCertificateInfo::encode): + (WebKit::PlatformCertificateInfo::decode): + Use ArgumentCodersCF now that it knows how to encode/decode SecCertificateRefs. + +2011-03-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Handle synchronous replies coming in out of order + https://bugs.webkit.org/show_bug.cgi?id=57158 + + When processing an incoming reply, don't assume that it belongs to the last sent synchronous request. + Instead, iterate over the m_pendingSyncReplies vector backwards looking for the corresponding request. + + * Platform/CoreIPC/Connection.cpp: + (CoreIPC::Connection::processIncomingMessage): + +2011-03-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Fix a possible deadlock when two synchronous messages are sent at the same time + https://bugs.webkit.org/show_bug.cgi?id=57155 + + Simplify code and fix a possible (although highly improbable) dead lock. + + * Platform/CoreIPC/Connection.cpp: + Make SyncMessageState atomically ref counted since it can be ref()'ed from the connection queue. + Get rid of m_waitForSyncReplyCount and add m_didScheduleDispatchMessagesWork. + + (CoreIPC::Connection::SyncMessageState::SyncMessageState): + Initialize m_didScheduleDispatchMessagesWork to false. + + (CoreIPC::Connection::SyncMessageState::processIncomingMessage): + if m_didScheduleDispatchMessagesWork is false, schedule a call to dispatchMessageAndResetDidScheduleDispatchMessagesWork + on the client run loop. + + (CoreIPC::Connection::SyncMessageState::dispatchMessageAndResetDidScheduleDispatchMessagesWork): + Dispatch messages and set m_didScheduleDispatchMessagesWork back to false. + + (CoreIPC::Connection::sendSyncMessage): + Remove calls to beginWaitForSyncReply and endWaitForSyncReply. + +2011-03-25 Sam Weinig <sam@webkit.org> + + Reviewed by Adele Peterson. + + WKPageLoadAlternateHTMLString doesn't re-spawn a dead WebProcess, but should + <rdar://problem/9191493> + https://bugs.webkit.org/show_bug.cgi?id=57134 + + Make all load functions respawn a dead WebProcess for consistency. + + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::loadHTMLString): + Respawn a dead WebProcess. + + (WebKit::WebPageProxy::loadAlternateHTMLString): + Respawn a dead WebProcess. + + (WebKit::WebPageProxy::loadPlainTextString): + Respawn a dead WebProcess. + + (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): + * UIProcess/WebPageProxy.h: + * UIProcess/WebPageProxy.messages.in: + * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: + (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad): + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::loadAlternateHTMLString): + Since we may no longer always have a main frame when calling WKPageLoadAlternateHTMLString, + set the unreachable URL, if there is one, on provisional load. + +2011-03-25 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + PluginView's call to invalidateContentsAndWindow() in invalidateRect() is wrong for plug-ins which paint into compositing layers + https://bugs.webkit.org/show_bug.cgi?id=57133 + <rdar://problem/9029442> + + * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: + (WebKit::NetscapePlugin::platformInvalidate): + Return true under the Core Animation drawing model, since that prevents the plug-in from calling PluginController::invalidate. + + * WebProcess/Plugins/PluginView.cpp: + (WebKit::PluginView::invalidateRect): + Don't call invalidateContentsAndWindow() if the plug-in has a Core Animation layer. + +2011-03-25 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + <rdar://problem/8648311> and https://bugs.webkit.org/show_bug.cgi?id=56425 + WebKit2 IconDatabase and API + + This gets a basic, usable API in place. + Enhancements can come in other bugs as they're needed. + + * UIProcess/API/C/WKIconDatabase.cpp: + (WKIconDatabaseRetainIconForURL): + (WKIconDatabaseReleaseIconForURL): + (WKIconDatabaseEnableDatabaseCleanup): + * UIProcess/API/C/WKIconDatabase.h: + + The first actual accessor for an "icon for a URL" is for a CGImageRef: + * UIProcess/API/C/cg: Added. + * UIProcess/API/C/cg/WKIconDatabaseCG.cpp: Added. + (WKIconDatabaseGetCGImageForURL): + * UIProcess/API/C/cg/WKIconDatabaseCG.h: Added. + + Expose relevant methods to support the above API: + * UIProcess/WebIconDatabase.cpp: + (WebKit::WebIconDatabase::WebIconDatabase): New IconDatabases will have cleanup disabled from the start, + and require a single call to "enableDatabaseCleanup" to allow cleanup. + (WebKit::WebIconDatabase::setDatabasePath): + (WebKit::WebIconDatabase::enableDatabaseCleanup): + (WebKit::WebIconDatabase::imageForPageURL): + * UIProcess/WebIconDatabase.h: + + Project file stuff: + * WebKit2.xcodeproj/project.pbxproj: + * win/WebKit2.vcproj: + +2011-03-25 Jeff Miller <jeffm@apple.com> + + Reviewed by Darin Adler. + + Add CoreIPC::encodeResourceError() and CoreIPC::decodeResourceError() for all platforms + https://bugs.webkit.org/show_bug.cgi?id=57125 + + Currently, these are only implemented on the Mac, but we're going to need them for Windows as well, so we might as well make them always platform-specific. + In this patch, just replicate the existing common non-Mac implementation in WebCoreArgumentCoders.h to platform-specific files. + + * Shared/WebCoreArgumentCoders.h: Move non-Mac implementations of encodeResourceError() and decodeResourceError() to common files. + * Shared/gtk/WebCoreArgumentCodersGtk.cpp: + (CoreIPC::encodeResourceError): Added. + (CoreIPC::decodeResourceError): Added. + * Shared/qt/WebCoreArgumentCodersQt.cpp: + (CoreIPC::encodeResourceError): Added. + (CoreIPC::decodeResourceError): Added. + * Shared/win/WebCoreArgumentCodersWin.cpp: + (CoreIPC::encodeResourceError): Added. + (CoreIPC::decodeResourceError): Added. + +2011-03-25 Andy Estes <aestes@apple.com> + + Reviewed by Adele Peterson. + + REGRESSION (r70748): latest nightly builds kills AC_QuickTime.js + https://bugs.webkit.org/show_bug.cgi?id=49016 + + Update objectContentType() implementation to handle the + shouldPreferPlugInsForImages flag. + + * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: + (WebKit::WebFrameLoaderClient::objectContentType): + * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: + +2011-03-25 Brent Fulgham <bfulgham@webkit.org> + + Unreviewed build correction. + + Add stubs for WK2 cookie handling with cURL. + + * WebProcess/Cookies/curl: Added. + * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Added. + (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): + (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): + * win/WebKit2.vcproj: + +2011-03-25 Steve Falkenburg <sfalken@apple.com> + + Reviewed by Brian Weinstein. + + Microsoft Windows Presentation Foundation (WPF) plug-in complains about missing xpcom.dll + https://bugs.webkit.org/show_bug.cgi?id=57119 + <rdar://problem/9054148> + + This plug-in from Microsoft links against xpcom.dll, which is a Firefox-specific DLL + not available in WebKit. The plug-in is fairly widespread, since it was included in + a Windows Update push at one point. + + * UIProcess/Plugins/win/PluginInfoStoreWin.cpp: + (WebKit::PluginInfoStore::shouldUsePlugin): Blacklist npwpf.dll. + +2011-03-25 Jessie Berlin <jberlin@apple.com> + + Reviewed by Anders Carlsson. + + WebKit2: Need to be able to set and get the Cookie Storage Policy. + https://bugs.webkit.org/show_bug.cgi?id=50780 + + Part 2: Make it possible to set the initial policy on Windows. + + In WebKit1, we read the initial policy on Windows from WebPreferences at startup. + Since that is not possible in WebKit2, make it possible to specify the initial policy + as a creation parameter to the WebProcess. + + * Shared/WebProcessCreationParameters.cpp: + (WebKit::WebProcessCreationParameters::encode): + Encode initialHTTPCookieAcceptPolicy on Windows. + (WebKit::WebProcessCreationParameters::decode): + Decode initialHTTPCookieAcceptPolicy on Windows. + * Shared/WebProcessCreationParameters.h: + + * UIProcess/API/C/win/WKContextPrivateWin.h: + * UIProcess/API/C/win/WKContextWin.cpp: + (WKContextSetInitialHTTPCookieAcceptPolicy): + Call through to WebContext. + + * UIProcess/WebContext.cpp: + (WebKit::WebContext::WebContext): + Give the initial policy a default of "Always". + * UIProcess/WebContext.h: + (WebKit::WebContext::setInitialHTTPCookieAcceptPolicy): + * UIProcess/win/WebContextWin.cpp: + (WebKit::WebContext::platformInitializeWebProcess): + Set the initial policy on Windows. + + * WebProcess/Cookies/WebCookieManager.h: + Make setHTTPCookieAcceptPolicy public so that it can be called from WebProcessWin. + + * WebProcess/win/WebProcessWin.cpp: + (WebKit::WebProcess::platformInitializeWebProcess): + Tell the WebCookieManager about the initial policy. + +2011-03-25 Jessie Berlin <jberlin@apple.com> + + Reviewed by Sam Weinig. + + WebKit2: Need to be able to set and get the Cookie Storage Policy. + https://bugs.webkit.org/show_bug.cgi?id=50780 + + * Shared/HTTPCookieAcceptPolicy.h: Added. + + * UIProcess/API/C/WKAPICast.h: + (WebKit::toHTTPCookieAcceptPolicy): + (WebKit::toAPI): + + * UIProcess/API/C/WKCookieManager.cpp: + (WKCookieManagerSetHTTPCookieAcceptPolicy): + Call through to WebCookieManagerProxy. + (WKCookieManagerGetHTTPCookieAcceptPolicy): + Ditto. + * UIProcess/API/C/WKCookieManager.h: + + * UIProcess/WebCookieManagerProxy.cpp: + (WebKit::WebCookieManagerProxy::invalidate): + Invalidate the get http cookie accept policy callbacks. + (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): + Send a message to the Web Process with the new value. + (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): + Keep track of the callback and send a message to the Web Process. + (WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy): + Invoke the callback. + * UIProcess/mac/WebCookieManagerProxyMac.mm: Added. + (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy): + On Mac, also set the policy in the UI Process because the sandboxed Web Process cannot + persist the policy. + * UIProcess/WebCookieManagerProxy.h: + * UIProcess/WebCookieManagerProxy.messages.in: + + * WebKit2.pri: + * WebKit2.pro: + * WebKit2.xcodeproj/project.pbxproj: + * win/WebKit2.vcproj: + * win/WebKit2Common.vsprops: + + * WebProcess/Cookies/WebCookieManager.cpp: + (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy): + Call platformSetHTTPCookieAcceptPolicy. + (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy): + Send the result of platformGetHTTPCookieAcceptPolicy to the UI Process. + * WebProcess/Cookies/WebCookieManager.h: + * WebProcess/Cookies/WebCookieManager.messages.in: + + * WebProcess/Cookies/cf: Added. + * WebProcess/Cookies/cf/WebCookieManagerCFNet.cpp: Added. + (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): + Set the policy on both the default cookie storage and any Private Browsing cookie storage. + (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): + * WebProcess/Cookies/mac: Added. + * WebProcess/Cookies/mac/WebCookieManagerMac.mm: Added. + (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): + Set the policy on the default cookie storage and add a FIXME to set it on any Private + Browsing cookie storage. + (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): + + * WebProcess/Cookies/gtk: Added. + * WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp: Added. + (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): + (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): + * WebProcess/Cookies/qt: Added. + * WebProcess/Cookies/qt/WebCookieManagerQt.cpp: Added. + (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): + (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): + +2011-03-25 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Alexey Proskuryakov. + + REGRESSION(r79227): CFURLCache not initialized correctly in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=57109 + <rdar://problem/9184590> + + Check for a trailing Windows path separator, not a Unix path separator. + + * UIProcess/win/WebContextWin.cpp: + (WebKit::WebContext::platformInitializeWebProcess): + +2011-03-25 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] QtWebKit will not compile with QT_ASCII_CAST_WARNINGS enabled + https://bugs.webkit.org/show_bug.cgi?id=57087 + + Use explicit conversion for string to avoid depending on the default codec + installed by the user code. + + * Platform/qt/SharedMemoryQt.cpp: + (WebKit::SharedMemory::create): + * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: + (WebKit::initializeGTK): + * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp: + (tst_QGraphicsWKView::loadEmptyPage): + (tst_QGraphicsWKView::loadEmptyUrl): + * UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp: + (tst_QWKPage::loadEmptyUrl): + * UIProcess/Launcher/qt/ProcessLauncherQt.cpp: + (WebKit::ProcessLauncher::launchProcess): + * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: + (WebKit::getPluginDisplay): + * WebProcess/qt/WebProcessMainQt.cpp: + (WebKit::EnvHttpProxyFactory::initializeFromEnvironment): + (WebKit::WebProcessMainQt): + +2011-03-25 Brent Fulgham <bfulgham@webkit.org> + + Correct project file missing $(WebKitVSPropsRedirectionDir)s + after r81924. + + * win/WebKit2.vcproj: Restore lost $(WebKitVSPropsRedirectionDir) + +2011-03-25 Alejandro G. Castro <alex@igalia.com> + + Reviewed by Martin Robinson. + + [WK2] Consider .c files in the generate-forwarding-headers script + https://bugs.webkit.org/show_bug.cgi?id=56680 + + * Scripts/generate-forwarding-headers.pl: + +2011-03-24 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r81916 and r81917. + http://trac.webkit.org/changeset/81916 + http://trac.webkit.org/changeset/81917 + https://bugs.webkit.org/show_bug.cgi?id=57071 + + broke a test on platforms that do not have QuickTime installed + (Requested by estes on #webkit). + + * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: + (WebKit::WebFrameLoaderClient::objectContentType): + * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: + +2011-03-24 Brady Eidson <beidson@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=57069 + Add WKIconDatabase api to the project files, and expose accessor on WKContext. + + Project file stuffs: + * GNUmakefile.am: + * WebKit2.xcodeproj/project.pbxproj: + * win/WebKit2.vcproj: + + * Shared/API/c/WKBase.h: + * UIProcess/API/C/WKAPICast.h: + + * UIProcess/API/C/WKContext.cpp: + (WKContextGetIconDatabase): + * UIProcess/API/C/WKContext.h: + + * UIProcess/API/C/WKIconDatabase.cpp: Added. + (WKIconDatabaseGetTypeID): + * UIProcess/API/C/WKIconDatabase.h: Added. + + * UIProcess/WebContext.h: + (WebKit::WebContext::iconDatabase): + +2011-03-24 Brent Fulgham <bfulgham@webkit.org> + + Build correction. + + Disable the CA Layer stuff when building with Cairo. + + * win/WebKit2.vcproj: + +2011-03-24 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=57058 + Hookup the UIProcess WebIconDatabase to a WebCore::IconDatabase as its implementation + + * UIProcess/WebIconDatabase.cpp: + (WebKit::WebIconDatabase::WebIconDatabase): + (WebKit::WebIconDatabase::setDatabasePath): Create a new WebCore::IconDatabase and open it to this path. + (WebKit::WebIconDatabase::retainIconForPageURL): Actually retain the url, using the impl. + (WebKit::WebIconDatabase::releaseIconForPageURL): Actually release the url, using the impl. + (WebKit::WebIconDatabase::setIconURLForPageURL): Actually set the url, using the impl. + (WebKit::WebIconDatabase::setIconDataForIconURL): Actually set the data, using the impl. + (WebKit::WebIconDatabase::getLoadDecisionForIconURL): Actually ask for a load decision to call back with. + (WebKit::WebIconDatabase::performImport): + (WebKit::WebIconDatabase::didImportIconURLForPageURL): + (WebKit::WebIconDatabase::didImportIconDataForPageURL): + (WebKit::WebIconDatabase::didChangeIconForPageURL): + (WebKit::WebIconDatabase::didRemoveAllIcons): + (WebKit::WebIconDatabase::didFinishURLImport): Notify all the pending callbacks what their load decisions + are now that they're available. + * UIProcess/WebIconDatabase.h: + + Add an IconDatabase logging channel: + * Platform/Logging.cpp: + (WebKit::initializeLogChannelsIfNecessary): + * Platform/Logging.h: + + * UIProcess/WebContext.cpp: + (WebKit::WebContext::setIconDatabasePath): Pass the new path on to the WebIconDatabase, possibly + opening it. + * UIProcess/WebContext.h: + +2011-03-24 Andy Estes <aestes@apple.com> + + Reviewed by Darin Adler. + + REGRESSION (r70748): latest nightly builds kills AC_QuickTime.js + https://bugs.webkit.org/show_bug.cgi?id=49016 + + Update objectContentType() implementation to handle the + shouldPreferPlugInsForImages flag. + + * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: + (WebKit::WebFrameLoaderClient::objectContentType): + * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: + +2011-03-24 Adam Roben <aroben@apple.com> + + Start compiling LayerTreeHostCA on Windows + + Fixes <http://webkit.org/b/57060> WebKit2.vcproj should compile LayerTreeHostCA + + Reviewed by Anders Carlsson. + + * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp: Added. + (WebKit::LayerTreeHostCA::platformInitialize): + (WebKit::LayerTreeHostCA::scheduleLayerFlush): + (WebKit::LayerTreeHostCA::platformInvalidate): + (WebKit::LayerTreeHostCA::platformSizeDidChange): + (WebKit::LayerTreeHostCA::platformForceRepaint): + (WebKit::LayerTreeHostCA::platformDidPerformScheduledLayerFlush): + Stubbed out. + + * win/WebKit2.vcproj: Added new files. Let VS reorder existing files. + + * win/WebKit2Apple.vsprops: Added WebProcess\WebPage\ca to the include path. + +2011-03-24 Jer Noble <jer.noble@apple.com> + + Unreviewed build fix. + + Remove reference to LayerTreeHostMac.h from WebFullScreenManagerMac.mm. + + * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: + +2011-03-24 Adam Roben <aroben@apple.com> + + Split Mac-specific parts of LayerTreeHostCA into LayerTreeHostCAMac.mm + + Fixes <http://webkit.org/b/57046> LayerTreeHostMac's code should be shareable with Windows + + Reviewed by Anders Carlsson. + + * WebKit2.xcodeproj/project.pbxproj: + + * WebProcess/WebPage/ca/LayerTreeHostCA.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.mm. + (WebKit::LayerTreeHostCA::LayerTreeHostCA): Moved some Mac-specific code to + LayerTreeHostCAMac.mm. + (WebKit::LayerTreeHostCA::~LayerTreeHostCA): Wrapped some Mac-specific code in + PLATFORM(MAC). + + (WebKit::LayerTreeHostCA::invalidate): + (WebKit::LayerTreeHostCA::sizeDidChange): + (WebKit::LayerTreeHostCA::forceRepaint): + Moved some Mac-specific code to LayerTreeHostCAMac.mm. + + (WebKit::LayerTreeHostCA::performScheduledLayerFlush): Renamed from + flushPendingLayerChangesRunLoopObserverCallback. Moved some code from here... + (WebKit::LayerTreeHostCA::didPerformScheduledLayerFlush): ...to here. Moved some + Mac-specific code to LayerTreeHostCAMac.mm. + + * WebProcess/WebPage/ca/LayerTreeHostCA.h: Added new functions, wrapped some Mac-specific + declarations in PLATFORM(MAC). + + * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm: Added. + (WebKit::LayerTreeHostCA::platformInitialize): + (WebKit::LayerTreeHostCA::scheduleLayerFlush): + (WebKit::LayerTreeHostCA::platformInvalidate): + (WebKit::LayerTreeHostCA::platformSizeDidChange): + (WebKit::LayerTreeHostCA::platformForceRepaint): + (WebKit::LayerTreeHostCA::flushPendingLayerChangesRunLoopObserverCallback): + (WebKit::LayerTreeHostCA::platformDidPerformScheduledLayerFlush): + Code was extracted from LayerTreeHostCA.cpp. + +2011-03-24 Adam Roben <aroben@apple.com> + + Rename LayerTreeHostMac to LayerTreeHostCA + + This is the first step toward sharing code with Windows. + + Fixes <http://webkit.org/b/57051>. + + Reviewed by Anders Carlsson. + + * WebKit2.xcodeproj/project.pbxproj: + * WebProcess/WebPage/LayerTreeHost.cpp: + (WebKit::LayerTreeHost::create): + Updated for rename. + + * WebProcess/WebPage/ca/LayerTreeHostCA.h: Renamed from Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h. + * WebProcess/WebPage/ca/LayerTreeHostCA.mm: Renamed from Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm. + +2011-03-17 Jer Noble <jer.noble@apple.com> + + Reviewed by Maciej Stachowiak. + + WebKit2: Cancelling full screen early leaves full screen window up. + https://bugs.webkit.org/show_bug.cgi?id=56589 + + No new tests, as WebKitTestRunner does not currently support the new Full Screen API. + + Notify the UIProcess when it needs to tear down its layer hosting view, turn off + the background layer when not in accelerated rendering mode and don't swap out + the web view unnecessarily + + * UIProcess/mac/WKFullScreenWindowController.mm: + (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Check before swapping _webView. + (-[WKFullScreenWindowController enterAcceleratedCompositingMode:]): Add the _layerHostingView + to the full screen window's animationView, not its contentsView. + (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): Hide the background layer. + * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: + (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): If given a null rootLayer, tell + the client to exit accelerated mode. + +2011-03-24 Enrica Casucci <enrica@apple.com> + + Reviewed by Alexey Proskuryakov. + + WebKit2:Services menu item to convert selected Simplified/Traditional Chinese Text is not working. + https://bugs.webkit.org/show_bug.cgi?id=56975 + <rdar://problem/8915066> + + Adding missing entry point to support Mac OS X services in WebKit2. + + * UIProcess/API/mac/WKView.mm: + (-[WKView readSelectionFromPasteboard:]): Added. + * UIProcess/WebPageProxy.h: + * UIProcess/mac/WebPageProxyMac.mm: + (WebKit::WebPageProxy::readSelectionFromPasteboard): Added. + * WebProcess/WebPage/WebPage.h: + * WebProcess/WebPage/WebPage.messages.in: Added synchronous + message. + * WebProcess/WebPage/mac/WebPageMac.mm: + (WebKit::WebPage::readSelectionFromPasteboard): Added. + +2011-03-24 Jia Pu <jpu@apple.com> + + Reviewed by Darin Adler. + + Dismissed reversion suggestion is incorrectly learned. + https://bugs.webkit.org/show_bug.cgi?id=57039 + + CorrectionPanel should always use [NSSpellChecker dismissCorrectionBubbleForView]. + [NSSpellChecker cancelCorrectionBubbleForView] is reserved for situation where correction panel + is dismissed explicitly by ESC key or clicking the dimiss button. Misusing these causes + incorrect automatic learning. + + * UIProcess/mac/CorrectionPanel.mm: + (WebKit::CorrectionPanel::dismissInternal): + +2011-03-24 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Adam Roben. + + WebKit2: Add Trackpoint driver hack to support IBM trackpads + https://bugs.webkit.org/show_bug.cgi?id=49830 + <rdar://problem/8705951> + + Copy code from WebKit1 to WebKit2 to handle initializing fake scrollbars so + IBM machines with a trackpad send us WM_VSCROLL and WM_HSCROLL messages. + + Listen for the WM_VSCROLL and WM_HSCROLL messages, and turn the values into + ScrollDirection and ScrollGranularity, and send a scroll command to the + WebProcess. + + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::scrollBy): Send a message to the WebProcess. + * UIProcess/WebPageProxy.h: + * UIProcess/win/WebView.cpp: + (WebKit::WebView::wndProc): Add WM_VSCROLL and WM_HSCROLL message handling. + (WebKit::WebView::initialize): Call shouldInitializeTrackPointHack. + (WebKit::WebView::onHorizontalScroll): Turn wParam into a ScrollDirection and ScrollGranularity. + (WebKit::WebView::onVerticalScroll): Ditto. + (WebKit::WebView::shouldInitializeTrackPointHack): Check the registry for keys that indicate + the machine has a IBM Trackpoint driver. + * UIProcess/win/WebView.h: + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::scrollBy): Call scroll method. + (WebKit::WebPage::scroll): Moved from WebPageMac and WebPageWin. + (WebKit::WebPage::logicalScroll): Ditto. + * WebProcess/WebPage/WebPage.h: + * WebProcess/WebPage/WebPage.messages.in: Add a new scrollBy message. + * WebProcess/WebPage/mac/WebPageMac.mm: Remove scroll and logicalScroll, they are now in WebPage.cpp. + * WebProcess/WebPage/win/WebPageWin.cpp: Ditto. + +2011-03-24 Sam Weinig <sam@webkit.org> + + Reviewed by Darin Adler. + + Dictionary text extraction is not correctly detecting word boundaries on bing.com + <rdar://problem/9078569> + https://bugs.webkit.org/show_bug.cgi?id=56995 + + * Shared/DictionaryPopupInfo.cpp: + (WebKit::DictionaryPopupInfo::encode): + (WebKit::DictionaryPopupInfo::decode): + * Shared/DictionaryPopupInfo.h: + Add options dictionary. + + * UIProcess/API/mac/PageClientImpl.mm: + (WebKit::PageClientImpl::didPerformDictionaryLookup): + Add path that can pass options through. + + * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: + (WebKit::WebContextMenuClient::lookUpInDictionary): + Use the new performDictionaryLookupForSelection which can extract context + if supported. + + * WebProcess/WebPage/WebPage.h: + * WebProcess/WebPage/mac/WebPageMac.mm: + (WebKit::characterRangeAtPositionForPoint): + (WebKit::characterRangeAtPoint): + Split functionality out of characterRangeAtPoint and into + characterRangeAtPositionForPoint to avoid doing duplicate work + if you already have the position. + + (WebKit::isPositionInRange): + (WebKit::shouldUseSelection): + Add predicate to determine if we should use the selection instead + of expanding to find the word we are over. + + (WebKit::WebPage::performDictionaryLookupAtLocation): + If available, use the surrounding paragraph as context to get better extraction + and to get lexicographical information about the word. Also, clean up and use + editing APIs to make the code more concise and understandable. + + (WebKit::WebPage::performDictionaryLookupForSelection): + Use similar logic as in performDictionaryLookupAtLocation to extract additional + details from a selection for use in the dictionary popup. + + (WebKit::WebPage::performDictionaryLookupForRange): + Pass options to WebProcess if available. + +2011-03-24 Jon Lee <jonlee@apple.com> + + Reviewed by Darin Adler. + + WebKit2: Tabbing from the last focused field to a non-webpage element leaves the selection in a weird state + <rdar://problem/8553962> + + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::setFocused): When the page loses focus, clear out any selection in the frame + +2011-03-24 Brian Weinstein <bweinstein@apple.com> + + Rubber-stamped by Sam Weinig. + + Fix a typo in the VK_LEFT case of performDefaultBehaviorForKeyEvent. + + * WebProcess/WebPage/mac/WebPageMac.mm: + (WebKit::WebPage::performDefaultBehaviorForKeyEvent): It should be a logical or, + not a bitwise or. + +2011-03-24 Jeff Miller <jeffm@apple.com> + + Fix typo - USE(CF_NETWORK) should be USE(CFNETWORK). + + * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: + (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): USE(CF_NETWORK) should be USE(CFNETWORK) + +2011-03-23 Jia Pu <jpu@apple.com> + + Reviewed by Darin Adler. + + Hook up new AppKit autocorrection UI with WK2. + https://bugs.webkit.org/show_bug.cgi?id=56055 + <rdar://problem/8947463> + + Please see WebCore/ChangeLog for detail. + + The calls to AppKit are implemented in PageClientImpl. Other changes are necessary for the + plumbing work. + + * UIProcess/API/mac/PageClientImpl.h: + * UIProcess/API/mac/PageClientImpl.mm: + (WebKit::PageClientImpl::showCorrectionPanel): + (WebKit::PageClientImpl::dismissCorrectionPanel): + (WebKit::PageClientImpl::dismissCorrectionPanelSoon): + (WebKit::PageClientImpl::recordAutocorrectionResponse): + * UIProcess/API/mac/WKView.mm: + (-[WKView spellCheckerDocumentTag]): + (-[WKView handleCorrectionPanelResult:]): + * UIProcess/API/mac/WKViewPrivate.h: + * UIProcess/PageClient.h: + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::didCommitLoadForFrame): + (WebKit::WebPageProxy::showCorrectionPanel): + (WebKit::WebPageProxy::dismissCorrectionPanel): + (WebKit::WebPageProxy::dismissCorrectionPanelSoon): + (WebKit::WebPageProxy::recordAutocorrectionResponse): + (WebKit::WebPageProxy::handleCorrectionPanelResult): + * UIProcess/WebPageProxy.h: + * UIProcess/WebPageProxy.messages.in: + * UIProcess/mac/CorrectionPanel.h: Added. + (WebKit::CorrectionPanel::isShowing): + * UIProcess/mac/CorrectionPanel.mm: Added. + (correctionBubbleType): + (WebKit::CorrectionPanel::CorrectionPanel): + (WebKit::CorrectionPanel::~CorrectionPanel): + (WebKit::CorrectionPanel::show): + (WebKit::CorrectionPanel::dismiss): + (WebKit::CorrectionPanel::dismissSoon): + (WebKit::CorrectionPanel::dismissInternal): + (WebKit::CorrectionPanel::recordAutocorrectionResponse): + * WebKit2.xcodeproj/project.pbxproj: + * WebProcess/WebCoreSupport/WebEditorClient.h: + * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: + (WebKit::WebEditorClient::showCorrectionPanel): + (WebKit::WebEditorClient::dismissCorrectionPanel): + (WebKit::WebEditorClient::dismissCorrectionPanelSoon): + (WebKit::WebEditorClient::recordAutocorrectionResponse): + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::handleCorrectionPanelResult): + * WebProcess/WebPage/WebPage.h: + * WebProcess/WebPage/WebPage.messages.in: + +2011-03-23 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Maciej Stachowiak. + + WebKit2: Need API to manage the Media Cache + https://bugs.webkit.org/show_bug.cgi?id=56878 + <rdar://problem/9082503> + + Call through to HTMLMediaElement functions to manage the WebCore media cache. + + * WebProcess/MediaCache/WebMediaCacheManager.cpp: + (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache): + (WebKit::WebMediaCacheManager::clearCacheForHostname): + (WebKit::WebMediaCacheManager::clearCacheForAllHostnames): + +2011-03-23 Jeff Miller <jeffm@apple.com> + + Reviewed by Darin Adler. + + Add WKBundleSetHostAllowsAnyHTTPSCertificate() for Windows + https://bugs.webkit.org/show_bug.cgi?id=56972 + + This is the WebKit2 equivalent to the WebKit1 API IWebMutableURLRequest::setAllowsAnyHTTPSCertificate(). + + * WebProcess/InjectedBundle/API/c/WKBundle.cpp: + (WKBundleSetHostAllowsAnyHTTPSCertificate): Added. + * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Added WKBundleSetHostAllowsAnyHTTPSCertificate(). + * WebProcess/InjectedBundle/InjectedBundle.h: Added setHostAllowsAnyHTTPSCertificate(). + * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp: + (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called. + * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp: + (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called. + * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp: + (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added, should never be called. + * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: + (WebKit::InjectedBundle::setHostAllowsAnyHTTPSCertificate): Added. + +2011-03-23 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Roll out r81593 Need WebKit2 API for creating a page with a specific main frame name + + This API is not necessary. + + * Shared/WebPageCreationParameters.cpp: + (WebKit::WebPageCreationParameters::encode): + (WebKit::WebPageCreationParameters::decode): + * Shared/WebPageCreationParameters.h: + * UIProcess/API/mac/WKView.h: + * UIProcess/API/mac/WKView.mm: + (-[WKView initWithFrame:]): + (-[WKView initWithFrame:contextRef:]): + (-[WKView initWithFrame:contextRef:pageGroupRef:]): + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::creationParameters): + * UIProcess/WebPageProxy.h: + * WebProcess/WebPage/WebFrame.cpp: + (WebKit::WebFrame::createMainFrame): + * WebProcess/WebPage/WebFrame.h: + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::WebPage): + +2011-03-23 Balazs Kelemen <kbalazs@webkit.org> + + Reviewed by Andreas Kling. + + [WK2] Handle keyboard and mouse events on X11 + https://bugs.webkit.org/show_bug.cgi?id=56103 + + Propagate keyboard and mouse events to the plugin + as XEvent's. + + * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: + (WebKit::initializeXEvent): + (WebKit::xTimeStamp): + (WebKit::xKeyModifiers): + (WebKit::setCommonMouseEventFields): + (WebKit::setXMotionEventFields): + (WebKit::setXButtonEventFields): + (WebKit::setXCrossingEventFields): + (WebKit::NetscapePlugin::platformHandleMouseEvent): + (WebKit::NetscapePlugin::platformHandleMouseEnterEvent): + (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent): + (WebKit::setXKeyEventFields): + (WebKit::NetscapePlugin::platformHandleKeyboardEvent): + +2011-03-23 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Connection::SyncMessageState::processIncomingMessage should ignore whether the message is sync or not + https://bugs.webkit.org/show_bug.cgi?id=56954 + + This is so we'll eventually be able to send sync messages that aren't processed immediately if the + destination is waiting for a reply to another synchronous message. + + * Platform/CoreIPC/Connection.cpp: + (CoreIPC::Connection::SyncMessageState::processIncomingMessage): + Only check for the DispatchMessageWhenWaitingForSyncReply flag. + + (CoreIPC::Connection::sendSyncMessage): + Add both DispatchMessageWhenWaitingForSyncReply and SyncMessage to the message ID. + + * Platform/CoreIPC/Connection.h: + (CoreIPC::Connection::sendSync): + (CoreIPC::Connection::deprecatedSendSync): + No need to add SyncMessage here anymore. + +2011-03-23 Brian Weinstein <bweinstein@apple.com> + + Qt Build Fix. + + * DerivedSources.pro: + +2011-03-22 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Darin Adler. + + WebKit2: Need API to manage the Media Cache + https://bugs.webkit.org/show_bug.cgi?id=56878 + <rdar://problem/9082503> + + Project File Fun: + * GNUmakefile.am: + * WebKit2.pri: + * WebKit2.pro: + * WebKit2.xcodeproj/project.pbxproj: + * win/WebKit2.vcproj: + * win/WebKit2Common.vsprops: + * win/WebKit2Generated.make: + + Derived Sources and API fun: + * DerivedSources.make: + * DerivedSources.pro: + * Platform/CoreIPC/MessageID.h: + * Shared/API/c/WKBase.h: + * Shared/APIObject.h: + * UIProcess/API/C/WKAPICast.h: + + * UIProcess/WebProcessProxy.cpp: + (WebKit::WebProcessProxy::didReceiveMessage): Add a case for MediaCache messages. + * WebProcess/WebProcess.cpp: + (WebKit::WebProcess::didReceiveMessage): Ditto. + + * UIProcess/WebContext.cpp: + (WebKit::WebContext::WebContext): Initialize the WebMediaCacheManagerProxy member variable. + (WebKit::WebContext::~WebContext): Invalidate the WebMediaCacheManagerProxy. + (WebKit::WebContext::disconnectProcess): Ditto. + (WebKit::WebContext::didReceiveMessage): Add a case for MediaCache messages. + * UIProcess/WebContext.h: + (WebKit::WebContext::mediaCacheManagerProxy): + + * UIProcess/API/C/WKContext.cpp: + (WKContextGetMediaCacheManager): Returns the context's WebMediaCacheManager. + * UIProcess/API/C/WKContext.h: + + * UIProcess/API/C/WKMediaCacheManager.cpp: Added. + (WKMediaCacheManagerGetTypeID): Returns the WebMediaCacheManagerProxy type. + (WKMediaCacheManagerGetHostnamesWithMediaCache): Calls down to the WebMediaCacheManagerProxy. + (WKMediaCacheManagerClearCacheForHostname): Ditto. + (WKMediaCacheManagerClearCacheForAllHostnames): Ditto. + * UIProcess/API/C/WKMediaCacheManager.h: Added. + + * UIProcess/WebMediaCacheManagerProxy.cpp: Added. + (WebKit::WebMediaCacheManagerProxy::create): + (WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy): + (WebKit::WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy): + (WebKit::WebMediaCacheManagerProxy::invalidate): + (WebKit::WebMediaCacheManagerProxy::didReceiveMessage): + (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache): Call through to the WebProcess. + (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache): Process the WebProcess response, + and call the callback. + (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname): Call through to the WebProcess. + (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames): Call through to the WebProcess. + * UIProcess/WebMediaCacheManagerProxy.h: Added. + (WebKit::WebMediaCacheManagerProxy::clearContext): + (WebKit::WebMediaCacheManagerProxy::type): + * UIProcess/WebMediaCacheManagerProxy.messages.in: Added. + + * WebProcess/MediaCache: Added. + * WebProcess/MediaCache/WebMediaCacheManager.cpp: Added. + (WebKit::WebMediaCacheManager::shared): + (WebKit::WebMediaCacheManager::WebMediaCacheManager): + (WebKit::WebMediaCacheManager::didReceiveMessage): + (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache): Added a FIXME to call through to WebCore. + (WebKit::WebMediaCacheManager::clearCacheForHostname): Ditto. + (WebKit::WebMediaCacheManager::clearCacheForAllHostnames): Ditto. + * WebProcess/MediaCache/WebMediaCacheManager.h: Added. + * WebProcess/MediaCache/WebMediaCacheManager.messages.in: Added. + +2011-03-22 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + Add asynchronous load decision call to WebKit2 IconDatabase + https://bugs.webkit.org/show_bug.cgi?id=56887 + + * UIProcess/WebIconDatabase.cpp: + (WebKit::WebIconDatabase::getLoadDecisionForIconURL): In the future, get the actual load decision from the database. + For now, always message "IconLoadNo" back to the WebProcess. + * UIProcess/WebIconDatabase.h: + * UIProcess/WebIconDatabase.messages.in: + + * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: + (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): Message the UIProcess for the load decision. + (WebKit::WebIconDatabaseProxy::receivedIconLoadDecision): Callback into WebCore with the received load decision. + * WebProcess/IconDatabase/WebIconDatabaseProxy.h: + * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: + +2011-03-23 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Darin Adler. + + REGRESSION: WK2: AX: PDF in Safari no longer accessible. + https://bugs.webkit.org/show_bug.cgi?id=56849 + + The WKView needs to know when to return the WKPDFView and when to return + the remote web process connection. + + * UIProcess/API/mac/PDFViewController.h: + (WebKit::PDFViewController::pdfView): + * UIProcess/API/mac/WKView.mm: + (-[WKView accessibilityFocusedUIElement]): + (-[WKView accessibilityHitTest:]): + (-[WKView accessibilityAttributeValue:]): + +2011-03-21 Stephanie Lewis <slewis@apple.com> + + Reviewed by Simon Fraser. + + https://bugs.webkit.org/show_bug.cgi?id=56798 + Wrap autorelease pools around calls that can have pathological memory growth on Membuster. + Only wrap the main runloop because some background threads are not expected to call into + objc and an autorelease pool could mask bugs. + + * Platform/mac/RunLoopMac.mm: + (RunLoop::performWork): + (RunLoop::TimerBase::timerFired): + * WebProcess/WebPage/mac/LayerTreeHostMac.mm: + (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback): + +2011-03-22 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + OBJECT element with DivX source is always downloaded + https://bugs.webkit.org/show_bug.cgi?id=56879 + + * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: + (WebKit::getPluginInfoFromPropertyLists): + Always try to split every element in the "WebPluginExtensions" array, since the DivX plug-in + specifies multiple file extensions in a single element. + + * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: + (WebKit::pluginSupportsExtension): + Add a new helper function. + + (WebKit::WebFrameLoaderClient::objectContentType): + If we can't find the MIME for an extension, explicitly check if there's a plugin that claims to + handle the given extension. + +2011-03-22 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + Rename the synchronous icon database messages to be prefixed with "synchronous" + + * UIProcess/WebIconDatabase.cpp: + (WebKit::WebIconDatabase::synchronousIconDataForPageURL): + (WebKit::WebIconDatabase::synchronousIconURLForPageURL): + (WebKit::WebIconDatabase::synchronousIconDataKnownForIconURL): + (WebKit::WebIconDatabase::synchronousLoadDecisionForIconURL): + * UIProcess/WebIconDatabase.h: + * UIProcess/WebIconDatabase.messages.in: + + * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: + (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL): + +2011-03-22 Sam Weinig <sam@webkit.org> + + Rubber-stamped by Anders Carlsson. + + Loading a new tab does not dismiss Lookup + <rdar://problem/9138391> + + * UIProcess/API/mac/WKView.mm: + (-[WKView viewDidMoveToWindow]): + Hide the dictionary popup when moving the WKView out of a window. + +2011-03-22 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Microsoft Silverlight playback shows artifacts + https://bugs.webkit.org/show_bug.cgi?id=56863 + <rdar://problem/9103136> + + * PluginProcess/PluginControllerProxy.cpp: + (WebKit::PluginControllerProxy::paint): + If the plug-in is transparent, clear the dirty rect before painting. + + * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: + (WebKit::NetscapePluginModule::determineQuirks): + Add the MakeTransparentIfBackgroundAttributeExists quirk for Silverlight plug-ins. + + * Shared/Plugins/PluginQuirks.h: + Add MakeTransparentIfBackgroundAttributeExists quirk. + + * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: + (WebKit::NPN_SetValue): + Handle NPPVpluginTransparentBool. + + * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: + (WebKit::NetscapePlugin::NetscapePlugin): + Initialize m_isTransparent to false. + + (WebKit::NetscapePlugin::setIsTransparent): + Set m_isTransparent. + + (WebKit::NetscapePlugin::initialize): + If the plug-in has the MakeTransparentIfBackgroundAttributeExists quirk, make it transparent + if there's a 'background' attribute. + + (WebKit::NetscapePlugin::isTransparent): + Add getter. + + * WebProcess/Plugins/Plugin.h: + Add isTransparent(). + + * WebProcess/Plugins/PluginProxy.cpp: + (WebKit::PluginProxy::paint): + Always copy the plug-in backing store to the plug-in proxy backing store. + + (WebKit::PluginProxy::isTransparent): + Add getter that should never be called. + + (WebKit::PluginProxy::update): + Always copy the plug-in backing store to the plug-in proxy backing store. + +2011-03-22 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Crash when calling PluginProxy::evaluate on a destroyed plug-in + https://bugs.webkit.org/show_bug.cgi?id=56848 + <rdar://problem/9168975> + + Return early if the NPObject doesn't exist anymore. + + * WebProcess/Plugins/PluginProxy.cpp: + (WebKit::PluginProxy::evaluate): + +2011-03-22 Sam Weinig <sam@webkit.org> + + Reviewed by Adam Roben. + + WebKit2: Cannot make a selection past the end of the visible page (no autoscrolling) + <rdar://problem/8823874> + https://bugs.webkit.org/show_bug.cgi?id=56847 + + * Shared/mac/WebEventFactory.mm: + (WebKit::currentMouseButton): + (WebKit::mouseButtonForEvent): + Add mouse button for mouseEnter/Exit events. [NSEvent buttonNumber] doesn't seem to give the right result + for these events, but getting the currentMouseButton does work. + +2011-03-21 Brady Eidson <beidson@apple.com> + + Fix Mac release builds after https://bugs.webkit.org/show_bug.cgi?id=56783 + + * Platform/mac/Logging.mac.mm: + +2011-03-21 Brady Eidson <beidson@apple.com> + + Reviewed by Brian Weinstein. + + https://bugs.webkit.org/show_bug.cgi?id=56783 + Actually hook up WebKit2 logging on Mac. + + * Platform/Logging.cpp: + (WebKit::initializeLogChannel): + * Platform/Logging.h: + * Platform/mac/Logging.mac.mm: Added. + (WebKit::initializeLogChannel): + + * UIProcess/WebContext.cpp: + (WebKit::WebContext::WebContext): Initialize logging if necessary. + + * WebKit2.xcodeproj/project.pbxproj: + +2011-03-21 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + REGRESSION (r81269): WebKit2 gets into an infinite recursion after an unhandled command key + https://bugs.webkit.org/show_bug.cgi?id=56782 + <rdar://problem/9151993> + + * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::doneWithKeyEvent): + Factored out code for resending an event and moved it to WKView. + + * UIProcess/API/mac/WKView.mm: + (-[WKView performKeyEquivalent:]): Don't zero out _keyDownEventBeingResent, it's easier + to just do that in _resendKeyDownEvent:. + (-[WKView keyDown:]): Ditto. + (-[WKView _resendKeyDownEvent:]): Moved from PageClientImpl.mm. Added an assertion that we + are not already resending an event - it would be too confusing if we ever had to do that, + but looks like this never happens. + + * UIProcess/API/mac/WKViewInternal.h: Exposed _resendKeyDownEvent. + +2011-03-21 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + QT plug-in fails to load contextual menu + https://bugs.webkit.org/show_bug.cgi?id=56777 + <rdar://problem/8979033> + + Open a Carbon resource map and make it the current map when calling NP_Initialize. + + * Platform/Module.cpp: + (WebKit::Module::Module): + Initialize m_bundleResourceMap to -1. + + * Platform/Module.h: + Add m_bundleResourceMap. + + * Platform/mac/ModuleMac.mm: + (WebKit::Module::unload): + Close the resource map. + + (WebKit::Module::bundleResourceMap): + Open a resource map if necessary. + + * Shared/Plugins/Netscape/NetscapePluginModule.cpp: + (WebKit::NetscapePluginModule::tryLoad): + Get the resource map and make it current before calling NP_Initialize. + +2011-03-21 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Plug-in process crashes if it fails to load a plug-in module + https://bugs.webkit.org/show_bug.cgi?id=56775 + + * PluginProcess/PluginControllerProxy.cpp: + (WebKit::PluginControllerProxy::initialize): + If NetscapePlugin::create returns null, call removePluginControllerProxy with a null plug-in. + + * PluginProcess/WebProcessConnection.cpp: + (WebKit::WebProcessConnection::removePluginControllerProxy): + Remove an incorrect assertion. Don't invalidate the remote object map if the plug-in is null. + +2011-03-21 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + QT plug-in loads controller at top of movie not bottom + https://bugs.webkit.org/show_bug.cgi?id=56764 + <rdar://problem/8979037> + + Create a layer with geometryFlipped set and add the plug-in layer as a sublayer, + matching WebKit1. + + * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: + (WebKit::NetscapePlugin::platformPostInitialize): + +2011-03-21 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + WebKit2 needs preferences to change security knobs + https://bugs.webkit.org/show_bug.cgi?id=56762 + + Add preferences for WebSecurityEnabled, UniversalAccessFromFileURLsAllowed + and FileAccessFromFileURLsAllowed. + + * Shared/WebPreferencesStore.h: + * UIProcess/API/C/WKPreferences.cpp: + (WKPreferencesSetWebSecurityEnabled): + (WKPreferencesGetWebSecurityEnabled): + (WKPreferencesSetUniversalAccessFromFileURLsAllowed): + (WKPreferencesGetUniversalAccessFromFileURLsAllowed): + (WKPreferencesSetFileAccessFromFileURLsAllowed): + (WKPreferencesGetFileAccessFromFileURLsAllowed): + * UIProcess/API/C/WKPreferencesPrivate.h: + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::updatePreferences): + +2011-03-21 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Remove old DrawingArea and LayerHostingView code from WKView. + + * UIProcess/API/mac/WKView.mm: + (-[WKView drawRect:]): + (-[WKView hitTest:]): + (-[WKView WebKit::]): + +2011-03-21 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Need WebKit2 API for creating a page with a specific main frame name + https://bugs.webkit.org/show_bug.cgi?id=56759 + + * Shared/WebPageCreationParameters.cpp: + (WebKit::WebPageCreationParameters::encode): + (WebKit::WebPageCreationParameters::decode): + * Shared/WebPageCreationParameters.h: + Add mainFrameName to creation parameters. + + * UIProcess/API/mac/WKView.h: + * UIProcess/API/mac/WKView.mm: + (-[WKView initWithFrame:]): + (-[WKView initWithFrame:contextRef:]): + (-[WKView initWithFrame:contextRef:pageGroupRef:]): + (-[WKView initWithFrame:contextRef:pageGroupRef:mainFrameName:]): + Add new initializer which takes a main frame name. + + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::setMainFrameName): + (WebKit::WebPageProxy::creationParameters): + * UIProcess/WebPageProxy.h: + Store the main frame name for initialization/re-initialization. + + * WebProcess/WebPage/WebFrame.cpp: + (WebKit::WebFrame::createMainFrame): + * WebProcess/WebPage/WebFrame.h: + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::WebPage): + Pass the name to main frame creation. + +2011-03-20 Bill Budge <bbudge@chromium.org> + + Reviewed by Adam Barth. + + Rename ThreadSafeShared to ThreadSafeRefCounted + https://bugs.webkit.org/show_bug.cgi?id=56714 + + No new tests. Exposes no new functionality. + + * Platform/CoreIPC/Connection.h: + * Platform/WorkQueue.h: + * Platform/win/WorkQueueWin.cpp: + * UIProcess/Launcher/ProcessLauncher.h: + * UIProcess/Launcher/ThreadLauncher.h: + +2011-03-19 Anton D'Auria <adauria@apple.com> + + Reviewed by Alexey Proskuryakov. + + ApplicationCacheGroup is not obsolete after being deleted via ApplicationCacheStorage::deleteEntriesForOrigin + https://bugs.webkit.org/show_bug.cgi?id=56415 + + * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp: calling ApplicationCacheGroup::deleteCacheGroupsForOrigin + instead of ApplicationCacheStorage::deleteEntriesForOrigin. + (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin): + +2011-03-18 Sam Weinig <sam@webkit.org> + + Attempt to fix the WinCairo build. + + * win/WebKit2.vcproj: + +2011-03-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Empty gray page after going back from a PDF + https://bugs.webkit.org/show_bug.cgi?id=56694 + <rdar://problem/8811854> + + Update m_frameHasCustomRepresentation when loading a page that's in the page cache. + + * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: + (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): + +2011-03-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Crash when sending a sync message ends up invalidating the connection + https://bugs.webkit.org/show_bug.cgi?id=56686 + <rdar://problem/9048781> + + Guard against a null client. + + * Platform/CoreIPC/Connection.cpp: + (CoreIPC::Connection::sendSyncMessage): + +2011-03-18 Balazs Kelemen <kbalazs@webkit.org> + + Reviewed by Benjamin Poulain. + + [Qt][WK2] Need a way to debug the web process after the UI process dies + https://bugs.webkit.org/show_bug.cgi?id=56116 + + Allow the web process to outlive it's parent process + in debug builds if the QT_WEBKIT_KEEP_ALIVE_WEB_PROCESS + environment variable is set. + + * UIProcess/Launcher/qt/ProcessLauncherQt.cpp: + (WebKit::QtWebProcess::setupChildProcess): Used getenv + since the prctl call is already in a Linux-only block + and the implementation in this file is a candidate + for sharing across ports in the future. + +2011-03-18 Darin Adler <darin@apple.com> + + Reviewed by Anders Carlsson. + + Command-period does not stop load when page has focus in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=56601 + + * UIProcess/API/mac/WKView.mm: + (-[WKView doCommandBySelector:]): If called outside interpretKeyEvents, + call through to super. + (-[WKView insertText:]): Assert that we are inside interpretKeyEvents. + (-[WKView unmarkText]): Ditto. + (-[WKView setMarkedText:selectedRange:]): Ditto. + (-[WKView _interceptKeyEvent:]): Set a flag to indicate we are inside + interpretKeyEvents for use by the above. + +2011-03-18 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=56425 + More groundwork for WebKit2 IconDatabase + + -Update the synchronous method names to be prefixed with "synchronous." + -Add empty implementations for the asynchronous accessors. + + * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: + (WebKit::WebIconDatabaseProxy::setEnabled): + (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL): + (WebKit::WebIconDatabaseProxy::synchronousIconURLForPageURL): + (WebKit::WebIconDatabaseProxy::synchronousIconDataKnownForIconURL): + (WebKit::WebIconDatabaseProxy::synchronousLoadDecisionForIconURL): + (WebKit::WebIconDatabaseProxy::supportsAsynchronousMode): + (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): + (WebKit::WebIconDatabaseProxy::iconDataForIconURL): + * WebProcess/IconDatabase/WebIconDatabaseProxy.h: + +2011-03-18 Alejandro G. Castro <alex@igalia.com> + + Reviewed by Martin Robinson. + + Fixed compilation after r80925. + + * GNUmakefile.am: + * UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp: Added. + (WebKit::WebFullScreenManagerProxy::enterFullScreen): + (WebKit::WebFullScreenManagerProxy::exitFullScreen): + (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): + (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): + (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): + (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): + (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): + (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): + (WebKit::WebFullScreenManagerProxy::getFullScreenRect): + * WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.cpp: Added. + (WebKit::WebFullScreenManagerGtk::WebFullScreenManagerGtk): + (WebKit::WebFullScreenManager::create): + (WebKit::WebFullScreenManagerGtk::setRootFullScreenLayer): + (WebKit::WebFullScreenManagerGtk::beginEnterFullScreenAnimation): + (WebKit::WebFullScreenManagerGtk::beginExitFullScreenAnimation): + * WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.h: Added. + +2011-03-18 Alejandro G. Castro <alex@igalia.com> + + Unreviewed, fixed compilation after r81208. + + * GNUmakefile.am: + +2011-03-18 John Sullivan <sullivan@apple.com> + + Reviewed by Dan Bernstein. + + https://bugs.webkit.org/show_bug.cgi?id=56645 + Assertion fires when hidden Find-on-Page matches are encountered in WebKit2 + + * WebProcess/WebPage/FindController.cpp: + (WebKit::FindController::updateFindIndicator): + Bail out if the selection rect is empty, before trying to generate an appropriately-sized + bitmap. (Previously it was bailing out afterwards, but encountering an assertion in debug + builds along the way.) + +2011-03-18 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Jon Honeycutt. + + <rdar://problem/9153929> PluginProcess fails to launch due to PluginProcessShim.dylib building for 64-bit only + + Fix a bogus change from r81392 that made PluginProcessShim.xcconfig import DebugRelease.xcconfig. + As its name suggests, DebugRelease.xcconfig is only applicable for the debug and release configurations. + It overrides the valid build architectures and also restricts the build to only the active architecture. + + * Configurations/PluginProcessShim.xcconfig: Import BaseTarget.xcconfig instead. This is what + each target-specific .xcconfig file should import. + +2011-03-17 Mark Rowe <mrowe@apple.com> + + Fix the build. + + * WebKit2.xcodeproj/project.pbxproj: + +2011-03-17 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Implement PluginProcessProxy::setFullscreenWindowIsShowing + https://bugs.webkit.org/show_bug.cgi?id=56618 + + * UIProcess/Plugins/PluginProcessProxy.cpp: + (WebKit::PluginProcessProxy::PluginProcessProxy): + Initialize m_fullscreenWindowIsShowing. + + (WebKit::PluginProcessProxy::didClose): + if m_fullscreenWindowIsShowing is true, call exitFullscreen. + + * UIProcess/Plugins/PluginProcessProxy.h: + * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: + (WebKit::PluginProcessProxy::getPluginProcessSerialNumber): + Add helper function for getting a PSN for the plug-in process. + + (WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess): + Make the plug-in process the front process. + + (WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess): + Make the current process (the UI process) the front process. + + (WebKit::PluginProcessProxy::setFullscreenWindowIsShowing): + Call enterFullscreen or exitFullscreen. + + (WebKit::PluginProcessProxy::enterFullscreen): + Make the plug-in process the front process and hide the menu bar. + + (WebKit::PluginProcessProxy::exitFullscreen): + Show the menu bar and if necessary make the UI process the front process. + + (WebKit::PluginProcessProxy::endModal): + call makeUIProcessTheFrontProcess. + + (WebKit::PluginProcessProxy::applicationDidBecomeActive): + Call makePluginProcessTheFrontProcess. + +2011-03-17 Adam Roben <aroben@apple.com> + + Make bidi text in <select> menus in WebKit2 on Windows match WebKit1 + + Fixes <http://webkit.org/b/56614> 3 <select> bidi tests failing on Windows 7 Release + (WebKit2 Tests) + + Reviewed by Sam Weinig. + + * WebProcess/WebCoreSupport/WebChromeClient.cpp: + (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural): + (WebKit::WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection): + On Windows, return the same values we return in WebKit1. + +2011-03-17 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Implement PluginProcessProxy::setModalWindowIsShowing + https://bugs.webkit.org/show_bug.cgi?id=56615 + + * UIProcess/Plugins/PluginProcessProxy.cpp: + (WebKit::PluginProcessProxy::PluginProcessProxy): + Initialize m_modalWindowIsShowing. + + (WebKit::PluginProcessProxy::didClose): + If m_modalWindowIsShowing is true, we must call endModal. + + * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: + (-[WKPlaceholderModalWindow _wantsUserAttention]): + Add a WKPlaceholderModalWindow. + + (WebKit::PluginProcessProxy::setModalWindowIsShowing): + Call beginModal or endModal depending on whether we're showing a modal window or not. + + (WebKit::PluginProcessProxy::beginModal): + Create a fake window and start a nested run loop. Listen for NSApplicationWillBecomeActiveNotification notifications. + + (WebKit::PluginProcessProxy::endModal): + Tear down the window and the run loop. + + (WebKit::PluginProcessProxy::applicationDidBecomeActive): + Make sure that the plug-in process is frontmost. + +2011-03-17 Jeff Miller <jeffm@apple.com> + + Reviewed by Adam Roben. + + Web page shouldn't swallow alt-key combinations on Windows + https://bugs.webkit.org/show_bug.cgi?id=56612 + + Make Alt+Left Arrow and Alt+Right Arrow go back and forward, but make + sure any alt-key combinations bubble up to the client. + + * WebProcess/WebPage/win/WebPageWin.cpp: + (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Make Alt+Left Arrow and Alt+Right Arrow go back and forward, ignore any other alt-key combinations. + +2011-03-17 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Send SetModalWindowIsShowing and SetFullscreenWindowIsShowing messages to the UI process + https://bugs.webkit.org/show_bug.cgi?id=56610 + + * PluginProcess/mac/PluginProcessMac.mm: + (WebKit::FullscreenWindowTracker::FullscreenWindowTracker): + Add fullscreen window tracker class. + + (WebKit::rectCoversAnyScreen): + Return whether the given rect covers any screen. + + (WebKit::windowCoversAnyScreen): + Return whether the given window covers any screen. + + (WebKit::FullscreenWindowTracker::windowShown): + If we're showing a fullscreen window, call PluginProcess::setFullscreenWindowIsShowing. + + (WebKit::FullscreenWindowTracker::windowHidden): + If we're hiding the last fullscreen window, call PluginProcess::setFullscreenWindowIsShowing. + + (WebKit::cocoaWindowShown): + (WebKit::cocoaWindowHidden): + (WebKit::carbonWindowShown): + (WebKit::carbonWindowHidden): + Call the window tracking functions. + + (WebKit::setModal): + Call PluginProcess::setModalWindowIsShowing. + + (WebKit::PluginProcess::setModalWindowIsShowing): + (WebKit::PluginProcess::setFullscreenWindowIsShowing): + Send CoreIPC messages. + + * UIProcess/Plugins/PluginProcessProxy.h: + * UIProcess/Plugins/PluginProcessProxy.messages.in: + Add new messages. + + * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: + (WebKit::PluginProcessProxy::setModalWindowIsShowing): + (WebKit::PluginProcessProxy::setFullscreenWindowIsShowing): + Add stubs. + +2011-03-17 Sam Weinig <sam@webkit.org> + + Reviewed by Brady Eidson. + + Allow passing a certificate chain as a user message + <rdar://problem/8951709> + https://bugs.webkit.org/show_bug.cgi?id=56605 + + * Shared/API/c/mac/WKCertificateInfoMac.h: + * Shared/API/c/mac/WKCertificateInfoMac.mm: + (WKCertificateInfoCreateWithCertficateChain): + Added. Creates a WKCertificate from a certificate chain. + + * Shared/UserMessageCoders.h: + (WebKit::UserMessageEncoder::baseEncode): + (WebKit::UserMessageDecoder::baseDecode): + Add encoding/decoding of WebCertificateInfo. + +2011-03-17 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Add PluginProcessShim hooks for when windows are shown and hidden + https://bugs.webkit.org/show_bug.cgi?id=56597 + + * Configurations/PluginProcessShim.xcconfig: + Add HEADER_SEARCH_PATHS so we can find WebKitSystemInterface.h. + + * PluginProcess/mac/PluginProcessMac.mm: + (WebKit::cocoaWindowShown): + (WebKit::cocoaWindowHidden): + (WebKit::carbonWindowShown): + (WebKit::carbonWindowHidden): + (WebKit::setModal): + (WebKit::PluginProcess::initializeShim): + Add empty stubs. + + * PluginProcess/mac/PluginProcessShim.h: + * PluginProcess/mac/PluginProcessShim.mm: + (WebKit::beginModal): + (WebKit::endModal): + Keep a modal count and call setModal accordingly. + + (WebKit::shim_NSApplication_RunModalForWindow): + (WebKit::shimModalDialog): + (WebKit::shimAlert): + Call beginModal/endModal. + + (WebKit::shimShowWindow): + (WebKit::shimHideWindow): + Call the shim functions. + + (WebKit::WebKitPluginProcessShimInitialize): + Listen for notifications and call the necessary shim functions. + + * WebKit2.xcodeproj/project.pbxproj: + Link the plug-in process shim with AppKit and QuartzCore and WKSI. + +2011-03-17 Jeff Miller <jeffm@apple.com> + + Use a consistent set of file patterns in the svn:ignore property for all .xcodeproj directories, specifically: + + *.mode* + *.pbxuser + *.perspective* + project.xcworkspace + xcuserdata + + * WebKit2.xcodeproj: Modified property svn:ignore. + +2011-03-17 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + WKErrors need the PeerCertificateChain for certificate errors + <rdar://problem/8951784> + https://bugs.webkit.org/show_bug.cgi?id=56592 + + * Shared/WebCoreArgumentCoders.h: + Special case encoding/decoding of ResourceErrors for the mac. + + * Shared/mac/PlatformCertificateInfo.h: + * Shared/mac/PlatformCertificateInfo.mm: + (WebKit::PlatformCertificateInfo::PlatformCertificateInfo): + Add constructor that take the PeerCertificateChain as CFArrayRef. + + * Shared/mac/WebCoreArgumentCodersMac.mm: + (CoreIPC::encodeResourceError): + (CoreIPC::decodeResourceError): + Add encode/decode for ResourceError using the underlying NSError + and encoding/decoding as much of the userInfo as we know how to. + Right now this includes all string values and the PeerCertificateChain. + +2011-03-17 John Sullivan <sullivan@apple.com> + + Reviewed by Adam Roben. + + https://bugs.webkit.org/show_bug.cgi?id=56574 + Dealloc'ing a WKView can leave a stale reference to it in NSWindow + + * UIProcess/API/mac/WKView.mm: + (-[WKView viewWillMoveToWindow:]): + Clear the outgoing window's growBoxOwner if it is this view. + +2011-03-17 Anders Carlsson <andersca@apple.com> + + Rubber-stamped by John Sullivan. + + Rename PluginProcessShim.cpp to PluginProcessShim.mm. + + * PluginProcess/mac/PluginProcessShim.cpp: Removed. + * PluginProcess/mac/PluginProcessShim.mm: Copied from PluginProcess/mac/PluginProcessShim.cpp. + * WebKit2.xcodeproj/project.pbxproj: + +2011-03-17 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + Invalidate all NPObjects for a plug-in when that plug-in is destroyed + https://bugs.webkit.org/show_bug.cgi?id=56511 + <rdar://problem/8993491> + + Before this change, we would invalidate NPObjectProxy objects and delete NPObjectMessageReceiver + objects when the last plug-in of a certain type was destroyed. Doing so caused us to hold on to memory + which we don't need, and could also lead to crashes if the NPObjectMessageReceiver would get a message and + tried to invoke it on a already deallocated NPObject. + + * PluginProcess/PluginControllerProxy.cpp: + (WebKit::PluginControllerProxy::initialize): + If we fail to initialize, call removePluginControllerProxy instead of having WebProcessConnection do so. + + (WebKit::PluginControllerProxy::destroy): + Pass the plug-in to removePluginControllerProxy. + + * PluginProcess/WebProcessConnection.cpp: + (WebKit::WebProcessConnection::removePluginControllerProxy): + Call NPRemoteObjectMap::pluginDestroyed when the plug-in has been destroyed. + + (WebKit::WebProcessConnection::createPlugin): + Don't call removePluginControllerProxy if the plug-in fails to initialize. PluginControllerProxy::initialize now + takes care of doing this. + + * Shared/Plugins/NPObjectMessageReceiver.cpp: + (WebKit::NPObjectMessageReceiver::NPObjectMessageReceiver): + (WebKit::NPObjectMessageReceiver::~NPObjectMessageReceiver): + * Shared/Plugins/NPObjectMessageReceiver.h: + Remove m_shouldReleaseObjectWhenInvalidating, we now know that no NPObjects will have been deallocated + by the time the NPObjectMessageReceiver is destroyed. + + (WebKit::NPObjectMessageReceiver::plugin): + Add getter. + + * Shared/Plugins/NPObjectProxy.h: + (WebKit::NPObjectProxy::plugin): + Add getter. + + * Shared/Plugins/NPRemoteObjectMap.cpp: + (WebKit::NPRemoteObjectMap::NPRemoteObjectMap): + Remove m_isInvalidating. + + (WebKit::NPRemoteObjectMap::npObjectProxyDestroyed): + Simplify code. + + (WebKit::NPRemoteObjectMap::pluginDestroyed): + Rename invalidate to pluginDestroyed. Only invalidate/delete objects that belong to the given plug-in. + + * Shared/Plugins/NPRemoteObjectMap.h: + Remove m_isInvalidating. + + * WebProcess/Plugins/PluginProcessConnection.cpp: + (WebKit::PluginProcessConnection::removePluginProxy): + Call NPRemoteObjectMap::pluginDestroyed when the plug-in has been destroyed. + +2011-03-17 Oleg Romashin <oleg.romashin@nokia.com> + + Reviewed by Anders Carlsson. + + Teach WebKit2 messages.py generator to ifdef headers include + which are related to ifdef-ed methods/types + https://bugs.webkit.org/show_bug.cgi?id=55658 + + * Scripts/webkit2/messages.py: + * Scripts/webkit2/messages_unittest.py: + +2011-03-16 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + Viewport no longer allows an auto value for "user-scalable" + https://bugs.webkit.org/show_bug.cgi?id=55416 + + Make the default value for userScalable be true. + + * UIProcess/API/qt/qwkpage.cpp: + (QWKPage::viewportAttributesForSize): + +2011-03-16 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + NPObjectProxy and NPObjectMessageReceiver objects should know their Plugin object + https://bugs.webkit.org/show_bug.cgi?id=56506 + + * PluginProcess/PluginControllerProxy.cpp: + (WebKit::PluginControllerProxy::windowScriptNPObject): + (WebKit::PluginControllerProxy::pluginElementNPObject): + (WebKit::PluginControllerProxy::evaluate): + (WebKit::PluginControllerProxy::getPluginScriptableNPObject): + * Shared/Plugins/NPObjectMessageReceiver.cpp: + (WebKit::NPObjectMessageReceiver::create): + (WebKit::NPObjectMessageReceiver::NPObjectMessageReceiver): + (WebKit::NPObjectMessageReceiver::invoke): + (WebKit::NPObjectMessageReceiver::invokeDefault): + (WebKit::NPObjectMessageReceiver::getProperty): + (WebKit::NPObjectMessageReceiver::setProperty): + (WebKit::NPObjectMessageReceiver::construct): + * Shared/Plugins/NPObjectMessageReceiver.h: + * Shared/Plugins/NPObjectProxy.cpp: + (WebKit::NPObjectProxy::create): + (WebKit::NPObjectProxy::NPObjectProxy): + (WebKit::NPObjectProxy::invalidate): + (WebKit::NPObjectProxy::initialize): + (WebKit::NPObjectProxy::invoke): + (WebKit::NPObjectProxy::invokeDefault): + (WebKit::NPObjectProxy::getProperty): + (WebKit::NPObjectProxy::setProperty): + (WebKit::NPObjectProxy::construct): + * Shared/Plugins/NPObjectProxy.h: + * Shared/Plugins/NPRemoteObjectMap.cpp: + (WebKit::NPRemoteObjectMap::createNPObjectProxy): + (WebKit::NPRemoteObjectMap::registerNPObject): + (WebKit::NPRemoteObjectMap::npVariantToNPVariantData): + (WebKit::NPRemoteObjectMap::npVariantDataToNPVariant): + * Shared/Plugins/NPRemoteObjectMap.h: + * WebProcess/Plugins/PluginProxy.cpp: + (WebKit::PluginProxy::pluginScriptableNPObject): + (WebKit::PluginProxy::getWindowScriptNPObject): + (WebKit::PluginProxy::getPluginElementNPObject): + (WebKit::PluginProxy::evaluate): + +2011-03-16 Beth Dakin <bdakin@apple.com> + + Reviewed by Darin Adler. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=54987 Crash beneath + WebPageProxy::viewWillStartLiveResize when resizing window after web process + crashed + -and corresponding- + <rdar://problem/9037685> + + Just need simple isValid() checks here. + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::initializeUIClient): + (WebKit::WebPageProxy::viewWillStartLiveResize): + (WebKit::WebPageProxy::viewWillEndLiveResize): + +2011-03-16 Damian Kaleta <dkaleta@apple.com> + + Reviewed by Kevin Decker. + + Add a user default that will force all plugins to opt in to non-executable data + https://bugs.webkit.org/show_bug.cgi?id=56487 + <rdar://problem/9109095> + + * UIProcess/Plugins/PluginProcessProxy.cpp: + (WebKit::PluginProcessProxy::PluginProcessProxy): + * UIProcess/Plugins/PluginProcessProxy.h: + * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: + (WebKit::PluginProcessProxy::pluginNeedsExecutableHeap): + +2011-03-16 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Darin Adler. + + WK2: Need to propagate enhanced accessibility flag from UI -> web process + https://bugs.webkit.org/show_bug.cgi?id=56379 + + Support sending the enhanced accessibility flag between processes. + + * UIProcess/WebContext.cpp: + (WebKit::WebContext::~WebContext): + (WebKit::WebContext::setEnhancedAccessibility): + * UIProcess/WebContext.h: + * UIProcess/gtk/WebContextGtk.cpp: + (WebKit::WebContet::platformInvalidateContext): + * UIProcess/mac/WebContextMac.mm: + (WebKit::WebContext::platformInitializeWebProcess): + (WebKit::WebContext::platformInvalidateContext): + * UIProcess/qt/WebContextQt.cpp: + (WebKit::WebContext::platformInvalidateContext): + * UIProcess/win/WebContextWin.cpp: + (WebKit::WebContext::platformInvalidateContext): + * WebProcess/WebProcess.cpp: + (WebKit::WebProcess::setEnhancedAccessibility): + * WebProcess/WebProcess.h: + * WebProcess/WebProcess.messages.in: + +2011-03-15 Oliver Hunt <oliver@apple.com> + + Reviewed by Geoffrey Garen. + + Make Structure creation require a JSGlobalData + https://bugs.webkit.org/show_bug.cgi?id=56438 + + Mechanical change to make all Structure creation use a JSGlobalData&. + + * WebProcess/Plugins/Netscape/JSNPMethod.cpp: + (WebKit::JSNPMethod::JSNPMethod): + * WebProcess/Plugins/Netscape/JSNPMethod.h: + (WebKit::JSNPMethod::createStructure): + * WebProcess/Plugins/Netscape/JSNPObject.cpp: + (WebKit::JSNPObject::JSNPObject): + * WebProcess/Plugins/Netscape/JSNPObject.h: + (WebKit::JSNPObject::createStructure): + +2011-03-16 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Dan Bernstein. + + WebKit2: Sometimes Command-[ opens a new tab and loads the back page in it + https://bugs.webkit.org/show_bug.cgi?id=56477 + <rdar://problem/8806664> + + * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::doneWithKeyEvent): + Set NSApplication current event when re-dispatching a key event that returned from the web + process unhandled. That way, code that looks at current event modifiers won't be confused. + +2011-03-16 Sam Weinig <sam@webkit.org> + + Reviewed by Adam Roben. + + Add WebKit2 API to figure out if an input or textarea was edited + https://bugs.webkit.org/show_bug.cgi?id=56474 + + Expose WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit and + WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit. Next time, + I will work on giving these functions longer names. + + * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: + (WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit): + (WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit): + * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: + * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: + (WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit): + (WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit): + * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: + +2011-03-16 Brady Eidson <beidson@apple.com> + + Reviewed by Adam Roben. + + https://bugs.webkit.org/show_bug.cgi?id=56467 + IconDatabase-related crash seen in WK2 tests + + * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: + (WebKit::WebIconDatabaseProxy::setIconDataForIconURL): The IconLoader might set a null data for an icon, so handle that case. + +2011-03-16 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt][WK2] Loading an empty URL crashes + https://bugs.webkit.org/show_bug.cgi?id=55501 + + A null WKURLRef is created in the API of WebKit 2 when converting a null string. The code + of WKPageLoadURL assume the WKPageRef is not null which causes crashes if it is. + + This patch uses the converter toWTFString() to pass from WKPageRef to WTFString. This converter + ensure the returned string is a valid null string. + + Tested through the Qt API tests. + + * UIProcess/API/C/WKPage.cpp: + (WKPageLoadURL): + * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp: + (tst_QGraphicsWKView::loadEmptyUrl): + * UIProcess/API/qt/tests/qwkpage/qwkpage.pro: Added. + * UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp: Added. + (tst_QWKPage::init): + (tst_QWKPage::cleanup): + (tst_QWKPage::loadEmptyUrl): + * UIProcess/API/qt/tests/tests.pro: + +2011-03-15 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=56425 + WebKit2 icon database. + + Project file paperwork: + * DerivedSources.make: + * DerivedSources.pro: + * GNUmakefile.am: + * WebKit2.pri: + * WebKit2.pro: + * WebKit2.xcodeproj/project.pbxproj: + * win/WebKit2.vcproj: + * win/WebKit2Common.vsprops: + * Scripts/webkit2/messages.py: Special-case capitalization for messages that start with "URL" to be lowercased + to "url" instead of "uRL". + + Add messaging-related stuff: + * Platform/CoreIPC/MessageID.h: + * UIProcess/WebIconDatabase.messages.in: Added. + * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: Added. + * UIProcess/WebProcessProxy.cpp: + (WebKit::WebProcessProxy::didReceiveMessage): + (WebKit::WebProcessProxy::didReceiveSyncMessage): + + Prep to make WebIconDatabase an API object: + * Shared/APIObject.h: + + Add an "icon DB is enabled" flag to WebProcessCreationParameters: + * Shared/WebProcessCreationParameters.cpp: + (WebKit::WebProcessCreationParameters::encode): + (WebKit::WebProcessCreationParameters::decode): + * Shared/WebProcessCreationParameters.h: + + Add SPI for client apps to set the icon database path: + * UIProcess/API/C/WKContext.cpp: + (WKContextSetIconDatabasePath): + * UIProcess/API/C/WKContextPrivate.h: + * UIProcess/WebContext.h: + (WebKit::WebContext::setIconDatabasePath): + + Hook up initialization, clearing, and messaging for the icon database: + * UIProcess/WebContext.cpp: + (WebKit::WebContext::WebContext): + (WebKit::WebContext::~WebContext): + (WebKit::WebContext::ensureWebProcess): + (WebKit::WebContext::didReceiveMessage): + (WebKit::WebContext::didReceiveSyncMessage): + (WebKit::WebContext::iconDatabasePath): + * UIProcess/gtk/WebContextGtk.cpp: + (WebKit::WebContext::platformDefaultIconDatabasePath): + * UIProcess/mac/WebContextMac.mm: + (WebKit::WebContext::platformDefaultIconDatabasePath): + * UIProcess/qt/WebContextQt.cpp: + (WebKit::WebContext::platformDefaultIconDatabasePath): + * UIProcess/win/WebContextWin.cpp: + (WebKit::WebContext::platformDefaultIconDatabasePath): + + Add the UIProcess-side IconDatabase. It will be the "actual database" as well as the API object: + * UIProcess/WebIconDatabase.cpp: Added. + (WebKit::WebIconDatabase::create): + (WebKit::WebIconDatabase::~WebIconDatabase): + (WebKit::WebIconDatabase::WebIconDatabase): + (WebKit::WebIconDatabase::invalidate): + (WebKit::WebIconDatabase::retainIconForPageURL): + (WebKit::WebIconDatabase::releaseIconForPageURL): + (WebKit::WebIconDatabase::setIconURLForPageURL): + (WebKit::WebIconDatabase::setIconDataForIconURL): + (WebKit::WebIconDatabase::iconDataForPageURL): + (WebKit::WebIconDatabase::iconURLForPageURL): + (WebKit::WebIconDatabase::iconDataKnownForIconURL): + (WebKit::WebIconDatabase::loadDecisionForIconURL): + (WebKit::WebIconDatabase::didReceiveMessage): + (WebKit::WebIconDatabase::didReceiveSyncMessage): + * UIProcess/WebIconDatabase.h: Added. + (WebKit::WebIconDatabase::clearContext): + (WebKit::WebIconDatabase::type): + + Add the WebProcess-side IconDatabaseProxy. It acts as the WebCore IconDatabase and operates via messaging: + * WebProcess/IconDatabase: Added. + * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: Added. + (WebKit::WebIconDatabaseProxy::~WebIconDatabaseProxy): + (WebKit::WebIconDatabaseProxy::WebIconDatabaseProxy): + (WebKit::WebIconDatabaseProxy::isEnabled): + (WebKit::WebIconDatabaseProxy::setEnabled): + (WebKit::WebIconDatabaseProxy::iconForPageURL): + (WebKit::WebIconDatabaseProxy::retainIconForPageURL): + (WebKit::WebIconDatabaseProxy::releaseIconForPageURL): + (WebKit::WebIconDatabaseProxy::iconURLForPageURL): + (WebKit::WebIconDatabaseProxy::iconDataKnownForIconURL): + (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): + (WebKit::WebIconDatabaseProxy::setIconURLForPageURL): + (WebKit::WebIconDatabaseProxy::setIconDataForIconURL): + (WebKit::WebIconDatabaseProxy::urlImportFinished): + (WebKit::WebIconDatabaseProxy::didReceiveMessage): + * WebProcess/IconDatabase/WebIconDatabaseProxy.h: Added. + + Hook up initialization and messaging for the icon database proxy: + * WebProcess/WebProcess.cpp: + (WebKit::WebProcess::WebProcess): + (WebKit::WebProcess::initializeWebProcess): + (WebKit::WebProcess::didReceiveMessage): + * WebProcess/WebProcess.h: + +2011-03-15 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + WebKit2: False SPOD cursor when context menu is open + <rdar://problem/9029154> + https://bugs.webkit.org/show_bug.cgi?id=56433 + + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::showContextMenu): + Update to match showPopupMenu idiomatically, and stop the responsivenessTimer + since the act of showing the context menu could spin a nested runloop. + + * UIProcess/mac/WebContextMenuProxyMac.mm: + (WebKit::WebContextMenuProxyMac::showContextMenu): + * UIProcess/qt/WebContextMenuProxyQt.cpp: + (WebKit::WebContextMenuProxyQt::showContextMenu): + * UIProcess/win/WebContextMenuProxyWin.cpp: + (WebKit::WebContextMenuProxyWin::showContextMenu): + Move isEmpty() check to implementations, since we don't want to show + this in any case, not just the one where we check it. + +2011-03-15 Siddharth Mathur <siddharth.mathur@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt][Symbian][WK2] Fix exporting and importing the WebProcessMainQt symbol + https://bugs.webkit.org/show_bug.cgi?id=56417 + + Use the Q_DECL_EXPORT and Q_DECL_IMPORT macros directly to make sure + the symbol is always exported/imported. + + * WebProcess/qt/WebProcessMainQt.cpp: + (WebKit::WebProcessMainQt): + * qt/MainQt.cpp: + +2011-03-15 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + REGRESSION (WebKit2): keygen element doesn't work + https://bugs.webkit.org/show_bug.cgi?id=56402 + <rdar://problem/9006545> + + * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: + * WebProcess/WebCoreSupport/WebPlatformStrategies.h: + Added strings used by keygen. + + * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: Initialize a WebCore pointer to + a function used by keygen. + +2011-03-15 Beth Dakin <bdakin@apple.com> + + Reviewed by Simon Fraser. + + WebKit2 part of <rdar://problem/9075624> Overlay scrollbars slow down PLT by 6% + + New WebKitystemInterface function to force the scrollbars to flash + * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: + (InitWebCoreSystemInterface): + +2011-03-15 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Make sure that NP_Shutdown is always the last NPP function called + https://bugs.webkit.org/show_bug.cgi?id=56391 + <rdar://problem/8989902> + + Make sure to always increment the load count whenever a web process connection + is opened to a plug-in process, and decrement it when the last web process connection + goes away. + + * PluginProcess/PluginProcess.cpp: + (WebKit::PluginProcess::createWebProcessConnection): + (WebKit::PluginProcess::startShutdownTimerIfNecessary): + * Shared/Plugins/Netscape/NetscapePluginModule.cpp: + * Shared/Plugins/Netscape/NetscapePluginModule.h: + * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: + (WebKit::NetscapePlugin::NetscapePlugin): + (WebKit::NetscapePlugin::~NetscapePlugin): + +2011-03-15 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Adam Barth. + + [GTK] [WebKit2] The UIProcess never changes the mouse cursor + https://bugs.webkit.org/show_bug.cgi?id=56333 + + Add an implementation for WebView::addCursor for WebKit2 GTK+. This allows + the cursor to change as the user mouses around the page. There is currently + no test infrastructure to track cursor changes. + + * UIProcess/gtk/WebView.cpp: + (WebKit::WebView::setCursor): Ported implementation from WebKit1. + +2011-03-15 Kevin Ollivier <kevino@theolliviers.com> + + Reviewed by Darin Adler. + + Introduce WTF_USE_EXPORT_MACROS, which will allow us to put shared library import/export + info into the headers rather than in export symbol definition files, but disable it on + all platforms initially so we can deal with port build issues one port at a time. + + https://bugs.webkit.org/show_bug.cgi?id=27551 + + * config.h: + +2011-03-14 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + REGRESSION: Print preview is blank when selecting multiple pages per sheet + https://bugs.webkit.org/show_bug.cgi?id=56341 + <rdar://problem/8991382> + + * UIProcess/API/mac/WKPrintingView.mm: (pageDidDrawToPDF): Don't reset latest expected + callback number after receiving a different one. We only update preview after receiving + the latest expected page data (and the assumption is that AppKit will ask for pages in + natural order for N-up). + +2011-03-14 Adam Roben <aroben@apple.com> + + Make WKBundlePageCanHandleRequest return true for empty document URLs + + Reviewed by Sam Weinig. + + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::canHandleRequest): Return true for any URL schemes that are handled as + empty documents, and defer to the platform for everything else. + + * WebProcess/WebPage/WebPage.h: Added platformCanHandleRequest. + + * WebProcess/WebPage/mac/WebPageMac.mm: + (WebKit::WebPage::platformCanHandleRequest): + * WebProcess/WebPage/qt/WebPageQt.cpp: + (WebKit::WebPage::platformCanHandleRequest): + * WebProcess/WebPage/win/WebPageWin.cpp: + (WebKit::WebPage::platformCanHandleRequest): + Renamed from canHandleRequest. + +2011-03-14 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Beth Dakin. + + CrashTracer: 60 crashes in WebProcess at com.apple.WebKit2: -[AccessibilityWebPageObject accessibilityHitTest:] + 248 + https://bugs.webkit.org/show_bug.cgi?id=56336 + + Crash trace indicates a nil pointer access in one of these m_page->mainFrame()->coreFrame()->view() + pointers. + + * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm: + (-[AccessibilityWebPageObject accessibilityHitTest:]): + +2011-03-14 Alice Liu <alice.liu@apple.com> + + Reviewed by Sam Weinig. + + Provide API for creating WKImage from CGImageRef + https://bugs.webkit.org/show_bug.cgi?id=56159 + + Add function for creating a WKImage from CGImage data. + * Shared/API/c/cg/WKImageCG.cpp: + (WKImageCreateFromCGImage): Added. Creates a graphics context for the bitmap-backed image and draws into it. + * Shared/API/c/cg/WKImageCG.h: + +2011-03-14 Balazs Kelemen <kbalazs@webkit.org> + + Reviewed by Adam Roben. + + [Qt][WK2]Unbreak InjectedBundle on Qt + https://bugs.webkit.org/show_bug.cgi?id=54109 + + Add API's to WKURL and WKString to satisfy + WebKitTestRunner's needs. + + * Shared/API/c/WKString.cpp: + (WKStringIsEqualToUTF8CStringIgnoringCase): + * Shared/API/c/WKString.h: + * Shared/API/c/WKURL.cpp: + (WKURLCopyHostName): + (WKURLCopyScheme): + * Shared/API/c/WKURL.h: + * Shared/WebString.h: + (WebKit::WebString::equalToUTF8StringIgnoringCase): + * Shared/WebURL.h: Added OwnPtr<KURL> member to be able + to lazily parse the URL and store the result. + (WebKit::WebURL::host): + (WebKit::WebURL::protocol): + (WebKit::WebURL::parseURLIfNecessary): + * win/WebKit2.def: Revert the symbol exports that were + needed to use KURL in WebKitTestRunner. + +2011-03-14 Jeff Miller <jeffm@apple.com> + + Reviewed by Adam Roben. + + Add WKViewSetScrollOffsetOnNextResize() to C API on Windows + https://bugs.webkit.org/show_bug.cgi?id=56340 + + * UIProcess/API/C/win/WKView.cpp: + (WKViewSetScrollOffsetOnNextResize): Added. + * UIProcess/API/C/win/WKView.h: Added WKViewSetScrollOffsetOnNextResize(). + * UIProcess/win/WebView.cpp: + (WebKit::WebView::onSizeEvent): Apply any scroll offset when setting the drawing area size. + (WebKit::WebView::setScrollOffsetOnNextResize): Added. + * UIProcess/win/WebView.h: Added setScrollOffsetOnNextResize(). + +2011-03-14 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Adam Roben and Gavin Barraclough. + + FileSystemWin.cpp needs listDirectory() implementation + https://bugs.webkit.org/show_bug.cgi?id=56331 + <rdar://problem/9126635> + + Move PathWalker down into WebCore, and call the PathWalker in WebCore + (that now has a second argument, the pattern to take). + + * UIProcess/Plugins/win/PluginInfoStoreWin.cpp: + (WebKit::PluginInfoStore::pluginPathsInDirectory): + +2011-03-14 Sam Weinig <sam@webkit.org> + + Reviewed by Darin Adler. + + WebKit2: No icon shown for <input type=file> + <rdar://problem/8988982> + https://bugs.webkit.org/show_bug.cgi?id=54288 + + * WebProcess/WebCoreSupport/WebChromeClient.cpp: + (WebKit::WebChromeClient::chooseIconForFiles): + Add implementation for chooseIconForFiles which calls down to Icon::createIconForFiles. + +2011-03-14 Brady Eidson <beidson@apple.com> + + Reviewed by Dan Bernstein. + + <rdar://problem/8762095> and https://bugs.webkit.org/show_bug.cgi?id=55172 + Need WK2 API to view/manage origins with LocalStorage + + Hookup the existing API stubs to the WebCore implementations: + * WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp: + (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins): + (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin): + (WebKit::WebKeyValueStorageManager::deleteAllEntries): + +2011-03-13 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + <rdar://problem/9127270> and https://bugs.webkit.org/show_bug.cgi?id=56282 + + Pass the path along with creation parameters: + * Shared/WebProcessCreationParameters.cpp: + (WebKit::WebProcessCreationParameters::encode): + (WebKit::WebProcessCreationParameters::decode): + * Shared/WebProcessCreationParameters.h: + + Add SPI to set the path: + * UIProcess/API/C/WKContext.cpp: + (WKContextSetLocalStorageDirectory): + * UIProcess/API/C/WKContextPrivate.h: + + Pass the path along in the process creation parameters: + * UIProcess/WebContext.cpp: + (WebKit::WebContext::ensureWebProcess): + (WebKit::WebContext::localStorageDirectory): + * UIProcess/WebContext.h: + (WebKit::WebContext::setLocalStorageDirectory): + + * UIProcess/gtk/WebContextGtk.cpp: + (WebKit::WebContext::platformDefaultLocalStorageDirectory): + * UIProcess/mac/WebContextMac.mm: + (WebKit::WebContext::platformDefaultLocalStorageDirectory): + * UIProcess/qt/WebContextQt.cpp: + (WebKit::WebContext::platformDefaultLocalStorageDirectory): + * UIProcess/win/WebContextWin.cpp: + (WebKit::WebContext::platformDefaultLocalStorageDirectory): + + Include the path with settings updates, because WebCore needs it set on the Settings object: + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::updatePreferences): + + * WebProcess/WebProcess.cpp: + (WebKit::WebProcess::initializeWebProcess): + * WebProcess/WebProcess.h: + (WebKit::WebProcess::localStorageDirectory): + + Sandboxing stuff: + * WebProcess/com.apple.WebProcess.sb: + * WebProcess/mac/WebProcessMac.mm: + (WebKit::initializeSandbox): + +2011-03-12 Jer Noble <jer.noble@apple.com> + + Reviewed by Mark Rowe. + + WebKit2: Build WKFullScreenWindowController cleanly in 32-bit. + https://bugs.webkit.org/show_bug.cgi?id=56260 + + Include <Carbon/Carbon.h> instead of <HIToolbox/MacApplication.h>. + + * UIProcess/mac/WKFullScreenWindowController.mm: + +2011-03-13 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Add ability to create a WKErrorRef + <rdar://problem/9115768> + https://bugs.webkit.org/show_bug.cgi?id=56279 + + * Shared/API/c/cf/WKErrorCF.cpp: Added. + (WKErrorCreateWithCFError): + (WKErrorCopyCFError): + * Shared/API/c/cf/WKErrorCF.h: Added. + Add new API to create a WKErrorRef from a CFErrorRef + and vice-versa. + + * WebKit2.xcodeproj/project.pbxproj: + * win/WebKit2.vcproj: + * win/WebKit2Generated.make: + Add new files. + +2011-03-13 Pratik Solanki <psolanki@apple.com> + + Reviewed by Brady Eidson. + + Make adjustMIMETypeIfNecessary use CFNetwork directly + https://bugs.webkit.org/show_bug.cgi?id=55912 + + * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: + (InitWebCoreSystemInterface): Support for new WKSI functions. + +2011-03-13 Dan Bernstein <mitz@apple.com> + + Reviewed by Darin Adler. + + WebPageProxy cleanup + https://bugs.webkit.org/show_bug.cgi?id=56267 + + * UIProcess/WebPageProxy.cpp: Moved all Mac-only function implementations from + here to WebPageProxyMac.mm. + * UIProcess/WebPageProxy.h: Cleaned up #includes. + * UIProcess/mac/WebPageProxyMac.mm: Moved all Mac-only function implementations + here. + (WebKit::WebPageProxy::updateWindowIsVisible): + (WebKit::WebPageProxy::windowAndViewFramesChanged): + (WebKit::WebPageProxy::getMarkedRange): + (WebKit::WebPageProxy::characterIndexForPoint): + (WebKit::WebPageProxy::firstRectForCharacterRange): + (WebKit::WebPageProxy::writeSelectionToPasteboard): + (WebKit::WebPageProxy::setDragImage): + (WebKit::WebPageProxy::performDictionaryLookupAtLocation): + (WebKit::WebPageProxy::interpretKeyEvent): + (WebKit::WebPageProxy::sendComplexTextInputToPlugin): + (WebKit::WebPageProxy::uppercaseWord): + (WebKit::WebPageProxy::lowercaseWord): + (WebKit::WebPageProxy::capitalizeWord): + (WebKit::WebPageProxy::setSmartInsertDeleteEnabled): + (WebKit::WebPageProxy::didPerformDictionaryLookup): + (WebKit::WebPageProxy::registerWebProcessAccessibilityToken): + (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens): + (WebKit::WebPageProxy::setComplexTextInputEnabled): + +2011-03-13 Dan Bernstein <mitz@apple.com> + + Reviewed by Darin Adler. + + <rdar://problem/8949683> WebKit2: Drag image is offset when the page is scrolled down + https://bugs.webkit.org/show_bug.cgi?id=56265 + + * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: + (WebKit::WebDragClient::startDrag): Send the location in view coordinates rather than + document coordinates. + +2011-03-13 Dan Bernstein <mitz@apple.com> + + Reviewed by Mark Rowe. + + Fix a crash when dragging. + + * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: + (WebKit::convertImageToBitmap): Retain the saved context. + +2011-03-12 Darin Adler <darin@apple.com> + + * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: + (WebKit::WebDragClient::startDrag): Fixed typo in a comment. + +2011-03-11 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Dragging image to desktop gives webloc instead of image file in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=56193 + + * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: + (WebKit::convertImageToBitmap): Added. Factored out from startDrag to + make the startDrag code clearer. + (WebKit::WebDragClient::startDrag): Streamlined code a bit. + (WebKit::cachedImage): Added. Helper for function below. + (WebKit::arrayForURLsWithTitles): Added. Helper for function below. + (WebKit::WebDragClient::declareAndWriteDragImage): Added code to handle file + promises and removed a log of uneeded code. + (-[WKPasteboardFilePromiseOwner copyDropDirectory]): Added. + (promisedDataClient): Added. + (-[WKPasteboardOwner clearImage]): Added. + (-[WKPasteboardOwner initWithImage:]): Added. + (-[WKPasteboardOwner dealloc]): Added. + (-[WKPasteboardOwner finalize]): Added. + (-[WKPasteboardOwner pasteboard:provideDataForType:]): Added. + (-[WKPasteboardOwner pasteboardChangedOwner:]): Added. + (matchesExtensionOrEquivalent): Added. + (-[WKPasteboardOwner namesOfPromisedFilesDroppedAtDestination:]): Added. + Much of the new code above came from the WebKit1 drag code. + + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::dragEnded): Added call to Mac-only platformDragEnded. + * WebProcess/WebPage/WebPage.h: Added Mac-only platformDragEnded and m_dragSource. + * WebProcess/WebPage/mac/WebPageMac.mm: + (WebKit::WebPage::setDragSource): Added. + (WebKit::WebPage::platformDragEnded): Added. + +2011-03-12 Mark Rowe <mrowe@apple.com> + + Fix the 32-bit build. + + This involves hacking around some HIToolbox headers that do things of dubious correctness, + and fixing the usual CGRect vs NSRect issues. + + * UIProcess/mac/WKFullScreenWindowController.mm: + (-[WKFullScreenWindowController enterFullScreen:]): NSRect is not CGRect. + * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: + (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto. + +2011-03-12 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + * WebProcess/WebPage/WebFrame.cpp: + (WebKit::WebFrame::url): + Get the URL from the loader, not from the document. + + (WebKit::WebFrame::suggestedFilenameForResourceWithURL): + Return the correct suggested filename for the main resource. + + (WebKit::WebFrame::mimeTypeForResourceWithURL): + Return the correct mime type for the main resource. + +2011-03-12 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Should be able to download a PDF to the Downloads folder + https://bugs.webkit.org/show_bug.cgi?id=56256 + + * UIProcess/API/C/WKPage.h: + Add WKPageSaveDataToFileInDownloadsFolderCallback to the UI client. + + * UIProcess/API/mac/PDFViewController.h: + * UIProcess/API/mac/PDFViewController.mm: + (-[WKPDFView _applyPDFPreferences]): + (-[WKPDFView _updatePreferences:]): + Use new PDFViewController::page getter. + + (-[WKPDFView PDFViewSavePDFToDownloadFolder:]): + Call PDFViewController::savePDFToDownloadsFolder. + + (WebKit::releaseCFData): + (WebKit::PDFViewController::savePDFToDownloadsFolder): + Create a WebData that wraps the CFData, then pass it along to + WebPageProxy::saveDataToFileInDownloadsFolder. + + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder): + Call WebUIClient::saveDataToFileInDownloadsFolder. + + (WebKit::WebUIClient::saveDataToFileInDownloadsFolder): + * UIProcess/WebUIClient.h: + Call the UI client callback function. + +2011-03-12 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + WebData should be able to wrap already existing data + https://bugs.webkit.org/show_bug.cgi?id=56254 + + * Shared/WebData.h: + (WebKit::WebData::createWithoutCopying): + (WebKit::WebData::create): + (WebKit::WebData::~WebData): + (WebKit::WebData::bytes): + (WebKit::WebData::size): + (WebKit::WebData::WebData): + (WebKit::WebData::fastFreeBytes): + +2011-03-12 Jer Noble <jer.noble@apple.com> + + Reviewed by Eric Carlson. + + WebKit2: Initialize the WebFullScreenManagerProxy with a WKView + https://bugs.webkit.org/show_bug.cgi?id=56250 + + * UIProcess/API/mac/WKView.mm: + (-[WKView initWithFrame:contextRef:pageGroupRef:]): Call fullScreenManager()->setView(self). + +2011-03-11 Jer Noble <jer.noble@apple.com> + + Reviewed by Anders Carlsson. + + Add full screen animation code to WebFullScreenManager. + https://bugs.webkit.org/show_bug.cgi?id=56220 + + * WebProcess/FullScreen/WebFullScreenManager.cpp: . + (WebKit::WebFullScreenManager::~WebFullScreenManager): Added. + (WebKit::WebFullScreenManager::exitFullScreenForElement): Remove ASSERTs. + (WebKit::WebFullScreenManager::willEnterFullScreen): Set the full screen renderer's background color. + (WebKit::WebFullScreenManager::didEnterFullScreen): Ditto. + (WebKit::WebFullScreenManager::willExitFullScreen): Ditto. + (WebKit::WebFullScreenManager::didExitFullScreen): Ditto. + * WebProcess/FullScreen/WebFullScreenManager.h: Make a few functions pure virtual to be implemented in a + concrete subclass. + * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: Added. + * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: Added. + (-[WebFullScreenManagerAnimationListener initWithManager:WebKit::began:finished:]): Listener for CAAnimations. + (-[WebFullScreenManagerAnimationListener animationDidStart:]): Added. + (-[WebFullScreenManagerAnimationListener animationDidStop:finished:]): Added. + (-[WebFullScreenManagerAnimationListener invalidate]): Added. + (WebKit::WebFullScreenManager::create): Now creates a WebFullScreenManagerMac. + (WebKit::WebFullScreenManagerMac::create): Added. + (WebKit::WebFullScreenManagerMac::WebFullScreenManagerMac): Added. + (WebKit::WebFullScreenManagerMac::~WebFullScreenManagerMac): Added. + (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): Set up the remote layer host. + (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): Create a CATransform3D + which will animate the full screen renderer from its initial position to its final one. + (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto. + +2011-03-11 Jer Noble <jer.noble@apple.com> + + Reviewed by Anders Carlsson. + + Hook up new WKFullScreenWindowController functions to WebFullScreenManagerProxy + https://bugs.webkit.org/show_bug.cgi?id=56218 + + * UIProcess/WebFullScreenManagerProxy.cpp: + * UIProcess/mac/WebFullScreenManagerProxyMac.mm: Added. + (WebKit::WebFullScreenManagerProxy::enterFullScreen): Call into WKFullScreenWindowController. + (WebKit::WebFullScreenManagerProxy::exitFullScreen): Ditto. + (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): Ditto. + (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): Ditto. + (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): Ditto. + (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): Ditto. + (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): Ditto. + (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): Ditto. + (WebKit::WebFullScreenManagerProxy::getFullScreenRect): Ditto. + * UIProcess/API/mac/WKView.mm: + (-[WKView fullScreenWindowController]): Lazily instantiate a WKFullScreenWindowController. + * UIProcess/API/mac/WKViewInternal.h: + +2011-03-11 Jer Noble <jer.noble@apple.com> + + Reviewed by Anders Carlsson. + + Add the WKFullScreenWindowController, mostly cribbed from WebKit's WebFullScreenController. + + [WebKit2] Implement a full screen window controller + https://bugs.webkit.org/show_bug.cgi?id=56210 + + * UIProcess/mac/WKFullScreenWindowController.h: Added. + * UIProcess/mac/WKFullScreenWindowController.mm: Added. + (-[WKFullScreenWindowController init]): Remove the _mediaEventListener. + (-[WKFullScreenWindowController dealloc]): Make sure to cancel previous async requests. + (-[WKFullScreenWindowController windowDidLoad]): Remove the Tiger protection. + (-[WKFullScreenWindowController webView]): Type change. + (-[WKFullScreenWindowController setWebView:]): Type change. + (-[WKFullScreenWindowController applicationDidResignActive:]): Case changes. + (-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): Case changes. + (-[WKFullScreenWindowController enterFullScreen:]): Removed most of the animation code + which will reappear in WebFullScreenManager. + (-[WKFullScreenWindowController beganEnterFullScreenAnimation]): Added. + (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Added. + (-[WKFullScreenWindowController exitFullScreen]): Ditto to enterFullScreen. + (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Added. + (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Added. + (-[WKFullScreenWindowController enterAcceleratedCompositingMode:WebKit::]): Set up the + layer tree host. + (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): Tear down same. + (-[WKFullScreenWindowController getFullScreenRect:WebCore::]): Added. + (-[WKFullScreenWindowController _updateMenuAndDockForFullScreen]): Case changes. + (-[WKFullScreenWindowController _disableIdleDisplaySleep]): Ditto. + (-[WKFullScreenWindowController _enableIdleDisplaySleep]): Ditto. + (-[WKFullScreenWindowController _disableIdleSystemSleep]): Ditto. + (-[WKFullScreenWindowController _enableIdleSystemSleep]): Ditto. + (-[WKFullScreenWindowController _enableTickleTimer]): Ditto. + (-[WKFullScreenWindowController _disableTickleTimer]): Ditto. + (-[WKFullScreenWindowController _tickleTimerFired]): Ditto. + (-[WKFullScreenWindowController _updatePowerAssertions]): Use _isPlaying ivar. + (-[WKFullScreenWindowController _manager]): Added. + (-[WKFullScreenWindowController _requestExit]): Case changes. + (-[WKFullScreenWindowController _requestExitFullScreenWithAnimation:]): Ditto. + (-[WKFullScreenWindowController _swapView:with:]): Added. + (-[WKFullScreenWindowController _fullScreenWindow]): Case changes. + (-[WKFullScreenWindow initWithContentRect:styleMask:backing:defer:]): Geometry no + longer needs to be flipped. + (-[WKFullScreenWindow cancelOperation:]): Case changes. + +2011-03-11 Jer Noble <jer.noble@apple.com> + + Reviewed by Anders Carlsson. + + Create new interface stubs to support full screen mode in WebKit2. + + WebKit2: Plumb new full screen animation APIs through WebKit2. + https://bugs.webkit.org/show_bug.cgi?id=55993 + + * UIProcess/WebFullScreenManagerProxy.cpp: + (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy): Added. + (WebKit::WebFullScreenManagerProxy::invalidate): Clear m_webView. + (WebKit::WebFullScreenManagerProxy::setWebView): Set m_webView. + (WebKit::WebFullScreenManagerProxy::beginEnterFullScreenAnimation): Added. + (WebKit::WebFullScreenManagerProxy::beginExitFullScreenAnimation): Added. + (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): Added stub. + (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): Added stub. + (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): Added stub. + (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): Added stub. + (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): Added stub. + (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): Added stub. + (WebKit::WebFullScreenManagerProxy::getFullScreenRect): Added stub. + * UIProcess/WebFullScreenManagerProxy.h: + * UIProcess/WebFullScreenManagerProxy.messages.in: Added new message definitions. + * UIProcess/WebPageProxy.cpp: Moved include of WebFullScreenManagerProxy.h into source file. + * UIProcess/WebPageProxy.h: Ditto. + * WebProcess/FullScreen/WebFullScreenManager.cpp: + (WebKit::WebFullScreenManager::element): Added. + (WebKit::WebFullScreenManager::supportsFullScreen): Send message through WebPage. + (WebKit::WebFullScreenManager::enterFullScreenForElement): Ditto. + (WebKit::WebFullScreenManager::exitFullScreenForElement): Ditto. + (WebKit::WebFullScreenManager::beganEnterFullScreenAnimation): Added.. + (WebKit::WebFullScreenManager::finishedEnterFullScreenAnimation): Added. + (WebKit::WebFullScreenManager::beganExitFullScreenAnimation): Added. + (WebKit::WebFullScreenManager::finishedExitFullScreenAnimation): Added. + (WebKit::WebFullScreenManager::setRootFullScreenLayer): Added stub. + (WebKit::WebFullScreenManager::getFullScreenRect): Added. + (WebKit::WebFullScreenManager::beginEnterFullScreenAnimation): Added stub. + (WebKit::WebFullScreenManager::beginExitFullScreenAnimation): Added stub. + * WebProcess/FullScreen/WebFullScreenManager.h: + * WebProcess/FullScreen/WebFullScreenManager.messages.in: Added new message definitions. + * WebProcess/WebCoreSupport/WebChromeClient.cpp: + (WebKit::WebChromeClient::setRootFullScreenLayer): Added. + * WebProcess/WebCoreSupport/WebChromeClient.h: + +2011-03-11 Alice Liu <alice.liu@apple.com> + + Reviewed by Sam Weinig. + + Support encoding /decoding WebData in usermessages + https://bugs.webkit.org/show_bug.cgi?id=56158 + + Added encoding/decoding for APIObject::TypeData + * Shared/UserMessageCoders.h: + (WebKit::UserMessageEncoder::baseEncode): + (WebKit::UserMessageDecoder::baseDecode): + +2011-03-11 Alice Liu <alice.liu@apple.com> + + Reviewed by Sam Weinig. + + Add api for "remove" to WKMutableDictionary + https://bugs.webkit.org/show_bug.cgi?id=56157 + + * Shared/API/c/WKMutableDictionary.cpp: + (WKDictionaryRemoveItem): Added; call remove on MutableDictionary impl. + * Shared/API/c/WKMutableDictionary.h: + * Shared/MutableDictionary.cpp: + (WebKit::MutableDictionary::remove): Added; call remove on the underlying hashmap. + * Shared/MutableDictionary.h: + +2011-03-11 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r80899 and r80912. + http://trac.webkit.org/changeset/80899 + http://trac.webkit.org/changeset/80912 + https://bugs.webkit.org/show_bug.cgi?id=56236 + + Caused animation tests to crash on Snow Leopard WebKit2 + (Requested by rniwa on #webkit). + + * Shared/ShareableBitmap.cpp: + (WebKit::ShareableBitmap::create): + (WebKit::ShareableBitmap::createShareable): + (WebKit::ShareableBitmap::resize): + * Shared/ShareableBitmap.h: + (WebKit::ShareableBitmap::numBytesForSize): + (WebKit::ShareableBitmap::sizeInBytes): + * UIProcess/DrawingAreaProxyImpl.cpp: + (WebKit::DrawingAreaProxyImpl::update): + * WebKit2.xcodeproj/project.pbxproj: + * WebProcess/WebPage/DrawingArea.h: + (WebKit::DrawingArea::didUpdate): + * WebProcess/WebPage/DrawingArea.messages.in: + * WebProcess/WebPage/DrawingAreaImpl.cpp: + (WebKit::DrawingAreaImpl::~DrawingAreaImpl): + (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): + (WebKit::DrawingAreaImpl::didUpdate): + (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): + (WebKit::DrawingAreaImpl::display): + * WebProcess/WebPage/DrawingAreaImpl.h: + * WebProcess/WebPage/SharedMemoryCache.cpp: Removed. + * WebProcess/WebPage/SharedMemoryCache.h: Removed. + * win/WebKit2.vcproj: + +2011-03-11 Brian Weinstein <bweinstein@apple.com> + + Windows build fix. Add SharedMemoryCache to the vcproj. + + * win/WebKit2.vcproj: + +2011-03-11 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=56222 + A window remains frozen if web process crashes during printing + + * UIProcess/API/mac/PageClientImpl.h: + * UIProcess/API/mac/PageClientImpl.mm: + * UIProcess/PageClient.h: + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::setComplexTextInputEnabled): + * UIProcess/WebPageProxy.h: + Moved setAutodisplay code into WKPrintingView. + + * UIProcess/API/mac/WKPrintingView.h: + * UIProcess/API/mac/WKView.mm: + (-[WKView printOperationWithPrintInfo:forFrame:]): + Keep a reference to the actual WKView, so that we can manipulate how it displays, even if + page goes away. + + * UIProcess/API/mac/WKPrintingView.mm: + (-[WKPrintingView initWithFrameProxy:WebKit::view:]): + (-[WKPrintingView _setAutodisplay:]): + (-[WKPrintingView _suspendAutodisplay]): + (-[WKPrintingView _delayedResumeAutodisplayTimerFired]): + Move setAutodisplay here. + +2011-03-11 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Add a shared memory cache to the web process + https://bugs.webkit.org/show_bug.cgi?id=56232 + + Add a very simple shared memory cache to the web process, so that we don't have to allocate and + free memory over and over when painting. + + * Shared/ShareableBitmap.cpp: + (WebKit::ShareableBitmap::create): + (WebKit::ShareableBitmap::createShareable): + (WebKit::ShareableBitmap::resize): + * Shared/ShareableBitmap.h: + (WebKit::ShareableBitmap::numBytesNeededForBitmapSize): + (WebKit::ShareableBitmap::sizeInBytes): + Rename numBytesForSize to numBytesNeededForBitmapSize. + + * UIProcess/DrawingAreaProxyImpl.cpp: + (WebKit::DrawingAreaProxyImpl::update): + Always send back a DidUpdate message, even if we didn't use the update info. + This is needed so that the web process knows when the UI process is done with the shared memory inside + the update info struct. + + * WebKit2.xcodeproj/project.pbxproj: + Add new files. + + * WebProcess/WebPage/DrawingArea.h: + (WebKit::DrawingArea::didUpdate): + * WebProcess/WebPage/DrawingArea.messages.in: + DidUpdate now takes a boolean. + + * WebProcess/WebPage/DrawingAreaImpl.cpp: + (WebKit::sharedMemoryCache): + Add shared memory cache. + + (WebKit::DrawingAreaImpl::~DrawingAreaImpl): + Return the shared memory to the cache. + + (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): + display now takes an extra boolean. + + (WebKit::DrawingAreaImpl::didUpdate): + Return the shared memory to the cache. + + (WebKit::DrawingAreaImpl::display): + If useSharedMemoryCache is true, get shared memory from the cache. + + * WebProcess/WebPage/SharedMemoryCache.cpp: Added. + (WebKit::SharedMemoryCache::acquireSharedMemory): + If the memory we currently hold on to is big enough, return it. + + (WebKit::SharedMemoryCache::releaseSharedMemory): + If we're already holding on to shared memory, evict it if the returned + shared memory object is bigger than the one we currently hold. + + (WebKit::SharedMemoryCache::clearCacheTimerFired): + Null out the shared memory object. + +2011-03-11 Jessie Berlin <jberlin@apple.com> + + Reviewed by Adam Roben. + + Crash calling WebContext::clearResourceCaches(InMemoryResourceCachesOnly) before the Web + Process has finished launching. + https://bugs.webkit.org/show_bug.cgi?id=56208 + + Only send the message if the Web Process is valid. + + * UIProcess/WebContext.cpp: + (WebKit::WebContext::clearResourceCaches): + +2011-03-11 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Don't paint more than 60 times per second + https://bugs.webkit.org/show_bug.cgi?id=56206 + <rdar://problem/9085989> + + * WebProcess/WebPage/DrawingAreaImpl.cpp: + (WebKit::DrawingAreaImpl::DrawingAreaImpl): + Initialize m_lastDisplayTime to 0. Change the display timer to call displayTimerFired. + + (WebKit::DrawingAreaImpl::didUpdate): + Call displayTimerFired instead of display. + + (WebKit::DrawingAreaImpl::displayTimerFired): + If we're asked to paint again less than 1/60th of a second after we've already painted, + defer painting. + + (WebKit::DrawingAreaImpl::display): + Update m_lastDisplayTime. + +2011-03-11 Mark Rowe <mrowe@apple.com> + + Reviewed by Alice Liu. + + <rdar://problem/9120161> WKPageRestoreFromSessionState does not set the pending API request URL. + + * UIProcess/cf/WebPageProxyCF.cpp: + (WebKit::WebPageProxy::restoreFromSessionStateData): If we're navigating to a back/forward item + as part of the restoration, call setPendingAPIRequestURL. When there's a provisional URL this will + be done by our call to loadURL elsewhere in the function. + +2011-03-10 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Jon Honeycutt. + + WebKit2 UI process crashes if web process crashes while computing page rects for printing + https://bugs.webkit.org/show_bug.cgi?id=56160 + <rdar://problem/9027410> + + * UIProcess/API/mac/WKPrintingView.mm: + (-[WKPrintingView _suspendAutodisplay]): Added a null check for page, matching one that + we have when resuming autodisplay. + (-[WKPrintingView _delayedResumeAutodisplayTimerFired]): Added a FIXME. + (pageDidComputePageRects): Sanitize results coming from the web process (and avoid crashing + when there is a communication error, so results are all null). + (-[WKPrintingView knowsPageRange:]): If there is no page any more, we can't tell how many + pages it had. + (-[WKPrintingView rectForPage:]): Handle the case where we are neither calculating pages + nor knowing them, as it happens when the web process crashes. + +2011-03-10 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Sam Weinig. + + Part of <rdar://problem/8728860> WebKit2 needs to be made localizable + + The presence of CFBundleDevelopmentRegion in the application's Info.plist prevents + the default localization that we set during launch from being respected. + + * PluginProcess/Info.plist: Remove CFBundleDevelopmentRegion. + * WebProcess/Info.plist: Ditto. + +2011-03-10 Martin Robinson <mrobinson@igalia.com> + + Build for WebKit2 GTK+ after r80714. + + * GNUmakefile.am: Update source list. + * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: + (WebKit::x11Display): Add missing semicolon. + +2011-03-10 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Darin Adler. + + REGRESSION (WebKit2): VoiceOver focus no longer follows keyboard focus + https://bugs.webkit.org/show_bug.cgi?id=55959 + + NSApplication has to return the focused element within the app in order + for NSAccessibilityHandleFocusChanged() to work. The default implementation + relies on keyWindow. Consequently, in WK2, the WebProcess must override that method + to return the appropriate focused element within the WebProcess, since + there is no keyWindow. + + * WebKit2.xcodeproj/project.pbxproj: + * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm: + (-[AccessibilityWebPageObject accessibilityFocusedUIElement]): + * WebProcess/WebProcess.cpp: + (WebKit::WebProcess::focusedWebPage): + * WebProcess/WebProcess.h: + * WebProcess/mac/NSApplicationOverride.mm: Added. + (-[NSApplication accessibilityFocusedUIElement]): + +2011-03-10 Oleg Romashin <romaxa@gmail.com> + + Reviewed by Andreas Kling. + + Make Qt port compiling with ENABLE_PLUGIN_PROCESS=1, part3 + Solving conflict of Qt and Xlib includes + + * Shared/Plugins/NPIdentifierData.cpp: + * Shared/Plugins/NPIdentifierData.h: + * Shared/Plugins/NPObjectProxy.cpp: + * Shared/Plugins/NPVariantData.h: + +2011-03-10 Sam Weinig <sam@webkit.org> + + Reviewed by Mark Rowe. + + - Fix plugins in release and production builds. + + * WebKit2.xcodeproj/project.pbxproj: + Make sure to base the PluginProcess target on the correct xcconfig file + in all configurations. + +2011-03-09 Matthew Delaney <mdelaney@apple.com> + + Reviewed by Simon Fraser. + + Plumb through settings for accelerated drawing for canvas + https://bugs.webkit.org/show_bug.cgi?id=56039 + + * Shared/WebPreferencesStore.h: + * UIProcess/API/C/WKPreferences.cpp: + * UIProcess/API/C/WKPreferencesPrivate.h: + * WebProcess/WebPage/WebPage.cpp: + +2011-03-10 Jessie Berlin <jberlin@apple.com> + + Reviewed by Oliver Hunt and Brian Weinstein. + + WebKit2: Need a way to clear only the in-memory resource caches + https://bugs.webkit.org/show_bug.cgi?id=56022 + + Add a parameter to WKContextClearResourceCaches to specify whether to clear all the caches + or just the memory caches. + + * Shared/ResourceCachesToClear.h: Added. + * UIProcess/API/C/WKAPICast.h: + (WebKit::toResourceCachesToClear): + + * UIProcess/API/C/WKContext.cpp: + (WKContextClearResourceCaches): + Add the new parameter. + * UIProcess/API/C/WKContext.h: + * UIProcess/WebContext.cpp: + (WebKit::WebContext::clearResourceCaches): + Ditto. + * UIProcess/WebContext.h: + + * WebProcess/WebProcess.cpp: + (WebKit::WebProcess::clearResourceCaches): + Pass the new parameter through to the platform-specific functions. + * WebProcess/WebProcess.h: + Add the new parameter and give it a default of AllResourceCaches. + * WebProcess/WebProcess.messages.in: + Ditto. + * WebProcess/gtk/WebProcessGtk.cpp: + (WebKit::WebProcess::platformClearResourceCaches): + Ditto. + * WebProcess/qt/WebProcessQt.cpp: + (WebKit::WebProcess::platformClearResourceCaches): + Ditto. + * WebProcess/win/WebProcessWin.cpp: + (WebKit::WebProcess::platformClearResourceCaches): + When told to clear only the in-memory caches, return early so as not to clear the CFNetwork + disk cache. + * WebProcess/mac/WebProcessMac.mm: + (WebKit::WebProcess::platformClearResourceCaches): + Ditto. + + * WebKit2.xcodeproj/project.pbxproj: + Add ResourceCachesToClear.h + * win/WebKit2.vcproj: + Ditto. + +2011-03-10 Jeff Miller <jeffm@apple.com> + + Reviewed by Adam Roben. + + WKViewRegisterEditCommandCallback should use WKViewUndoType + https://bugs.webkit.org/show_bug.cgi?id=56120 + + * UIProcess/API/C/win/WKView.h: Change undoOrRedo parameter in WKViewRegisterEditCommandCallback to be WKViewUndoType. + +2011-03-10 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> + + Reviewed by Kenneth Rohde Christiansen. + + Tiled backing store's delegated scroll request uses incorrect convention + https://bugs.webkit.org/show_bug.cgi?id=56011 + + Adapt all of the internal API to match the delta to point + conversion at the WebCore side. + + * UIProcess/API/qt/qwkpage.cpp: + (QWKPagePrivate::pageDidRequestScroll): + * UIProcess/API/qt/qwkpage_p.h: + * UIProcess/PageClient.h: + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::pageDidRequestScroll): + * UIProcess/WebPageProxy.h: + * UIProcess/WebPageProxy.messages.in: + * WebProcess/WebCoreSupport/WebChromeClient.cpp: + (WebKit::WebChromeClient::delegatedScrollRequested): + * WebProcess/WebCoreSupport/WebChromeClient.h: + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::pageDidRequestScroll): + * WebProcess/WebPage/WebPage.h: + +2011-03-10 Balazs Kelemen <kbalazs@webkit.org> + + Reviewed by Andreas Kling. + + [WK2] Make non-transparent windowless plugins paint on X11 + https://bugs.webkit.org/show_bug.cgi?id=55660 + + Implement painting for non-transparent windowless X11 plugins. + The essence of the logic has been adapted from WebCore. + The implementation is stubbed for GTK and working only on Qt + but it should be really easy to finish it for GTK. + + * WebKit2.pro: + * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: + (WebKit::NPN_GetValue): Handle X11 specific values that are necessary. + * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: + (WebKit::NetscapePlugin::NetscapePlugin): Initialize the X11 specific + members that has been added. + (WebKit::NetscapePlugin::callSetWindow): Always set the x and y coordinates + of the NP_Window to 0 on X11 since we are using a backings store as the + painting area for the plugin. + * WebProcess/Plugins/Netscape/NetscapePlugin.h: + * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp: Removed in favour + of a common implementation for X11. + * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp: Ditto. + * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: Added. + (WebKit::getPluginDisplay): + + Platform specific static getters. + (WebKit::x11Display): + (WebKit::displayDepth): + (WebKit::rootWindowID): + (WebKit::x11Screen): + + (WebKit::NetscapePlugin::platformPostInitialize): Set up the visual + settings and the colormap for the plugin. + (WebKit::NetscapePlugin::platformDestroy): + (WebKit::NetscapePlugin::platformInvalidate): Remained stub. + (WebKit::NetscapePlugin::platformGeometryDidChange): Create a new + pixmap that fits the geometry. + (WebKit::NetscapePlugin::platformPaint): Propagate a paint event + to the plugin, sync with it if necessary and draw the pixmap to + the screen. + (WebKit::toNP): Remained stub. + (WebKit::NetscapePlugin::platformHandleMouseEvent): Remained stub. + (WebKit::NetscapePlugin::platformHandleWheelEvent): Remained stub. + (WebKit::NetscapePlugin::platformSetFocus): Remained stub. + (WebKit::NetscapePlugin::platformHandleMouseEnterEvent): Remained stub. + (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent): Remained stub. + (WebKit::NetscapePlugin::platformHandleKeyboardEvent): Remained stub. + * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: + (WebKit::WebFrameLoaderClient::createPlugin): Hack. Inject wmode=opaque + key-value pair to the plugin parameters to force Flash to act in + non-transparent windowless mode. Qt also doing this in WebCore. + +2011-03-09 Peter Kasting <pkasting@google.com> + + Reviewed by Mihai Parparita. + + Unify Windows version checks. + https://bugs.webkit.org/show_bug.cgi?id=55979 + + * UIProcess/win/WebPageProxyWin.cpp: + (WebKit::WebPageProxy::standardUserAgent): + +2011-03-09 Adele Peterson <adele@apple.com> + + Reviewed by Anders Carlsson. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=56068 + <rdar://problem/9058245> WebKit2: Can't uncheck 'Spelling and Grammar' contextual items + + * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contextMenuItemSelected): + Add cases for ContextMenuItemTagCorrectSpellingAutomatically, ContextMenuItemTagCheckSpellingWhileTyping, + and ContextMenuItemTagCheckGrammarWithSpelling + +2011-03-09 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Dan Bernstein. + + Frequent crashes when printing in WebPageProxy::setAutodisplay + https://bugs.webkit.org/show_bug.cgi?id=56057 + <rdar://problem/9053290> + + * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView _delayedResumeAutodisplayTimerFired]): + Null check the page, there is no reason for it to still exist. + +2011-03-09 Brent Fulgham <bfulgham@webkit.org> + + Unreviewed build correction. + + * UIProcess/DrawingAreaProxy.messages.in: Exclude the other + method using LayerTreeContext for non-accelerated composition case. + +2011-03-09 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Change plugins to use their own executable on Mac OS X + https://bugs.webkit.org/show_bug.cgi?id=55991 + + * Configurations/PluginProcess.xcconfig: Copied from Source/WebKit2/Configurations/WebProcess.xcconfig. + * PluginProcess/Info.plist: Copied from Source/WebKit2/WebProcess/Info.plist. + Add files necessary for adding PluginProcess.app. + + * UIProcess/Launcher/mac/ProcessLauncherMac.mm: + (WebKit::ProcessLauncher::launchProcess): + Launch the PluginProcess.app when launching a plugin process. + + * WebKit2.xcodeproj/project.pbxproj: + Add new executable and new files, removes some unneeded copying + and duplicate compiling of files. + + * WebProcess/Info.plist: + Sorted. + +2011-03-09 Jessie Berlin <jberlin@apple.com> + + Reviewed by Adam Roben. + + Use the Cookie Storage from the Private Browsing Storage Session directly + https://bugs.webkit.org/show_bug.cgi?id=55986 + + * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: + (InitWebCoreSystemInterface): + +2011-03-09 Alejandro G. Castro <alex@igalia.com> + + Fix compilation after r80596, add soup Download stubs. + + * GNUmakefile.am: + * WebProcess/Downloads/soup/DownloadSoup.cpp: Added. + (WebKit::Download::start): + (WebKit::Download::startWithHandle): + (WebKit::Download::cancel): + (WebKit::Download::platformInvalidate): + (WebKit::Download::didDecideDestination): + (WebKit::Download::platformDidFinish): + +2011-03-09 Alejandro G. Castro <alex@igalia.com> + + Fix GTK+ compilation after r80619. Add WebFullScreenManager. + + * GNUmakefile.am: + +2011-03-08 Jer Noble <jer.noble@apple.com> + + Reviewed by Sam Weinig. + + WebKit2: Plumb through the FULLSCREEN_API Chrome client calls + https://bugs.webkit.org/show_bug.cgi?id=55273 + + The FULLSCREEN_API Chrome client calls need to be plumbed through from the + WebProcess to the UIProcess. To do this, WebFullScreenManager (and Proxy) + classes have been added to WebPage. + + * DerivedSources.make: Added rules necessary to build DerivedSources for new .in files. + * DerivedSources.pro: Ditto. + * Platform/CoreIPC/MessageID.h: Added message types for WebFullScreenManager. + * Shared/API/c/WKBase.h: Added WKFullScreenManagerRef. + * Shared/APIObject.h: Added APIType for WebFullScreenManager. + * UIProcess/WebFullScreenManagerProxy.cpp: Added. + * UIProcess/WebFullScreenManagerProxy.h: Added. + * UIProcess/WebFullScreenManagerProxy.messages.in: Added. + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::close): Invalidate and clear m_fullScreenManager. + (WebKit::WebPageProxy::processDidCrash): Ditto. + (WebKit::WebPageProxy::didReceiveMessage): Pass messages on to WebFullScreenManagerProxy. + (WebKit::WebPageProxy::didReceiveSyncMessage): Ditto. + (WebKit::WebPageProxy::fullScreenManager): Added. Lazy instantiation of m_fullScreenManager. + * UIProcess/WebPageProxy.h: + * UIProcess/WebPageProxy.messages.in: + * UIProcess/WebUIClient.cpp: + * UIProcess/WebUIClient.h: + * WebKit2.xcodeproj/project.pbxproj: Added references to new classes in project file. + * WebKit2.pro: Ditto. + * win/WebKit2.vcproj: Ditto. + * WebKit2.pri: Added new directories to include file path. + * win/WebKit2Common.vsprops: Ditto. + * WebProcess/FullScreen/WebFullScreenManager.cpp: Added. + * WebProcess/FullScreen/WebFullScreenManager.h: Added. + * WebProcess/FullScreen/WebFullScreenManager.messages.in: Added. + * WebProcess/WebCoreSupport/WebChromeClient.cpp: + (WebKit::WebChromeClient::supportsFullScreenForElement): Pass through to WebFullScreenManager. + (WebKit::WebChromeClient::enterFullScreenForElement): Ditto. + (WebKit::WebChromeClient::exitFullScreenForElement): Ditto. + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::close): Invalidate and clear m_fullScreenManager. + (WebKit::WebPage::fullScreenManager): Lazy instantiation of m_fullScreenManager. + (WebKit::WebPage::didReceiveMessage): Pass messages through to WebFullScreenManager. + * WebProcess/WebPage/WebPage.h: + +2011-03-08 Jer Noble <jer.noble@apple.com> + + Reviewed by Sam Weinig. + + WebKit2: Plumb through the "supportsFullScreen" preference. + https://bugs.webkit.org/show_bug.cgi?id=55261 + + The "supportsFullScreen" preference needs to be plumbed through from + the UIProcess to the WebProcess. + + * Shared/WebPreferencesStore.h: Add a new macro entry. + * UIProcess/API/C/WKPreferences.cpp: Implement preferences getter and setter. + (WKPreferencesSetFullScreenEnabled): + (WKPreferencesGetFullScreenEnabled): + * UIProcess/API/C/WKPreferences.h: + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::updatePreferences): Sync the fullScreenEnabled setting through to + the settings object. + +2011-03-08 Jeff Miller <jeffm@apple.com> + + Reviewed by Adele Peterson. + + WebKit2: Implement Windows glue for Undo/Redo + https://bugs.webkit.org/show_bug.cgi?id=55961 + + Expose Undo/Redo infrastructure through WKView on Windows by + adding an undo client as well as APIs to reapply and unapply + an edit command. + + * UIProcess/API/C/win/WKView.cpp: + (WKViewSetViewUndoClient): Added. + (WKViewReapplyEditCommand): Added. + (WKViewUnapplyEditCommand): Added. + * UIProcess/API/C/win/WKView.h: Added WKViewUndoClient, WKViewSetViewUndoClient(), and WKViewUnapplyEditCommand(). + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::isValidEditCommand): Added, used to validated an edit command from a WKView API. + * UIProcess/WebPageProxy.h: Added isValidEditCommand(). + * UIProcess/win/WebUndoClient.cpp: Added, APIClient for WKViewUndoClient. + (WebKit::WebUndoClient::registerEditCommand): Added. + (WebKit::WebUndoClient::clearAllEditCommands): Added. + * UIProcess/win/WebUndoClient.h: Added, APIClient for WKViewUndoClient. + * UIProcess/win/WebView.cpp: + (WebKit::WebView::initializeUndoClient): Added. + (WebKit::WebView::close): Clear out undo client. + (WebKit::WebView::registerEditCommand): Implemented to call through to WKViewUndoClient. + (WebKit::WebView::clearAllEditCommands): Implmented to call through to WKViewUndoClient. + (WebKit::WebView::reapplyEditCommand): Added. + (WebKit::WebView::unapplyEditCommand): Added. + * UIProcess/win/WebView.h: Added undo client support. + * win/WebKit2.vcproj: Added WebUndoClient.cpp and WebUndoClient.h. + +2011-03-08 Jeff Miller <jeffm@apple.com> + + Reviewed by Sam Weinig. + + WebKit2: Expose WebEditCommandProxy in the C API on Windows + https://bugs.webkit.org/show_bug.cgi?id=55962 + + Make WebEditCommandProxy a subclass of APIObject, and define + WKEditCommandRef as the type that will be exposed through the C API. + + * Shared/API/c/win/WKBaseWin.h: Add WKEditCommandRef. + * Shared/APIObject.h: Add platform-specific TypeEditCommandProxy. + * UIProcess/API/C/win/WKAPICastWin.h: Add API mapping for WKEditCommandRef. + * UIProcess/WebEditCommandProxy.h: Subclass WebEditCommandProxy from APIObject. + (WebKit::WebEditCommandProxy::type): Added. + +2011-03-08 Jeff Miller <jeffm@apple.com> + + Reviewed by Oliver Hunt. + + WebKit2: Redo is broken + https://bugs.webkit.org/show_bug.cgi?id=55978 + + WebEditCommandProxy::unapply() and WebEditCommandProxy::reapply() were registering the wrong edit command when an undo or redo happens. + For example, when we unapply(), we should register a Redo command, not an Undo command. + + * UIProcess/WebEditCommandProxy.cpp: + (WebKit::WebEditCommandProxy::unapply): Register a Redo command, not an Undo command. + (WebKit::WebEditCommandProxy::reapply): Register an Undo command, not a Redo command. + +2011-03-08 Brent Fulgham <bfulgham@webkit.org> + + Reviewed by Adam Roben. + + https://bugs.webkit.org/show_bug.cgi?id=55977 + Refine CF/CFNet distinctions for better code sharing. + 1. Rename Downloads/cf/win/DownloadCFNetWin.cpp to DownloadCFWin.cpp + since it does not use any CFNETWORK features. + 2. Create new cfnet directory. + 3. Move Downloads/cf/DownloadCFNet.cpp to Downloads/cfnet + 4. Update project file. + + * WebProcess/Downloads/cf/DownloadCFNet.cpp: Removed. + * WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp: Removed. + * WebProcess/Downloads/cf/win/DownloadCFWin.cpp: Copied from WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp. + * WebProcess/Downloads/cfnet: Added. + * WebProcess/Downloads/cfnet/DownloadCFNet.cpp: Copied from WebProcess/Downloads/cf/DownloadCFNet.cpp. + * win/WebKit2.vcproj: + +2011-03-08 Mark Rowe <mrowe@apple.com> + + Reviewed by Brady Eidson. + + <http://webkit.org/b/55976> Provisional URL should be loaded when restoring session state even if there are back / forward list entries. + + * UIProcess/cf/WebPageProxyCF.cpp: + (WebKit::WebPageProxy::restoreFromSessionStateData): If there's a provisional URL that we will load then restore the session state + without navigating to the current item. + * WebProcess/WebPage/WebPage.messages.in: Expose the ability to restore the session state without navigating to the current item. + +2011-03-08 Brent Fulgham <bfulgham@webkit.org> + + Reviewed by Anders Carlsson. + + https://bugs.webkit.org/show_bug.cgi?id=55956 + WebKit2 Changes to correct WinCairo port build + + * Shared/LayerTreeContext.h: Don't exclude CoreIPC declarations for non-accelerated + compositing case. + * UIProcess/DrawingAreaProxy.h: Add "stdint.h" include needed for Cairo build. + * UIProcess/DrawingAreaProxyImpl.cpp: Exclude accelerated compositing code for + WinCairo build. + (WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl): + (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState): + (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode): + (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode): + (WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState): + (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState): + * UIProcess/DrawingAreaProxyImpl.h: Exclude declarations for code only used when + accelerated compositing is enabled. + (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode): + * UIProcess/win/WebView.cpp: Protect CG-specific drawing code. + (WebKit::WebView::setFindIndicator): + * WebProcess/Downloads/Download.h: Allow CFLite implentation to share overwrite flag, + as well as destination and bundle paths. + * WebProcess/Downloads/curl/DownloadCurl.cpp: Remove stub (to share CFNet implementation + of file handling. This will be moved to a common area in a future patch.) + * WebProcess/WebPage/DrawingAreaImpl.cpp: Exclude accelerated-compositing paths. + (WebKit::DrawingAreaImpl::layerHostDidFlushLayers): + (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): + (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): + * WebProcess/WebPage/WebPage.cpp: Protect CG-specific drawing code. + (WebKit::WebPage::drawRectToPDF): + (WebKit::WebPage::drawPagesToPDF): + * win/WebKit2.vcproj: Exclude unused LayerTreeContext from WinCairo + +2011-03-08 Ivan Krstić <ike@apple.com> + + Reviewed by Sam Weinig. + + Re-fix: can't paste from 3rd party text editor into WebKit2 window + <rdar://problem/8978624> + + * WebProcess/com.apple.WebProcess.sb: + +2011-03-08 Martin Robinson <mrobinson@igalia.com> + + Fix the WebKit2 compilation after r80578. + + * UIProcess/gtk/WebView.cpp: + (WebKit::WebView::setFocus): Added. + * UIProcess/gtk/WebView.h: + +2011-03-08 Jessie Berlin <jberlin@apple.com> + + Reviewed by Anders Carlsson. + + Crash in CFNetwork visiting google.com + https://bugs.webkit.org/show_bug.cgi?id=55958 + + * Shared/API/c/cf/WKURLResponseCF.cpp: + (WKURLResponseCopyCFURLResponse): + If the response to copy is null, return 0; + +2011-03-08 John Sullivan <sullivan@apple.com> + + Reverted the patch for https://bugs.webkit.org/show_bug.cgi?id=55940 + + The patch was insufficient, and it wasn't useful for the intended client use either. + + * WebProcess/InjectedBundle/API/c/WKBundlePage.h: + * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: + (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): + +2011-03-08 Alejandro G. Castro <alex@igalia.com> + + Unreviewed, fixed GTK+ compilation after r80569. + + * UIProcess/gtk/WebView.cpp: + (WebKit::WebView::windowToScreen): + * UIProcess/gtk/WebView.h: + +2011-03-08 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Sam Weinig. + + WK2: Cannot set focus on an element when focus is outside of WKView + https://bugs.webkit.org/show_bug.cgi?id=55281 + + * UIProcess/API/mac/PageClientImpl.h: + * UIProcess/API/mac/PageClientImpl.mm: + (WebKit::PageClientImpl::setFocus): + * UIProcess/API/qt/qwkpage_p.h: + (QWKPagePrivate::setFocus): + * UIProcess/PageClient.h: + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::setFocus): + * UIProcess/WebPageProxy.h: + * UIProcess/WebPageProxy.messages.in: + * UIProcess/win/WebView.h: + (WebKit::WebView::setFocus): + * WebProcess/WebCoreSupport/WebChromeClient.cpp: + (WebKit::WebChromeClient::focus): + (WebKit::WebChromeClient::unfocus): + +2011-03-08 Jeff Miller <jeffm@apple.com> + + Unreviewed, fix last change so WKBaseWin.h is in alphabetical order in the project XML. + + * win/WebKit2.vcproj: Move WKBaseWin.h to be in alphabetical order. + +2011-03-08 Jeff Miller <jeffm@apple.com> + + Reviewed by Darin Adler. + + Remove Source/WebKit2/UIProcess/API/C/win/WKBaseWin.h + https://bugs.webkit.org/show_bug.cgi?id=55952 + + * UIProcess/API/C/win/WKBaseWin.h: Removed. + * win/WebKit2.vcproj: Refer to the Shared version of WKBaseWin.h instead of the one in UIProcess. + +2011-03-08 Alejandro G. Castro <alex@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] Add new files to compilation after r77974 + https://bugs.webkit.org/show_bug.cgi?id=54076 + + The commit added new code to allow passing context to policy + delegate methods, we also added dummy ResourceRequest and + ResourceResponse decoders until we implement them. + + * GNUmakefile.am: + * Shared/gtk/WebCoreArgumentCodersGtk.cpp: + (CoreIPC::decodeResourceRequest): + (CoreIPC::decodeResourceResponse): + +2011-03-08 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Darin Adler. + + AX: Webkit2 not sending UAZoomFocusChanged notifications + https://bugs.webkit.org/show_bug.cgi?id=55916 + + Needed to implement the windowToScreen() method so that the right frame + could be calculated to send for zoom focus changes. + + * UIProcess/API/mac/PageClientImpl.h: + * UIProcess/API/mac/PageClientImpl.mm: + (WebKit::PageClientImpl::windowToScreen): + * UIProcess/API/qt/qwkpage.cpp: + (QWKPagePrivate::windowToScreen): + * UIProcess/API/qt/qwkpage_p.h: + * UIProcess/PageClient.h: + * UIProcess/WebPageProxy.cpp: + (WebKit::WebPageProxy::windowToScreen): + * UIProcess/WebPageProxy.h: + * UIProcess/WebPageProxy.messages.in: + * UIProcess/win/WebView.cpp: + (WebKit::WebView::windowToScreen): + * UIProcess/win/WebView.h: + * WebProcess/WebCoreSupport/WebChromeClient.cpp: + (WebKit::WebChromeClient::windowToScreen): + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::windowToScreen): + * WebProcess/WebPage/WebPage.h: + +2011-03-08 John Sullivan <sullivan@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=55940 + WebKit2 should support Ignore policy from injected bundle client + + * WebProcess/InjectedBundle/API/c/WKBundlePage.h: + Added WKBundlePagePolicyActionIgnore. + + * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: + (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): + If the injected bundle client returns WKBundlePagePolicyActionIgnore, convert it + to the loader's PolicyIgnore. + +2011-03-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] [Symbian] [WK2] Fix building WebKit 2 API tests + https://bugs.webkit.org/show_bug.cgi?id=55876 + + Make sure TESTS_SOURCE_DIR is set for Symbian the same way + as it is for WK1. + + * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp: + (tst_QGraphicsWKView::loadEmptyPage): + * UIProcess/API/qt/tests/tests.pri: + 2011-03-07 Damian Kaleta <dkaleta@apple.com> Reviewed by Anders Carlsson. diff --git a/Source/WebKit2/Configurations/Base.xcconfig b/Source/WebKit2/Configurations/Base.xcconfig index 6f06a69..8018769 100644 --- a/Source/WebKit2/Configurations/Base.xcconfig +++ b/Source/WebKit2/Configurations/Base.xcconfig @@ -25,7 +25,6 @@ DEBUG_INFORMATION_FORMAT = dwarf; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DEBUGGING_SYMBOLS = default; GCC_DYNAMIC_NO_PIC = NO; -GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_OBJC_GC = supported; @@ -95,12 +94,23 @@ TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL)); TARGET_GCC_VERSION_1050_0310 = GCC_42; TARGET_GCC_VERSION_1050_0320 = GCC_42; TARGET_GCC_VERSION_1060 = GCC_42; -TARGET_GCC_VERSION_1070 = LLVM_GCC_42; +TARGET_GCC_VERSION_1070 = $(TARGET_GCC_VERSION_1070_$(CONFIGURATION)); +TARGET_GCC_VERSION_1070_Debug = LLVM_COMPILER; +TARGET_GCC_VERSION_1070_Release = LLVM_GCC_42; +TARGET_GCC_VERSION_1070_Production = LLVM_GCC_42; GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION)); GCC_VERSION_GCC_40 = 4.0; GCC_VERSION_GCC_42 = 4.2; GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42; +GCC_VERSION_LLVM_COMPILER = com.apple.compilers.llvm.clang.1_0; + +// FIXME: Disable C++ exceptions in the LLVM Compiler once it supports enabling Obj-C exceptions without C++ exceptions. +GCC_ENABLE_CPP_EXCEPTIONS = $(GCC_ENABLE_CPP_EXCEPTIONS_$(TARGET_GCC_VERSION)); +GCC_ENABLE_CPP_EXCEPTIONS_GCC_40 = NO; +GCC_ENABLE_CPP_EXCEPTIONS_GCC_42 = NO; +GCC_ENABLE_CPP_EXCEPTIONS_LLVM_GCC = NO; +GCC_ENABLE_CPP_EXCEPTIONS_LLVM_COMPILER = YES; // If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK. SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR)); diff --git a/Source/WebKit2/Configurations/PluginProcess.xcconfig b/Source/WebKit2/Configurations/PluginProcess.xcconfig new file mode 100644 index 0000000..14d29fd --- /dev/null +++ b/Source/WebKit2/Configurations/PluginProcess.xcconfig @@ -0,0 +1,29 @@ +// Copyright (C) 2010, 2011 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "BaseTarget.xcconfig" + +GCC_ENABLE_OBJC_GC = NO; +PRODUCT_NAME = PluginProcess; +INFOPLIST_FILE = PluginProcess/Info.plist; +INSTALL_PATH = $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks/WebKit2.framework; diff --git a/Source/WebKit2/Configurations/PluginProcessShim.xcconfig b/Source/WebKit2/Configurations/PluginProcessShim.xcconfig index a607b72..272e2d4 100644 --- a/Source/WebKit2/Configurations/PluginProcessShim.xcconfig +++ b/Source/WebKit2/Configurations/PluginProcessShim.xcconfig @@ -21,8 +21,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "Version.xcconfig" +#include "BaseTarget.xcconfig" GCC_DYNAMIC_NO_PIC = NO; +HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include; PRODUCT_NAME = PluginProcessShim; SKIP_INSTALL = YES; + diff --git a/Source/WebKit2/Configurations/Version.xcconfig b/Source/WebKit2/Configurations/Version.xcconfig index 3095c3b..e3bfad7 100644 --- a/Source/WebKit2/Configurations/Version.xcconfig +++ b/Source/WebKit2/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 534; -MINOR_VERSION = 24; +MINOR_VERSION = 27; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/Source/WebKit2/DerivedSources.make b/Source/WebKit2/DerivedSources.make index 40a9b7a..6f30dd4 100644 --- a/Source/WebKit2/DerivedSources.make +++ b/Source/WebKit2/DerivedSources.make @@ -26,8 +26,11 @@ VPATH = \ $(WebKit2)/WebProcess/ApplicationCache \ $(WebKit2)/WebProcess/Authentication \ $(WebKit2)/WebProcess/Cookies \ + $(WebKit2)/WebProcess/FullScreen \ $(WebKit2)/WebProcess/Geolocation \ + $(WebKit2)/WebProcess/IconDatabase \ $(WebKit2)/WebProcess/KeyValueStorage \ + $(WebKit2)/WebProcess/MediaCache \ $(WebKit2)/WebProcess/Plugins \ $(WebKit2)/WebProcess/ResourceCache \ $(WebKit2)/WebProcess/WebCoreSupport \ @@ -55,12 +58,18 @@ MESSAGE_RECEIVERS = \ WebContext \ WebDatabaseManager \ WebDatabaseManagerProxy \ + WebFullScreenManager \ + WebFullScreenManagerProxy \ WebGeolocationManager \ WebGeolocationManagerProxy \ + WebIconDatabase \ + WebIconDatabaseProxy \ WebInspector \ WebInspectorProxy \ WebKeyValueStorageManager \ WebKeyValueStorageManagerProxy \ + WebMediaCacheManager \ + WebMediaCacheManagerProxy \ WebPage \ WebPageProxy \ WebProcess \ diff --git a/Source/WebKit2/DerivedSources.pro b/Source/WebKit2/DerivedSources.pro index 3af0549..71b5872 100644 --- a/Source/WebKit2/DerivedSources.pro +++ b/Source/WebKit2/DerivedSources.pro @@ -78,8 +78,11 @@ VPATH = \ WebProcess/ApplicationCache \ WebProcess/Authentication \ WebProcess/Cookies \ + WebProcess/FullScreen \ WebProcess/Geolocation \ + WebProcess/IconDatabase \ WebProcess/KeyValueStorage \ + WebProcess/MediaCache \ WebProcess/Plugins \ WebProcess/ResourceCache \ WebProcess/WebCoreSupport \ @@ -106,9 +109,15 @@ MESSAGE_RECEIVERS = \ WebDatabaseManagerProxy.messages.in \ WebGeolocationManager.messages.in \ WebGeolocationManagerProxy.messages.in \ + WebIconDatabase.messages.in \ + WebIconDatabaseProxy.messages.in \ WebInspectorProxy.messages.in \ WebKeyValueStorageManager.messages.in \ WebKeyValueStorageManagerProxy.messages.in \ + WebMediaCacheManager.messages.in \ + WebMediaCacheManagerProxy.messages.in \ + WebFullScreenManager.messages.in \ + WebFullScreenManagerProxy.messages.in \ WebPage/WebInspector.messages.in \ WebPage/WebPage.messages.in \ WebPageProxy.messages.in \ diff --git a/Source/WebKit2/GNUmakefile.am b/Source/WebKit2/GNUmakefile.am index 597d29a..837165d 100644 --- a/Source/WebKit2/GNUmakefile.am +++ b/Source/WebKit2/GNUmakefile.am @@ -55,6 +55,7 @@ libWebKit2_la_HEADERS = \ $(WebKit2)/UIProcess/API/C/WKFramePolicyListener.h \ $(WebKit2)/UIProcess/API/C/WKInspector.h \ $(WebKit2)/UIProcess/API/C/WKKeyValueStorageManager.h \ + $(WebKit2)/UIProcess/API/C/WKMediaCacheManager.h \ $(WebKit2)/UIProcess/API/C/WKNativeEvent.h \ $(WebKit2)/UIProcess/API/C/WKNavigationData.h \ $(WebKit2)/UIProcess/API/C/WKOpenPanelParameters.h \ @@ -320,10 +321,14 @@ libWebKit2_la_SOURCES = \ Source/WebKit2/UIProcess/API/C/WKFrame.h \ Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp \ Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.h \ + Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp \ + Source/WebKit2/UIProcess/API/C/WKIconDatabase.h \ Source/WebKit2/UIProcess/API/C/WKInspector.cpp \ Source/WebKit2/UIProcess/API/C/WKInspector.h \ Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp \ Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.h \ + Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp \ + Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h \ Source/WebKit2/UIProcess/API/C/WKNativeEvent.h \ Source/WebKit2/UIProcess/API/C/WKNavigationData.cpp \ Source/WebKit2/UIProcess/API/C/WKNavigationData.h \ @@ -371,6 +376,7 @@ libWebKit2_la_SOURCES = \ Source/WebKit2/UIProcess/gtk/ChunkedUpdateDrawingAreaProxyGtk.cpp \ Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp \ Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp \ + Source/WebKit2/UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp \ Source/WebKit2/UIProcess/gtk/WebInspectorGtk.cpp \ Source/WebKit2/UIProcess/gtk/WebViewWidget.cpp \ Source/WebKit2/UIProcess/gtk/WebViewWidget.h \ @@ -438,16 +444,22 @@ libWebKit2_la_SOURCES = \ Source/WebKit2/UIProcess/WebFramePolicyListenerProxy.h \ Source/WebKit2/UIProcess/WebFrameProxy.cpp \ Source/WebKit2/UIProcess/WebFrameProxy.h \ + Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp \ + Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h \ Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp \ Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h \ Source/WebKit2/UIProcess/WebGeolocationProvider.cpp \ Source/WebKit2/UIProcess/WebGeolocationProvider.h \ Source/WebKit2/UIProcess/WebHistoryClient.cpp \ Source/WebKit2/UIProcess/WebHistoryClient.h \ + Source/WebKit2/UIProcess/WebIconDatabase.cpp \ + Source/WebKit2/UIProcess/WebIconDatabase.h \ Source/WebKit2/UIProcess/WebInspectorProxy.cpp \ Source/WebKit2/UIProcess/WebInspectorProxy.h \ Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp \ Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h \ + Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp \ + Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h \ Source/WebKit2/UIProcess/WebLoaderClient.cpp \ Source/WebKit2/UIProcess/WebLoaderClient.h \ Source/WebKit2/UIProcess/WebNavigationData.cpp \ @@ -479,11 +491,16 @@ libWebKit2_la_SOURCES = \ Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h \ Source/WebKit2/WebProcess/Cookies/WebCookieManager.h \ Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp \ - Source/WebKit2/WebProcess/Downloads/curl/DownloadCurl.cpp \ + Source/WebKit2/WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp \ Source/WebKit2/WebProcess/Downloads/Download.cpp \ Source/WebKit2/WebProcess/Downloads/Download.h \ Source/WebKit2/WebProcess/Downloads/DownloadManager.cpp \ Source/WebKit2/WebProcess/Downloads/DownloadManager.h \ + Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp \ + Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp \ + Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h \ + Source/WebKit2/WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.cpp \ + Source/WebKit2/WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.h \ Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp \ Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.h \ Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp \ @@ -491,6 +508,8 @@ libWebKit2_la_SOURCES = \ Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp \ Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp \ Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.h \ + Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp \ + Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h \ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h \ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp \ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h \ @@ -503,6 +522,8 @@ libWebKit2_la_SOURCES = \ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h \ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp \ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h \ + Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.h \ + Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp \ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInitialize.h \ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp \ Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInspector.h \ @@ -526,16 +547,18 @@ libWebKit2_la_SOURCES = \ Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp \ Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h \ Source/WebKit2/WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp \ + Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp \ + Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.h \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h \ - Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp \ - Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.h \ + Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp \ + Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp \ @@ -544,6 +567,8 @@ libWebKit2_la_SOURCES = \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageFormClient.h \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h \ + Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp \ + Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp \ @@ -553,7 +578,8 @@ libWebKit2_la_SOURCES = \ Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h \ Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp \ Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.h \ - Source/WebKit2/WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp \ + Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp \ + Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h \ Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp \ Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h \ Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp \ @@ -570,6 +596,7 @@ libWebKit2_la_SOURCES = \ Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h \ Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp \ Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.h \ + Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \ Source/WebKit2/WebProcess/Plugins/PluginController.h \ Source/WebKit2/WebProcess/Plugins/Plugin.cpp \ Source/WebKit2/WebProcess/Plugins/Plugin.h \ @@ -685,8 +712,10 @@ libWebKit2_la_CPPFLAGS = \ -I$(srcdir)/Source/WebKit2/WebProcess/Authentication \ -I$(srcdir)/Source/WebKit2/WebProcess/Cookies \ -I$(srcdir)/Source/WebKit2/WebProcess/Downloads \ + -I$(srcdir)/Source/WebKit2/WebProcess/FullScreen \ -I$(srcdir)/Source/WebKit2/WebProcess/Geolocation \ -I$(srcdir)/Source/WebKit2/WebProcess/gtk \ + -I$(srcdir)/Source/WebKit2/WebProcess/IconDatabase \ -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle \ -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API \ -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/c \ @@ -694,6 +723,7 @@ libWebKit2_la_CPPFLAGS = \ -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/gtk \ -I$(srcdir)/Source/WebKit2/WebProcess/KeyValueStorage \ -I$(srcdir)/Source/WebKit2/WebProcess/Launching \ + -I$(srcdir)/Source/WebKit2/WebProcess/MediaCache \ -I$(srcdir)/Source/WebKit2/WebProcess/ResourceCache \ -I$(srcdir)/Source/WebKit2/WebProcess/Plugins \ -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape \ @@ -848,10 +878,18 @@ webkit2_built_sources += \ DerivedSources/WebKit2/WebDatabaseManagerMessages.h \ DerivedSources/WebKit2/WebDatabaseManagerProxyMessageReceiver.cpp \ DerivedSources/WebKit2/WebDatabaseManagerProxyMessages.h \ + DerivedSources/WebKit2/WebFullScreenManagerMessageReceiver.cpp \ + DerivedSources/WebKit2/WebFullScreenManagerMessages.h \ + DerivedSources/WebKit2/WebFullScreenManagerProxyMessageReceiver.cpp \ + DerivedSources/WebKit2/WebFullScreenManagerProxyMessages.h \ DerivedSources/WebKit2/WebGeolocationManagerMessageReceiver.cpp \ DerivedSources/WebKit2/WebGeolocationManagerMessages.h \ DerivedSources/WebKit2/WebGeolocationManagerProxyMessageReceiver.cpp \ DerivedSources/WebKit2/WebGeolocationManagerProxyMessages.h \ + DerivedSources/WebKit2/WebIconDatabaseMessageReceiver.cpp \ + DerivedSources/WebKit2/WebIconDatabaseMessages.h \ + DerivedSources/WebKit2/WebIconDatabaseProxyMessageReceiver.cpp \ + DerivedSources/WebKit2/WebIconDatabaseProxyMessages.h \ DerivedSources/WebKit2/WebInspectorMessageReceiver.cpp \ DerivedSources/WebKit2/WebInspectorMessages.h \ DerivedSources/WebKit2/WebInspectorProxyMessageReceiver.cpp \ @@ -860,6 +898,10 @@ webkit2_built_sources += \ DerivedSources/WebKit2/WebKeyValueStorageManagerMessages.h \ DerivedSources/WebKit2/WebKeyValueStorageManagerProxyMessageReceiver.cpp \ DerivedSources/WebKit2/WebKeyValueStorageManagerProxyMessages.h \ + DerivedSources/WebKit2/WebMediaCacheManagerMessageReceiver.cpp \ + DerivedSources/WebKit2/WebMediaCacheManagerMessages.h \ + DerivedSources/WebKit2/WebMediaCacheManagerProxyMessageReceiver.cpp \ + DerivedSources/WebKit2/WebMediaCacheManagerProxyMessages.h \ DerivedSources/WebKit2/WebPageProxyMessageReceiver.cpp \ DerivedSources/WebKit2/WebPageProxyMessages.h \ DerivedSources/WebKit2/WebPageMessageReceiver.cpp \ @@ -897,8 +939,11 @@ vpath %.messages.in = \ $(WebKit2)/WebProcess/ApplicationCache \ $(WebKit2)/WebProcess/Authentication \ $(WebKit2)/WebProcess/Cookies \ + $(WebKit2)/WebProcess/FullScreen \ $(WebKit2)/WebProcess/Geolocation \ + $(WebKit2)/WebProcess/IconDatabase \ $(WebKit2)/WebProcess/KeyValueStorage \ + $(WebKit2)/WebProcess/MediaCache \ $(WebKit2)/WebProcess/Plugins \ $(WebKit2)/WebProcess/ResourceCache \ $(WebKit2)/WebProcess/WebCoreSupport \ diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp b/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp index 4664806..44f9a9f 100644 --- a/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp +++ b/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp @@ -145,7 +145,7 @@ bool ArgumentDecoder::decodeBytes(uint8_t* buffer, size_t bufferSize) bool ArgumentDecoder::decodeBool(bool& result) { - if (!alignBufferPosition(__alignof(result), sizeof(result))) + if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; result = *reinterpret_cast<bool*>(m_bufferPos); @@ -155,7 +155,7 @@ bool ArgumentDecoder::decodeBool(bool& result) bool ArgumentDecoder::decodeUInt32(uint32_t& result) { - if (!alignBufferPosition(__alignof(result), sizeof(result))) + if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; result = *reinterpret_cast<uint32_t*>(m_bufferPos); @@ -165,7 +165,7 @@ bool ArgumentDecoder::decodeUInt32(uint32_t& result) bool ArgumentDecoder::decodeUInt64(uint64_t& result) { - if (!alignBufferPosition(__alignof(result), sizeof(result))) + if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; result = *reinterpret_cast<uint64_t*>(m_bufferPos); @@ -175,7 +175,7 @@ bool ArgumentDecoder::decodeUInt64(uint64_t& result) bool ArgumentDecoder::decodeInt32(int32_t& result) { - if (!alignBufferPosition(__alignof(result), sizeof(result))) + if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; result = *reinterpret_cast<uint32_t*>(m_bufferPos); @@ -185,7 +185,7 @@ bool ArgumentDecoder::decodeInt32(int32_t& result) bool ArgumentDecoder::decodeInt64(int64_t& result) { - if (!alignBufferPosition(__alignof(result), sizeof(result))) + if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; result = *reinterpret_cast<uint64_t*>(m_bufferPos); @@ -195,7 +195,7 @@ bool ArgumentDecoder::decodeInt64(int64_t& result) bool ArgumentDecoder::decodeFloat(float& result) { - if (!alignBufferPosition(__alignof(result), sizeof(result))) + if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; result = *reinterpret_cast<float*>(m_bufferPos); @@ -205,7 +205,7 @@ bool ArgumentDecoder::decodeFloat(float& result) bool ArgumentDecoder::decodeDouble(double& result) { - if (!alignBufferPosition(__alignof(result), sizeof(result))) + if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; result = *reinterpret_cast<double*>(m_bufferPos); diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp index aa71b0f..fb0b68b 100644 --- a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp +++ b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp @@ -97,49 +97,49 @@ void ArgumentEncoder::encodeBytes(const uint8_t* bytes, size_t size) void ArgumentEncoder::encodeBool(bool n) { - uint8_t* buffer = grow(__alignof(n), sizeof(n)); + uint8_t* buffer = grow(sizeof(n), sizeof(n)); *reinterpret_cast<bool*>(buffer) = n; } void ArgumentEncoder::encodeUInt32(uint32_t n) { - uint8_t* buffer = grow(__alignof(n), sizeof(n)); + uint8_t* buffer = grow(sizeof(n), sizeof(n)); *reinterpret_cast<uint32_t*>(buffer) = n; } void ArgumentEncoder::encodeUInt64(uint64_t n) { - uint8_t* buffer = grow(__alignof(n), sizeof(n)); + uint8_t* buffer = grow(sizeof(n), sizeof(n)); *reinterpret_cast<uint64_t*>(buffer) = n; } void ArgumentEncoder::encodeInt32(int32_t n) { - uint8_t* buffer = grow(__alignof(n), sizeof(n)); + uint8_t* buffer = grow(sizeof(n), sizeof(n)); *reinterpret_cast<int32_t*>(buffer) = n; } void ArgumentEncoder::encodeInt64(int64_t n) { - uint8_t* buffer = grow(__alignof(n), sizeof(n)); + uint8_t* buffer = grow(sizeof(n), sizeof(n)); *reinterpret_cast<int64_t*>(buffer) = n; } void ArgumentEncoder::encodeFloat(float n) { - uint8_t* buffer = grow(__alignof(n), sizeof(n)); + uint8_t* buffer = grow(sizeof(n), sizeof(n)); *reinterpret_cast<float*>(buffer) = n; } void ArgumentEncoder::encodeDouble(double n) { - uint8_t* buffer = grow(__alignof(n), sizeof(n)); + uint8_t* buffer = grow(sizeof(n), sizeof(n)); *reinterpret_cast<double*>(buffer) = n; } diff --git a/Source/WebKit2/Platform/CoreIPC/Connection.cpp b/Source/WebKit2/Platform/CoreIPC/Connection.cpp index 281ccb6..a65f065 100644 --- a/Source/WebKit2/Platform/CoreIPC/Connection.cpp +++ b/Source/WebKit2/Platform/CoreIPC/Connection.cpp @@ -36,14 +36,11 @@ using namespace std; namespace CoreIPC { -class Connection::SyncMessageState : public RefCounted<Connection::SyncMessageState> { +class Connection::SyncMessageState : public ThreadSafeRefCounted<Connection::SyncMessageState> { public: static PassRefPtr<SyncMessageState> getOrCreate(RunLoop*); ~SyncMessageState(); - void beginWaitForSyncReply(); - void endWaitForSyncReply(); - void wakeUpClientRunLoop() { m_waitForSyncReplySemaphore.signal(); @@ -76,16 +73,18 @@ private: return syncMessageStateMapMutex; } + void dispatchMessageAndResetDidScheduleDispatchMessagesWork(); + RunLoop* m_runLoop; BinarySemaphore m_waitForSyncReplySemaphore; - // Protects m_waitForSyncReplyCount and m_messagesToDispatchWhileWaitingForSyncReply. + // Protects m_didScheduleDispatchMessagesWork and m_messagesToDispatchWhileWaitingForSyncReply. Mutex m_mutex; - unsigned m_waitForSyncReplyCount; + bool m_didScheduleDispatchMessagesWork; struct ConnectionAndIncomingMessage { - Connection* connection; + RefPtr<Connection> connection; IncomingMessage incomingMessage; }; Vector<ConnectionAndIncomingMessage> m_messagesToDispatchWhileWaitingForSyncReply; @@ -109,7 +108,7 @@ PassRefPtr<Connection::SyncMessageState> Connection::SyncMessageState::getOrCrea Connection::SyncMessageState::SyncMessageState(RunLoop* runLoop) : m_runLoop(runLoop) - , m_waitForSyncReplyCount(0) + , m_didScheduleDispatchMessagesWork(false) { } @@ -121,49 +120,27 @@ Connection::SyncMessageState::~SyncMessageState() syncMessageStateMap().remove(m_runLoop); } -void Connection::SyncMessageState::beginWaitForSyncReply() -{ - ASSERT(RunLoop::current() == m_runLoop); - - MutexLocker locker(m_mutex); - m_waitForSyncReplyCount++; -} - -void Connection::SyncMessageState::endWaitForSyncReply() -{ - ASSERT(RunLoop::current() == m_runLoop); - - MutexLocker locker(m_mutex); - ASSERT(m_waitForSyncReplyCount); - --m_waitForSyncReplyCount; - - if (m_waitForSyncReplyCount) - return; - - // Dispatch any remaining incoming sync messages. - for (size_t i = 0; i < m_messagesToDispatchWhileWaitingForSyncReply.size(); ++i) { - ConnectionAndIncomingMessage& connectionAndIncomingMessage = m_messagesToDispatchWhileWaitingForSyncReply[i]; - connectionAndIncomingMessage.connection->enqueueIncomingMessage(connectionAndIncomingMessage.incomingMessage); - } - - m_messagesToDispatchWhileWaitingForSyncReply.clear(); -} - bool Connection::SyncMessageState::processIncomingMessage(Connection* connection, IncomingMessage& incomingMessage) { MessageID messageID = incomingMessage.messageID(); - if (!messageID.isSync() && !messageID.shouldDispatchMessageWhenWaitingForSyncReply()) - return false; - - MutexLocker locker(m_mutex); - if (!m_waitForSyncReplyCount) + if (!messageID.shouldDispatchMessageWhenWaitingForSyncReply()) return false; ConnectionAndIncomingMessage connectionAndIncomingMessage; connectionAndIncomingMessage.connection = connection; connectionAndIncomingMessage.incomingMessage = incomingMessage; - m_messagesToDispatchWhileWaitingForSyncReply.append(connectionAndIncomingMessage); + { + MutexLocker locker(m_mutex); + + if (!m_didScheduleDispatchMessagesWork) { + m_runLoop->scheduleWork(WorkItem::create(this, &SyncMessageState::dispatchMessageAndResetDidScheduleDispatchMessagesWork)); + m_didScheduleDispatchMessagesWork = true; + } + + m_messagesToDispatchWhileWaitingForSyncReply.append(connectionAndIncomingMessage); + } + wakeUpClientRunLoop(); return true; @@ -186,6 +163,17 @@ void Connection::SyncMessageState::dispatchMessages() } } +void Connection::SyncMessageState::dispatchMessageAndResetDidScheduleDispatchMessagesWork() +{ + { + MutexLocker locker(m_mutex); + ASSERT(m_didScheduleDispatchMessagesWork); + m_didScheduleDispatchMessagesWork = false; + } + + dispatchMessages(); +} + PassRefPtr<Connection> Connection::createServerConnection(Identifier identifier, Client* client, RunLoop* clientRunLoop) { return adoptRef(new Connection(identifier, true, client, clientRunLoop)); @@ -200,11 +188,13 @@ Connection::Connection(Identifier identifier, bool isServer, Client* client, Run : m_client(client) , m_isServer(isServer) , m_syncRequestID(0) + , m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(false) , m_didCloseOnConnectionWorkQueueCallback(0) , m_isConnected(false) , m_connectionQueue("com.apple.CoreIPC.ReceiveQueue") , m_clientRunLoop(clientRunLoop) , m_inDispatchMessageCount(0) + , m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount(0) , m_didReceiveInvalidMessage(false) , m_syncMessageState(SyncMessageState::getOrCreate(clientRunLoop)) , m_shouldWaitForSyncReplies(true) @@ -221,6 +211,13 @@ Connection::~Connection() m_connectionQueue.invalidate(); } +void Connection::setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(bool flag) +{ + ASSERT(!m_isConnected); + + m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage = flag; +} + void Connection::setDidCloseOnConnectionWorkQueueCallback(DidCloseOnConnectionWorkQueueCallback callback) { ASSERT(!m_isConnected); @@ -265,7 +262,9 @@ bool Connection::sendMessage(MessageID messageID, PassOwnPtr<ArgumentEncoder> ar if (!isValid()) return false; - if (messageSendFlags & DispatchMessageEvenWhenWaitingForSyncReply) + if (messageSendFlags & DispatchMessageEvenWhenWaitingForSyncReply + && (!m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage + || m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount)) messageID = messageID.messageIDWithAddedFlags(MessageID::DispatchMessageWhenWaitingForSyncReply); MutexLocker locker(m_outgoingMessagesLock); @@ -357,12 +356,8 @@ PassOwnPtr<ArgumentDecoder> Connection::sendSyncMessage(MessageID messageID, uin m_pendingSyncReplies.append(PendingSyncReply(syncRequestID)); } - // We have to begin waiting for the sync reply before sending the message, in case the other side - // would have sent a request before us, which would lead to a deadlock. - m_syncMessageState->beginWaitForSyncReply(); - // First send the message. - sendMessage(messageID, encoder); + sendMessage(messageID.messageIDWithAddedFlags(MessageID::SyncMessage), encoder, DispatchMessageEvenWhenWaitingForSyncReply); // Then wait for a reply. Waiting for a reply could involve dispatching incoming sync messages, so // keep an extra reference to the connection here in case it's invalidated. @@ -376,9 +371,7 @@ PassOwnPtr<ArgumentDecoder> Connection::sendSyncMessage(MessageID messageID, uin m_pendingSyncReplies.removeLast(); } - m_syncMessageState->endWaitForSyncReply(); - - if (!reply) + if (!reply && m_client) m_client->didFailToSendSyncMessage(this); return reply.release(); @@ -415,19 +408,41 @@ PassOwnPtr<ArgumentDecoder> Connection::waitForSyncReply(uint64_t syncRequestID, return 0; } -void Connection::processIncomingMessage(MessageID messageID, PassOwnPtr<ArgumentDecoder> arguments) +void Connection::processIncomingSyncReply(PassOwnPtr<ArgumentDecoder> arguments) { - // Check if this is a sync reply. - if (messageID == MessageID(CoreIPCMessage::SyncMessageReply)) { - MutexLocker locker(m_syncReplyStateMutex); - ASSERT(!m_pendingSyncReplies.isEmpty()); + MutexLocker locker(m_syncReplyStateMutex); + ASSERT(!m_pendingSyncReplies.isEmpty()); + + // Go through the stack of sync requests that have pending replies and see which one + // this reply is for. + for (size_t i = m_pendingSyncReplies.size(); i > 0; --i) { + PendingSyncReply& pendingSyncReply = m_pendingSyncReplies[i - 1]; + + if (pendingSyncReply.syncRequestID != arguments->destinationID()) + continue; - PendingSyncReply& pendingSyncReply = m_pendingSyncReplies.last(); - ASSERT(pendingSyncReply.syncRequestID == arguments->destinationID()); + ASSERT(!pendingSyncReply.replyDecoder); pendingSyncReply.replyDecoder = arguments.leakPtr(); pendingSyncReply.didReceiveReply = true; - m_syncMessageState->wakeUpClientRunLoop(); + + // We got a reply to the last send message, wake up the client run loop so it can be processed. + if (i == m_pendingSyncReplies.size()) + m_syncMessageState->wakeUpClientRunLoop(); + + return; + } + + // We got a reply for a message we never sent. + // FIXME: Dispatch a didReceiveInvalidMessage callback on the client. + ASSERT_NOT_REACHED(); +} + +void Connection::processIncomingMessage(MessageID messageID, PassOwnPtr<ArgumentDecoder> arguments) +{ + // Check if this is a sync reply. + if (messageID == MessageID(CoreIPCMessage::SyncMessageReply)) { + processIncomingSyncReply(arguments); return; } @@ -569,6 +584,9 @@ void Connection::dispatchMessage(IncomingMessage& message) m_inDispatchMessageCount++; + if (message.messageID().shouldDispatchMessageWhenWaitingForSyncReply()) + m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount++; + bool oldDidReceiveInvalidMessage = m_didReceiveInvalidMessage; m_didReceiveInvalidMessage = false; @@ -580,6 +598,9 @@ void Connection::dispatchMessage(IncomingMessage& message) m_didReceiveInvalidMessage |= arguments->isInvalid(); m_inDispatchMessageCount--; + if (message.messageID().shouldDispatchMessageWhenWaitingForSyncReply()) + m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount--; + if (m_didReceiveInvalidMessage && m_client) m_client->didReceiveInvalidMessage(this, message.messageID()); diff --git a/Source/WebKit2/Platform/CoreIPC/Connection.h b/Source/WebKit2/Platform/CoreIPC/Connection.h index eaa2ab9..b6a2415 100644 --- a/Source/WebKit2/Platform/CoreIPC/Connection.h +++ b/Source/WebKit2/Platform/CoreIPC/Connection.h @@ -72,7 +72,7 @@ enum MessageSendFlags { } \ while (0) -class Connection : public ThreadSafeShared<Connection> { +class Connection : public ThreadSafeRefCounted<Connection> { public: class MessageReceiver { protected: @@ -114,6 +114,8 @@ public: void setShouldCloseConnectionOnProcessTermination(WebKit::PlatformProcessIdentifier); #endif + void setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(bool); + // The set callback will be called on the connection work queue when the connection is closed, // before didCall is called on the client thread. Must be called before the connection is opened. // In the future we might want a more generic way to handle sync or async messages directly @@ -191,6 +193,8 @@ private: // Called on the connection work queue. void processIncomingMessage(MessageID, PassOwnPtr<ArgumentDecoder>); + void processIncomingSyncReply(PassOwnPtr<ArgumentDecoder>); + bool canSendOutgoingMessages() const; bool platformCanSendOutgoingMessages() const; void sendOutgoingMessages(); @@ -212,13 +216,15 @@ private: bool m_isServer; uint64_t m_syncRequestID; + bool m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage; DidCloseOnConnectionWorkQueueCallback m_didCloseOnConnectionWorkQueueCallback; bool m_isConnected; WorkQueue m_connectionQueue; RunLoop* m_clientRunLoop; - uint32_t m_inDispatchMessageCount; + unsigned m_inDispatchMessageCount; + unsigned m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount; bool m_didReceiveInvalidMessage; // Incoming messages. @@ -336,7 +342,7 @@ template<typename T> bool Connection::sendSync(const T& message, const typename argumentEncoder->encode(message); // Now send the message and wait for a reply. - OwnPtr<ArgumentDecoder> replyDecoder = sendSyncMessage(MessageID(T::messageID, MessageID::SyncMessage), syncRequestID, argumentEncoder.release(), timeout); + OwnPtr<ArgumentDecoder> replyDecoder = sendSyncMessage(MessageID(T::messageID), syncRequestID, argumentEncoder.release(), timeout); if (!replyDecoder) return false; @@ -367,7 +373,7 @@ inline bool Connection::deprecatedSendSync(E messageID, uint64_t destinationID, argumentEncoder->encode(arguments); // Now send the message and wait for a reply. - OwnPtr<ArgumentDecoder> replyDecoder = sendSyncMessage(MessageID(messageID, MessageID::SyncMessage), syncRequestID, argumentEncoder.release(), timeout); + OwnPtr<ArgumentDecoder> replyDecoder = sendSyncMessage(MessageID(messageID), syncRequestID, argumentEncoder.release(), timeout); if (!replyDecoder) return false; diff --git a/Source/WebKit2/Platform/CoreIPC/MessageID.h b/Source/WebKit2/Platform/CoreIPC/MessageID.h index 83154ec..2afb168 100644 --- a/Source/WebKit2/Platform/CoreIPC/MessageID.h +++ b/Source/WebKit2/Platform/CoreIPC/MessageID.h @@ -42,9 +42,12 @@ enum MessageClass { MessageClassWebApplicationCacheManager, MessageClassWebCookieManager, MessageClassWebDatabaseManager, + MessageClassWebFullScreenManager, MessageClassWebGeolocationManagerProxy, + MessageClassWebIconDatabaseProxy, MessageClassWebInspector, MessageClassWebKeyValueStorageManager, + MessageClassWebMediaCacheManager, MessageClassWebPage, MessageClassWebProcess, MessageClassWebResourceCacheManager, @@ -58,9 +61,12 @@ enum MessageClass { MessageClassWebContextLegacy, MessageClassWebCookieManagerProxy, MessageClassWebDatabaseManagerProxy, + MessageClassWebFullScreenManagerProxy, MessageClassWebGeolocationManager, + MessageClassWebIconDatabase, MessageClassWebInspectorProxy, MessageClassWebKeyValueStorageManagerProxy, + MessageClassWebMediaCacheManagerProxy, MessageClassWebPageProxy, MessageClassWebProcessProxy, MessageClassWebProcessProxyLegacy, diff --git a/Source/WebKit2/Platform/Logging.cpp b/Source/WebKit2/Platform/Logging.cpp index 184821c..9093415 100644 --- a/Source/WebKit2/Platform/Logging.cpp +++ b/Source/WebKit2/Platform/Logging.cpp @@ -28,15 +28,20 @@ #if !LOG_DISABLED +namespace WebKit { + WTFLogChannel LogSessionState = { 0x00000001, "WebKit2LogLevel", WTFLogChannelOff }; WTFLogChannel LogContextMenu = { 0x00000002, "WebKit2LogLevel", WTFLogChannelOff }; WTFLogChannel LogTextInput = { 0x00000004, "WebKit2LogLevel", WTFLogChannelOff }; WTFLogChannel LogView = { 0x00000008, "WebKit2LogLevel", WTFLogChannelOff }; +WTFLogChannel LogIconDatabase = { 0x00000010, "WebKit2LogLevel", WTFLogChannelOff }; -static inline void initializeLogChannel(WTFLogChannel* channel) +#if !PLATFORM(MAC) +void initializeLogChannel(WTFLogChannel* channel) { - // FIXME: This is a build fix. Each platform will need to define their own initializeLogChannel(). + // FIXME: Each platform will need to define their own initializeLogChannel(). } +#endif void initializeLogChannelsIfNecessary() { @@ -46,9 +51,12 @@ void initializeLogChannelsIfNecessary() haveInitializedLogChannels = true; initializeLogChannel(&LogContextMenu); + initializeLogChannel(&LogIconDatabase); initializeLogChannel(&LogSessionState); initializeLogChannel(&LogTextInput); initializeLogChannel(&LogView); } +} // namespace WebKit + #endif // LOG_DISABLED diff --git a/Source/WebKit2/Platform/Logging.h b/Source/WebKit2/Platform/Logging.h index b2cc391..098bc68 100644 --- a/Source/WebKit2/Platform/Logging.h +++ b/Source/WebKit2/Platform/Logging.h @@ -23,8 +23,8 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef Logging_h -#define Logging_h +#ifndef WebKitLogging_h +#define WebKitLogging_h #include <wtf/Assertions.h> @@ -34,16 +34,18 @@ #define LOG_CHANNEL_PREFIX Log #endif -EXTERN_C_BEGIN +namespace WebKit { extern WTFLogChannel LogContextMenu; +extern WTFLogChannel LogIconDatabase; extern WTFLogChannel LogSessionState; extern WTFLogChannel LogTextInput; extern WTFLogChannel LogView; +void initializeLogChannel(WTFLogChannel*); void initializeLogChannelsIfNecessary(void); -EXTERN_C_END +} // namespace WebKit #endif // LOG_DISABLED diff --git a/Source/WebKit2/Platform/Module.cpp b/Source/WebKit2/Platform/Module.cpp index 33ffbe0..a78db29 100644 --- a/Source/WebKit2/Platform/Module.cpp +++ b/Source/WebKit2/Platform/Module.cpp @@ -33,6 +33,9 @@ Module::Module(const String& path) #if PLATFORM(WIN) , m_module(0) #endif +#if PLATFORM(MAC) && !defined(__LP64__) + , m_bundleResourceMap(-1) +#endif { } diff --git a/Source/WebKit2/Platform/Module.h b/Source/WebKit2/Platform/Module.h index 47899e9..b58e18a 100644 --- a/Source/WebKit2/Platform/Module.h +++ b/Source/WebKit2/Platform/Module.h @@ -56,12 +56,19 @@ public: template<typename FunctionType> FunctionType functionPointer(const char* functionName) const; +#if PLATFORM(MAC) && !defined(__LP64__) + CFBundleRefNum bundleResourceMap(); +#endif + private: void* platformFunctionPointer(const char* functionName) const; String m_path; #if PLATFORM(MAC) RetainPtr<CFBundleRef> m_bundle; +#if !defined(__LP64__) + CFBundleRefNum m_bundleResourceMap; +#endif #elif PLATFORM(WIN) HMODULE m_module; #elif PLATFORM(QT) diff --git a/Source/WebKit2/Platform/WorkQueue.h b/Source/WebKit2/Platform/WorkQueue.h index 441d625..99f77ae 100644 --- a/Source/WebKit2/Platform/WorkQueue.h +++ b/Source/WebKit2/Platform/WorkQueue.h @@ -106,7 +106,7 @@ private: dispatch_queue_t m_dispatchQueue; #endif #elif PLATFORM(WIN) - class WorkItemWin : public ThreadSafeShared<WorkItemWin> { + class WorkItemWin : public ThreadSafeRefCounted<WorkItemWin> { public: static PassRefPtr<WorkItemWin> create(PassOwnPtr<WorkItem>, WorkQueue*); virtual ~WorkItemWin(); diff --git a/Source/WebKit2/Platform/cg/CGUtilities.cpp b/Source/WebKit2/Platform/cg/CGUtilities.cpp index e57206d..6cde8ee 100644 --- a/Source/WebKit2/Platform/cg/CGUtilities.cpp +++ b/Source/WebKit2/Platform/cg/CGUtilities.cpp @@ -29,37 +29,29 @@ #include <wtf/RetainPtr.h> namespace WebKit { - -void paintBitmapContext(CGContextRef context, CGContextRef bitmapContext, CGPoint destination, CGRect source) -{ - void* bitmapData = CGBitmapContextGetData(bitmapContext); - ASSERT(bitmapData); - - size_t imageWidth = CGBitmapContextGetWidth(bitmapContext); - size_t imageHeight = CGBitmapContextGetHeight(bitmapContext); - - size_t bytesPerRow = CGBitmapContextGetBytesPerRow(bitmapContext); - - RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithData(0, bitmapData, bytesPerRow * imageHeight, 0)); - RetainPtr<CGImageRef> image(AdoptCF, CGImageCreate(imageWidth, imageHeight, - CGBitmapContextGetBitsPerComponent(bitmapContext), - CGBitmapContextGetBitsPerPixel(bitmapContext), - bytesPerRow, - CGBitmapContextGetColorSpace(bitmapContext), - CGBitmapContextGetBitmapInfo(bitmapContext), - dataProvider.get(), 0, false, kCGRenderingIntentDefault)); +void paintImage(CGContextRef context, CGImageRef image, CGPoint destination, CGRect source) +{ CGContextSaveGState(context); CGContextClipToRect(context, CGRectMake(destination.x, destination.y, source.size.width, source.size.height)); CGContextScaleCTM(context, 1, -1); + size_t imageHeight = CGImageGetHeight(image); + size_t imageWidth = CGImageGetWidth(image); + CGFloat destX = destination.x - source.origin.x; CGFloat destY = -static_cast<CGFloat>(imageHeight) - destination.y + source.origin.y; - CGContextDrawImage(context, CGRectMake(destX, destY, imageWidth, imageHeight), image.get()); + CGContextDrawImage(context, CGRectMake(destX, destY, imageWidth, imageHeight), image); CGContextRestoreGState(context); } - + +void paintBitmapContext(CGContextRef context, CGContextRef bitmapContext, CGPoint destination, CGRect source) +{ + RetainPtr<CGImageRef> image(AdoptCF, CGBitmapContextCreateImage(bitmapContext)); + paintImage(context, image.get(), destination, source); +} + } // namespace WebKit diff --git a/Source/WebKit2/Platform/cg/CGUtilities.h b/Source/WebKit2/Platform/cg/CGUtilities.h index 3dca654..82cf6dd 100644 --- a/Source/WebKit2/Platform/cg/CGUtilities.h +++ b/Source/WebKit2/Platform/cg/CGUtilities.h @@ -28,6 +28,7 @@ namespace WebKit { +void paintImage(CGContextRef, CGImageRef, CGPoint destination, CGRect source); void paintBitmapContext(CGContextRef, CGContextRef bitmapContext, CGPoint destination, CGRect source); } // namespace WebKit diff --git a/Source/WebKit2/Platform/mac/Logging.mac.mm b/Source/WebKit2/Platform/mac/Logging.mac.mm new file mode 100644 index 0000000..6e45828 --- /dev/null +++ b/Source/WebKit2/Platform/mac/Logging.mac.mm @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "Logging.h" + +namespace WebKit { + +#ifndef NDEBUG + +void initializeLogChannel(WTFLogChannel* channel) +{ + channel->state = WTFLogChannelOff; + NSString *logLevelString = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithUTF8String:channel->defaultName]]; + if (!logLevelString) + return; + + unsigned logLevel; + if (![[NSScanner scannerWithString:logLevelString] scanHexInt:&logLevel]) + NSLog(@"unable to parse hex value for %s (%@), logging is off", channel->defaultName, logLevelString); + if ((logLevel & channel->mask) == channel->mask) + channel->state = WTFLogChannelOn; +} + +#endif + +} // namespace WebKit diff --git a/Source/WebKit2/Platform/mac/ModuleMac.mm b/Source/WebKit2/Platform/mac/ModuleMac.mm index 078e7ee..1ec60f3 100644 --- a/Source/WebKit2/Platform/mac/ModuleMac.mm +++ b/Source/WebKit2/Platform/mac/ModuleMac.mm @@ -48,6 +48,13 @@ bool Module::load() void Module::unload() { + ASSERT(m_bundle); + +#if !defined(__LP64__) + if (m_bundleResourceMap != -1) + CFBundleCloseBundleResourceMap(m_bundle.get(), m_bundleResourceMap); +#endif + // See the comment in Module.h for why we leak the bundle here. m_bundle.releaseRef(); } @@ -60,4 +67,14 @@ void* Module::platformFunctionPointer(const char* functionName) const return CFBundleGetFunctionPointerForName(m_bundle.get(), functionNameString.get()); } +#if !defined(__LP64__) +CFBundleRefNum Module::bundleResourceMap() +{ + if (m_bundleResourceMap == -1) + m_bundleResourceMap = CFBundleOpenBundleResourceMap(m_bundle.get()); + + return m_bundleResourceMap; +} +#endif + } diff --git a/Source/WebKit2/Platform/mac/RunLoopMac.mm b/Source/WebKit2/Platform/mac/RunLoopMac.mm index 8258550..828c57f 100644 --- a/Source/WebKit2/Platform/mac/RunLoopMac.mm +++ b/Source/WebKit2/Platform/mac/RunLoopMac.mm @@ -30,7 +30,14 @@ void RunLoop::performWork(void* context) { - static_cast<RunLoop*>(context)->performWork(); + // Wrap main thread in an Autorelease pool. Sending messages can call + // into objc code and accumulate memory. + if (current() == main()) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + static_cast<RunLoop*>(context)->performWork(); + [pool drain]; + } else + static_cast<RunLoop*>(context)->performWork(); } RunLoop::RunLoop() @@ -91,7 +98,15 @@ void RunLoop::wakeUp() void RunLoop::TimerBase::timerFired(CFRunLoopTimerRef, void* context) { TimerBase* timer = static_cast<TimerBase*>(context); - timer->fired(); + + // Wrap main thread in an Autorelease pool. The timer can call + // into objc code and accumulate memory outside of the main event loop. + if (current() == main()) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + timer->fired(); + [pool drain]; + } else + timer->fired(); } RunLoop::TimerBase::TimerBase(RunLoop* runLoop) diff --git a/Source/WebKit2/Platform/qt/SharedMemoryQt.cpp b/Source/WebKit2/Platform/qt/SharedMemoryQt.cpp index 91af533..8d5d70f 100644 --- a/Source/WebKit2/Platform/qt/SharedMemoryQt.cpp +++ b/Source/WebKit2/Platform/qt/SharedMemoryQt.cpp @@ -101,7 +101,7 @@ void SharedMemory::Handle::adoptFromAttachment(int fileDescriptor, size_t size) PassRefPtr<SharedMemory> SharedMemory::create(size_t size) { - QString tempName = QDir::temp().filePath("qwkshm.XXXXXX"); + QString tempName = QDir::temp().filePath(QLatin1String("qwkshm.XXXXXX")); QByteArray tempNameCSTR = tempName.toLocal8Bit(); char* tempNameC = tempNameCSTR.data(); diff --git a/Source/WebKit2/Platform/win/WorkQueueWin.cpp b/Source/WebKit2/Platform/win/WorkQueueWin.cpp index 0a89225..44e9885 100644 --- a/Source/WebKit2/Platform/win/WorkQueueWin.cpp +++ b/Source/WebKit2/Platform/win/WorkQueueWin.cpp @@ -210,7 +210,7 @@ void WorkQueue::scheduleWork(PassOwnPtr<WorkItem> item) ::QueueUserWorkItem(workThreadCallback, this, WT_EXECUTEDEFAULT); } -struct TimerContext : public ThreadSafeShared<TimerContext> { +struct TimerContext : public ThreadSafeRefCounted<TimerContext> { static PassRefPtr<TimerContext> create() { return adoptRef(new TimerContext); } WorkQueue* queue; diff --git a/Source/WebKit2/PluginProcess/Info.plist b/Source/WebKit2/PluginProcess/Info.plist new file mode 100644 index 0000000..cbf2492 --- /dev/null +++ b/Source/WebKit2/PluginProcess/Info.plist @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleExecutable</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundleGetInfoString</key> + <string>${BUNDLE_VERSION}, Copyright 2003-2011 Apple Inc.</string> + <key>CFBundleIdentifier</key> + <string>com.apple.WebKit.${PRODUCT_NAME}</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>${SHORT_VERSION_STRING}</string> + <key>CFBundleVersion</key> + <string>${BUNDLE_VERSION}</string> + <key>LSFileQuarantineEnabled</key> + <true/> + <key>LSMinimumSystemVersion</key> + <string>${MACOSX_DEPLOYMENT_TARGET}</string> + <key>LSUIElement</key> + <true/> + <key>NSPrincipalClass</key> + <string>NSApplication</string> +</dict> +</plist> diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp b/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp index b140f78..03a8aec 100644 --- a/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp +++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp @@ -78,11 +78,21 @@ bool PluginControllerProxy::initialize(const Plugin::Parameters& parameters) ASSERT(!m_plugin); m_plugin = NetscapePlugin::create(PluginProcess::shared().netscapePluginModule()); - if (!m_plugin) + if (!m_plugin) { + // This will delete the plug-in controller proxy object. + m_connection->removePluginControllerProxy(this, 0); return false; + } if (!m_plugin->initialize(this, parameters)) { + // Get the plug-in so we can pass it to removePluginControllerProxy. The pointer is only + // used as an identifier so it's OK to just get a weak reference. + Plugin* plugin = m_plugin.get(); + m_plugin = 0; + + // This will delete the plug-in controller proxy object. + m_connection->removePluginControllerProxy(this, plugin); return false; } @@ -102,13 +112,17 @@ void PluginControllerProxy::destroy() return; } + // Get the plug-in so we can pass it to removePluginControllerProxy. The pointer is only + // used as an identifier so it's OK to just get a weak reference. + Plugin* plugin = m_plugin.get(); + m_plugin->destroy(); m_plugin = 0; platformDestroy(); // This will delete the plug-in controller proxy object. - m_connection->removePluginControllerProxy(this); + m_connection->removePluginControllerProxy(this, plugin); } void PluginControllerProxy::paint() @@ -122,11 +136,16 @@ void PluginControllerProxy::paint() IntRect dirtyRect = m_dirtyRect; m_dirtyRect = IntRect(); + ASSERT(m_plugin); + // Create a graphics context. OwnPtr<GraphicsContext> graphicsContext = m_backingStore->createGraphicsContext(); + graphicsContext->translate(-m_frameRect.x(), -m_frameRect.y()); - ASSERT(m_plugin); + if (m_plugin->isTransparent()) + graphicsContext->clearRect(dirtyRect); + m_plugin->paint(graphicsContext.get(), dirtyRect); m_connection->connection()->send(Messages::PluginProxy::Update(dirtyRect), m_pluginInstanceID); @@ -199,7 +218,7 @@ NPObject* PluginControllerProxy::windowScriptNPObject() if (!windowScriptNPObjectID) return 0; - return m_connection->npRemoteObjectMap()->createNPObjectProxy(windowScriptNPObjectID); + return m_connection->npRemoteObjectMap()->createNPObjectProxy(windowScriptNPObjectID, m_plugin.get()); } NPObject* PluginControllerProxy::pluginElementNPObject() @@ -212,7 +231,7 @@ NPObject* PluginControllerProxy::pluginElementNPObject() if (!pluginElementNPObjectID) return 0; - return m_connection->npRemoteObjectMap()->createNPObjectProxy(pluginElementNPObjectID); + return m_connection->npRemoteObjectMap()->createNPObjectProxy(pluginElementNPObjectID, m_plugin.get()); } bool PluginControllerProxy::evaluate(NPObject* npObject, const String& scriptString, NPVariant* result, bool allowPopups) @@ -223,7 +242,7 @@ bool PluginControllerProxy::evaluate(NPObject* npObject, const String& scriptStr OBJECT_TO_NPVARIANT(npObject, npObjectAsNPVariant); // Send the NPObject over as an NPVariantData. - NPVariantData npObjectAsNPVariantData = m_connection->npRemoteObjectMap()->npVariantToNPVariantData(npObjectAsNPVariant); + NPVariantData npObjectAsNPVariantData = m_connection->npRemoteObjectMap()->npVariantToNPVariantData(npObjectAsNPVariant, m_plugin.get()); bool returnValue = false; NPVariantData resultData; @@ -234,7 +253,7 @@ bool PluginControllerProxy::evaluate(NPObject* npObject, const String& scriptStr if (!returnValue) return false; - *result = m_connection->npRemoteObjectMap()->npVariantDataToNPVariant(resultData); + *result = m_connection->npRemoteObjectMap()->npVariantDataToNPVariant(resultData, m_plugin.get()); return true; } @@ -321,7 +340,7 @@ void PluginControllerProxy::frameDidFail(uint64_t requestID, bool wasCancelled) m_plugin->frameDidFail(requestID, wasCancelled); } -void PluginControllerProxy::geometryDidChange(const IntRect& frameRect, const IntRect& clipRect, const SharedMemory::Handle& backingStoreHandle) +void PluginControllerProxy::geometryDidChange(const IntRect& frameRect, const IntRect& clipRect, const ShareableBitmap::Handle& backingStoreHandle) { m_frameRect = frameRect; m_clipRect = clipRect; @@ -330,7 +349,7 @@ void PluginControllerProxy::geometryDidChange(const IntRect& frameRect, const In if (!backingStoreHandle.isNull()) { // Create a new backing store. - m_backingStore = ShareableBitmap::create(frameRect.size(), backingStoreHandle); + m_backingStore = ShareableBitmap::create(backingStoreHandle); } m_plugin->geometryDidChange(frameRect, clipRect); @@ -429,7 +448,7 @@ void PluginControllerProxy::paintEntirePlugin() paint(); } -void PluginControllerProxy::snapshot(WebCore::IntSize& bufferSize, SharedMemory::Handle& backingStoreHandle) +void PluginControllerProxy::snapshot(ShareableBitmap::Handle& backingStoreHandle) { ASSERT(m_plugin); RefPtr<ShareableBitmap> bitmap = m_plugin->snapshot(); @@ -437,7 +456,6 @@ void PluginControllerProxy::snapshot(WebCore::IntSize& bufferSize, SharedMemory: return; bitmap->createHandle(backingStoreHandle); - bufferSize = bitmap->size(); } void PluginControllerProxy::setFocus(bool hasFocus) @@ -459,7 +477,7 @@ void PluginControllerProxy::getPluginScriptableNPObject(uint64_t& pluginScriptab return; } - pluginScriptableNPObjectID = m_connection->npRemoteObjectMap()->registerNPObject(pluginScriptableNPObject); + pluginScriptableNPObjectID = m_connection->npRemoteObjectMap()->registerNPObject(pluginScriptableNPObject, m_plugin.get()); releaseNPObject(pluginScriptableNPObject); } diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.h b/Source/WebKit2/PluginProcess/PluginControllerProxy.h index e470f85..65be39e 100644 --- a/Source/WebKit2/PluginProcess/PluginControllerProxy.h +++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.h @@ -32,7 +32,7 @@ #include "Plugin.h" #include "PluginController.h" #include "RunLoop.h" -#include "SharedMemory.h" +#include "ShareableBitmap.h" #include <wtf/Noncopyable.h> #if PLATFORM(MAC) @@ -105,7 +105,7 @@ private: // Message handlers. void frameDidFinishLoading(uint64_t requestID); void frameDidFail(uint64_t requestID, bool wasCancelled); - void geometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, const SharedMemory::Handle& backingStoreHandle); + void geometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect, const ShareableBitmap::Handle& backingStoreHandle); void didEvaluateJavaScript(uint64_t requestID, const String& requestURLString, const String& result); void streamDidReceiveResponse(uint64_t streamID, const String& responseURLString, uint32_t streamLength, uint32_t lastModifiedTime, const String& mimeType, const String& headers); void streamDidReceiveData(uint64_t streamID, const CoreIPC::DataReference& data); @@ -121,7 +121,7 @@ private: void handleMouseLeaveEvent(const WebMouseEvent&, bool& handled); void handleKeyboardEvent(const WebKeyboardEvent&, bool& handled); void paintEntirePlugin(); - void snapshot(WebCore::IntSize& bufferSize, SharedMemory::Handle& backingStoreHandle); + void snapshot(ShareableBitmap::Handle& backingStoreHandle); void setFocus(bool); void didUpdate(); void getPluginScriptableNPObject(uint64_t& pluginScriptableNPObjectID); diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in b/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in index 91cc57f..6e27b36 100644 --- a/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in +++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in @@ -24,7 +24,7 @@ messages -> PluginControllerProxy { # Sent when the plug-in geometry changes. - GeometryDidChange(WebCore::IntRect frameRect, WebCore::IntRect clipRect, WebKit::SharedMemory::Handle backingStoreHandle) + GeometryDidChange(WebCore::IntRect frameRect, WebCore::IntRect clipRect, WebKit::ShareableBitmap::Handle backingStoreHandle) # Sent when a frame has finished loading. FrameDidFinishLoading(uint64_t requestID) @@ -101,7 +101,7 @@ messages -> PluginControllerProxy { #endif # Return a snapshot of the plugin - Snapshot() -> (WebCore::IntSize size, WebKit::SharedMemory::Handle backingStoreHandle) + Snapshot() -> (WebKit::ShareableBitmap::Handle backingStoreHandle) # Sent when private browsing is enabled or disabled PrivateBrowsingStateChanged(bool isPrivateBrowsingEnabled) diff --git a/Source/WebKit2/PluginProcess/PluginProcess.cpp b/Source/WebKit2/PluginProcess/PluginProcess.cpp index 9a9f3bc..e35de9d 100644 --- a/Source/WebKit2/PluginProcess/PluginProcess.cpp +++ b/Source/WebKit2/PluginProcess/PluginProcess.cpp @@ -72,6 +72,11 @@ void PluginProcess::removeWebProcessConnection(WebProcessConnection* webProcessC ASSERT(vectorIndex != notFound); m_webProcessConnections.remove(vectorIndex); + + if (m_webProcessConnections.isEmpty() && m_pluginModule) { + // Decrement the load count. This is balanced by a call to incrementLoadCount in createWebProcessConnection. + m_pluginModule->decrementLoadCount(); + } startShutdownTimerIfNecessary(); } @@ -133,6 +138,8 @@ void PluginProcess::createWebProcessConnection() mach_port_t listeningPort; mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort); + bool didHaveAnyWebProcessConnections = !m_webProcessConnections.isEmpty(); + // Create a listening connection. RefPtr<WebProcessConnection> connection = WebProcessConnection::create(listeningPort); m_webProcessConnections.append(connection.release()); @@ -140,6 +147,14 @@ void PluginProcess::createWebProcessConnection() CoreIPC::MachPort clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND); m_connection->send(Messages::PluginProcessProxy::DidCreateWebProcessConnection(clientPort), 0); + if (NetscapePluginModule* module = netscapePluginModule()) { + if (!didHaveAnyWebProcessConnections) { + // Increment the load count. This is matched by a call to decrementLoadCount in removeWebProcessConnection. + // We do this so that the plug-in module's NP_Shutdown won't be called until right before exiting. + module->incrementLoadCount(); + } + } + // Stop the shutdown timer. m_shutdownTimer.stop(); } diff --git a/Source/WebKit2/PluginProcess/PluginProcess.h b/Source/WebKit2/PluginProcess/PluginProcess.h index 3e14e5e..83c3b30 100644 --- a/Source/WebKit2/PluginProcess/PluginProcess.h +++ b/Source/WebKit2/PluginProcess/PluginProcess.h @@ -52,6 +52,9 @@ public: #if PLATFORM(MAC) void initializeShim(); + void setModalWindowIsShowing(bool); + void setFullscreenWindowIsShowing(bool); + #if USE(ACCELERATED_COMPOSITING) mach_port_t compositingRenderServerPort() const { return m_compositingRenderServerPort; } #endif diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp index 07c9309..56ffbb9 100644 --- a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp +++ b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp @@ -52,6 +52,7 @@ WebProcessConnection::WebProcessConnection(CoreIPC::Connection::Identifier conne m_connection = CoreIPC::Connection::createServerConnection(connectionIdentifier, this, RunLoop::main()); m_npRemoteObjectMap = NPRemoteObjectMap::create(m_connection.get()); + m_connection->setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(true); m_connection->open(); } @@ -70,7 +71,7 @@ void WebProcessConnection::destroyPluginControllerProxy(PluginControllerProxy* p pluginController->destroy(); } -void WebProcessConnection::removePluginControllerProxy(PluginControllerProxy* pluginController) +void WebProcessConnection::removePluginControllerProxy(PluginControllerProxy* pluginController, Plugin* plugin) { { ASSERT(m_pluginControllers.contains(pluginController->pluginInstanceID())); @@ -78,12 +79,14 @@ void WebProcessConnection::removePluginControllerProxy(PluginControllerProxy* pl OwnPtr<PluginControllerProxy> pluginControllerOwnPtr = adoptPtr(m_pluginControllers.take(pluginController->pluginInstanceID())); ASSERT(pluginControllerOwnPtr == pluginController); } - + + // Invalidate all objects related to this plug-in. + if (plugin) + m_npRemoteObjectMap->pluginDestroyed(plugin); + if (!m_pluginControllers.isEmpty()) return; - // Invalidate our remote object map. - m_npRemoteObjectMap->invalidate(); m_npRemoteObjectMap = nullptr; // The last plug-in went away, close this connection. @@ -167,13 +170,10 @@ void WebProcessConnection::createPlugin(uint64_t pluginInstanceID, const Plugin: // Now try to initialize the plug-in. result = pluginControllerProxyPtr->initialize(parameters); - if (result) { - remoteLayerClientID = pluginControllerProxyPtr->remoteLayerClientID(); + if (!result) return; - } - // We failed to initialize, remove the plug-in controller. This could cause us to be deleted. - removePluginControllerProxy(pluginControllerProxyPtr); + remoteLayerClientID = pluginControllerProxyPtr->remoteLayerClientID(); } } // namespace WebKit diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.h b/Source/WebKit2/PluginProcess/WebProcessConnection.h index 4953e61..83fe0fe 100644 --- a/Source/WebKit2/PluginProcess/WebProcessConnection.h +++ b/Source/WebKit2/PluginProcess/WebProcessConnection.h @@ -47,7 +47,7 @@ public: CoreIPC::Connection* connection() const { return m_connection.get(); } NPRemoteObjectMap* npRemoteObjectMap() const { return m_npRemoteObjectMap.get(); } - void removePluginControllerProxy(PluginControllerProxy*); + void removePluginControllerProxy(PluginControllerProxy*, Plugin*); private: WebProcessConnection(CoreIPC::Connection::Identifier); diff --git a/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm b/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm index 5a54719..3a3586a 100644 --- a/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm +++ b/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm @@ -28,17 +28,98 @@ #if ENABLE(PLUGIN_PROCESS) -// FIXME (WebKit2) <rdar://problem/8728860> WebKit2 needs to be localized -#define UI_STRING(__str, __desc) [NSString stringWithUTF8String:__str] - #import "NetscapePlugin.h" #import "PluginProcessShim.h" +#import "PluginProcessProxyMessages.h" #import "PluginProcessCreationParameters.h" +#import <WebCore/LocalizedStrings.h> #import <WebKitSystemInterface.h> #import <dlfcn.h> +#import <wtf/HashSet.h> namespace WebKit { +class FullscreenWindowTracker { + WTF_MAKE_NONCOPYABLE(FullscreenWindowTracker); + +public: + FullscreenWindowTracker() { } + + template<typename T> void windowShown(T window); + template<typename T> void windowHidden(T window); + +private: + typedef HashSet<void*> WindowSet; + WindowSet m_windows; +}; + +static bool rectCoversAnyScreen(NSRect rect) +{ + for (NSScreen *screen in [NSScreen screens]) { + if (NSContainsRect(rect, [screen frame])) + return YES; + } + return NO; +} + +#ifndef NP_NO_CARBON +static bool windowCoversAnyScreen(WindowRef window) +{ + HIRect bounds; + HIWindowGetBounds(window, kWindowStructureRgn, kHICoordSpaceScreenPixel, &bounds); + + // Convert to Cocoa-style screen coordinates that use a Y offset relative to the zeroth screen's origin. + bounds.origin.y = NSHeight([[[NSScreen screens] objectAtIndex:0] frame]) - CGRectGetMaxY(bounds); + + return rectCoversAnyScreen(NSRectFromCGRect(bounds)); +} +#endif + +static bool windowCoversAnyScreen(NSWindow* window) +{ + return rectCoversAnyScreen([window frame]); +} + +template<typename T> void FullscreenWindowTracker::windowShown(T window) +{ + // If this window is already visible then there is nothing to do. + WindowSet::iterator it = m_windows.find(window); + if (it != m_windows.end()) + return; + + // If the window is not full-screen then we're not interested in it. + if (!windowCoversAnyScreen(window)) + return; + + bool windowSetWasEmpty = m_windows.isEmpty(); + + m_windows.add(window); + + // If this is the first full screen window to be shown, notify the UI process. + if (windowSetWasEmpty) + PluginProcess::shared().setFullscreenWindowIsShowing(true); +} + +template<typename T> void FullscreenWindowTracker::windowHidden(T window) +{ + // If this is not a window that we're tracking then there is nothing to do. + WindowSet::iterator it = m_windows.find(window); + if (it == m_windows.end()) + return; + + m_windows.remove(it); + + // If this was the last full screen window that was visible, notify the UI process. + if (m_windows.isEmpty()) + PluginProcess::shared().setFullscreenWindowIsShowing(false); +} + +static FullscreenWindowTracker& fullscreenWindowTracker() +{ + DEFINE_STATIC_LOCAL(FullscreenWindowTracker, fullscreenWindowTracker, ()); + return fullscreenWindowTracker; +} + static bool isUserbreakSet = false; static void initShouldCallRealDebugger() @@ -78,18 +159,62 @@ static UInt32 getCurrentEventButtonState() #endif } +static void cocoaWindowShown(NSWindow *window) +{ + fullscreenWindowTracker().windowShown(window); +} + +static void cocoaWindowHidden(NSWindow *window) +{ + fullscreenWindowTracker().windowHidden(window); +} + +static void carbonWindowShown(WindowRef window) +{ +#ifndef NP_NO_CARBON + fullscreenWindowTracker().windowShown(window); +#endif +} + +static void carbonWindowHidden(WindowRef window) +{ +#ifndef NP_NO_CARBON + fullscreenWindowTracker().windowHidden(window); +#endif +} + +static void setModal(bool modalWindowIsShowing) +{ + PluginProcess::shared().setModalWindowIsShowing(modalWindowIsShowing); +} + void PluginProcess::initializeShim() { const PluginProcessShimCallbacks callbacks = { shouldCallRealDebugger, isWindowActive, - getCurrentEventButtonState + getCurrentEventButtonState, + cocoaWindowShown, + cocoaWindowHidden, + carbonWindowShown, + carbonWindowHidden, + setModal, }; PluginProcessShimInitializeFunc initFunc = reinterpret_cast<PluginProcessShimInitializeFunc>(dlsym(RTLD_DEFAULT, "WebKitPluginProcessShimInitialize")); initFunc(callbacks); } +void PluginProcess::setModalWindowIsShowing(bool modalWindowIsShowing) +{ + m_connection->send(Messages::PluginProcessProxy::SetModalWindowIsShowing(modalWindowIsShowing), 0); +} + +void PluginProcess::setFullscreenWindowIsShowing(bool fullscreenWindowIsShowing) +{ + m_connection->send(Messages::PluginProcessProxy::SetFullscreenWindowIsShowing(fullscreenWindowIsShowing), 0); +} + void PluginProcess::platformInitialize(const PluginProcessCreationParameters& parameters) { m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port(); diff --git a/Source/WebKit2/PluginProcess/mac/PluginProcessShim.cpp b/Source/WebKit2/PluginProcess/mac/PluginProcessShim.cpp deleted file mode 100644 index 346ead9..0000000 --- a/Source/WebKit2/PluginProcess/mac/PluginProcessShim.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginProcessShim.h" - -#include <Carbon/Carbon.h> -#include <stdio.h> - -#define DYLD_INTERPOSE(_replacement,_replacee) \ - __attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee \ - __attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee }; - -namespace WebKit { - -extern "C" void WebKitPluginProcessShimInitialize(const PluginProcessShimCallbacks& callbacks); - -PluginProcessShimCallbacks pluginProcessShimCallbacks; - -__attribute__((visibility("default"))) -void WebKitPluginProcessShimInitialize(const PluginProcessShimCallbacks& callbacks) -{ - pluginProcessShimCallbacks = callbacks; -} - -#ifndef __LP64__ -static void shimDebugger(void) -{ - if (!pluginProcessShimCallbacks.shouldCallRealDebugger()) - return; - - Debugger(); -} - -static UInt32 shimGetCurrentEventButtonState() -{ - return pluginProcessShimCallbacks.getCurrentEventButtonState(); -} - -static Boolean shimIsWindowActive(WindowRef window) -{ - bool result; - if (pluginProcessShimCallbacks.isWindowActive(window, result)) - return result; - - return IsWindowActive(window); -} - -DYLD_INTERPOSE(shimDebugger, Debugger); -DYLD_INTERPOSE(shimGetCurrentEventButtonState, GetCurrentEventButtonState); -DYLD_INTERPOSE(shimIsWindowActive, IsWindowActive); - -#endif - -} // namespace WebKit diff --git a/Source/WebKit2/PluginProcess/mac/PluginProcessShim.h b/Source/WebKit2/PluginProcess/mac/PluginProcessShim.h index 0fbee23..b021a3a 100644 --- a/Source/WebKit2/PluginProcess/mac/PluginProcessShim.h +++ b/Source/WebKit2/PluginProcess/mac/PluginProcessShim.h @@ -26,6 +26,8 @@ #ifndef PluginProcessShim_h #define PluginProcessShim_h +@class NSWindow; + #include <Carbon/Carbon.h> namespace WebKit { @@ -34,6 +36,11 @@ struct PluginProcessShimCallbacks { bool (*shouldCallRealDebugger)(); bool (*isWindowActive)(WindowRef, bool& result); UInt32 (*getCurrentEventButtonState)(); + void (*cocoaWindowShown)(NSWindow *); + void (*cocoaWindowHidden)(NSWindow *); + void (*carbonWindowShown)(WindowRef); + void (*carbonWindowHidden)(WindowRef); + void (*setModal)(bool); }; typedef void (*PluginProcessShimInitializeFunc)(const PluginProcessShimCallbacks&); diff --git a/Source/WebKit2/PluginProcess/mac/PluginProcessShim.mm b/Source/WebKit2/PluginProcess/mac/PluginProcessShim.mm new file mode 100644 index 0000000..6a32727 --- /dev/null +++ b/Source/WebKit2/PluginProcess/mac/PluginProcessShim.mm @@ -0,0 +1,190 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "PluginProcessShim.h" + +#import <AppKit/AppKit.h> +#import <Carbon/Carbon.h> +#import <WebKitSystemInterface.h> +#import <stdio.h> +#import <objc/objc-runtime.h> + +#define DYLD_INTERPOSE(_replacement,_replacee) \ + __attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee \ + __attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee }; + +namespace WebKit { + +extern "C" void WebKitPluginProcessShimInitialize(const PluginProcessShimCallbacks& callbacks); + +static PluginProcessShimCallbacks pluginProcessShimCallbacks; + +static IMP NSApplication_RunModalForWindow; +static unsigned modalCount = 0; + +static void beginModal() +{ + // Make sure to make ourselves the front process + ProcessSerialNumber psn; + GetCurrentProcess(&psn); + SetFrontProcess(&psn); + + if (!modalCount++) + pluginProcessShimCallbacks.setModal(true); +} + +static void endModal() +{ + if (!--modalCount) + pluginProcessShimCallbacks.setModal(false); +} + +static NSInteger shim_NSApplication_RunModalForWindow(id self, SEL _cmd, NSWindow* window) +{ + beginModal(); + NSInteger result = ((NSInteger (*)(id, SEL, NSWindow *))NSApplication_RunModalForWindow)(self, _cmd, window); + endModal(); + + return result; +} + +#ifndef __LP64__ +static void shimDebugger(void) +{ + if (!pluginProcessShimCallbacks.shouldCallRealDebugger()) + return; + + Debugger(); +} + +static UInt32 shimGetCurrentEventButtonState() +{ + return pluginProcessShimCallbacks.getCurrentEventButtonState(); +} + +static Boolean shimIsWindowActive(WindowRef window) +{ + bool result; + if (pluginProcessShimCallbacks.isWindowActive(window, result)) + return result; + + return IsWindowActive(window); +} + +static void shimModalDialog(ModalFilterUPP modalFilter, DialogItemIndex *itemHit) +{ + beginModal(); + ModalDialog(modalFilter, itemHit); + endModal(); +} + +static DialogItemIndex shimAlert(SInt16 alertID, ModalFilterUPP modalFilter) +{ + beginModal(); + DialogItemIndex index = Alert(alertID, modalFilter); + endModal(); + + return index; +} + +static void shimShowWindow(WindowRef window) +{ + pluginProcessShimCallbacks.carbonWindowShown(window); + ShowWindow(window); +} + +static void shimHideWindow(WindowRef window) +{ + pluginProcessShimCallbacks.carbonWindowHidden(window); + HideWindow(window); +} + +static bool isMenuBarVisible = true; + +static void shimShowMenuBar(void) +{ + isMenuBarVisible = true; + + ShowMenuBar(); +} + +static void shimHideMenuBar(void) +{ + isMenuBarVisible = false; + + // Make sure to make ourselves the front process + ProcessSerialNumber psn; + GetCurrentProcess(&psn); + SetFrontProcess(&psn); + + HideMenuBar(); +} + +static Boolean shimIsMenuBarVisible(void) +{ + return isMenuBarVisible; +} + +DYLD_INTERPOSE(shimDebugger, Debugger); +DYLD_INTERPOSE(shimGetCurrentEventButtonState, GetCurrentEventButtonState); +DYLD_INTERPOSE(shimIsWindowActive, IsWindowActive); +DYLD_INTERPOSE(shimModalDialog, ModalDialog); +DYLD_INTERPOSE(shimAlert, Alert); +DYLD_INTERPOSE(shimShowWindow, ShowWindow); +DYLD_INTERPOSE(shimHideWindow, HideWindow); +DYLD_INTERPOSE(shimShowMenuBar, ShowMenuBar) +DYLD_INTERPOSE(shimHideMenuBar, HideMenuBar) +DYLD_INTERPOSE(shimIsMenuBarVisible, IsMenuBarVisible); + +#endif + +__attribute__((visibility("default"))) +void WebKitPluginProcessShimInitialize(const PluginProcessShimCallbacks& callbacks) +{ + pluginProcessShimCallbacks = callbacks; + + // Override -[NSApplication runModalForWindow:] + Method runModalForWindowMethod = class_getInstanceMethod(objc_getClass("NSApplication"), @selector(runModalForWindow:)); + NSApplication_RunModalForWindow = method_setImplementation(runModalForWindowMethod, reinterpret_cast<IMP>(shim_NSApplication_RunModalForWindow)); + + NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter]; + + // Track when any Cocoa window is about to be be shown. + id orderOnScreenObserver = [defaultCenter addObserverForName:WKWindowWillOrderOnScreenNotification() + object:nil + queue:nil + usingBlock:^(NSNotification *notification) { pluginProcessShimCallbacks.cocoaWindowShown([notification object]); }]; + // Track when any cocoa window is about to be hidden. + id orderOffScreenObserver = [defaultCenter addObserverForName:WKWindowWillOrderOffScreenNotification() + object:nil + queue:nil + usingBlock:^(NSNotification *notification) { pluginProcessShimCallbacks.cocoaWindowHidden([notification object]); }]; + + // Leak the two observers so that they observe notifications for the lifetime of the process. + CFRetain(orderOnScreenObserver); + CFRetain(orderOffScreenObserver); +} + +} // namespace WebKit diff --git a/Source/WebKit2/Scripts/generate-forwarding-headers.pl b/Source/WebKit2/Scripts/generate-forwarding-headers.pl index 5a53d81..43425ef 100755 --- a/Source/WebKit2/Scripts/generate-forwarding-headers.pl +++ b/Source/WebKit2/Scripts/generate-forwarding-headers.pl @@ -64,7 +64,7 @@ foreach (@frameworks) { sub collectNeededHeaders { my $filePath = $File::Find::name; my $file = $_; - if ($filePath =~ '\.h$|\.cpp$') { + if ($filePath =~ '\.h$|\.cpp$|\.c$') { open(FILE, "<$file") or die "Could not open $filePath.\n"; while (<FILE>) { if (m/^#.*<$framework\/(.*\.h)/) { diff --git a/Source/WebKit2/Scripts/webkit2/messages.py b/Source/WebKit2/Scripts/webkit2/messages.py index 1c6ae97..159ca32 100644 --- a/Source/WebKit2/Scripts/webkit2/messages.py +++ b/Source/WebKit2/Scripts/webkit2/messages.py @@ -89,6 +89,9 @@ class MessageReceiver(object): else: parameters = [] + for parameter in parameters: + parameter.condition = condition + delayed = delayed_string == 'delayed' if reply_parameters_string: @@ -120,9 +123,10 @@ class Message(object): class Parameter(object): - def __init__(self, type, name): + def __init__(self, type, name, condition=None): self.type = type self.name = name + self.condition = condition def parse_parameter_string(parameter_string): @@ -362,6 +366,8 @@ def generate_messages_header(file): def handler_function(receiver, message): + if message.name.find('URL') == 0: + return '%s::%s' % (receiver.name, 'url' + message.name[3:]) return '%s::%s' % (receiver.name, message.name[0].lower() + message.name[1:]) @@ -449,21 +455,35 @@ def headers_for_type(type): def generate_message_handler(file): receiver = MessageReceiver.parse(file) - headers = set([ - '"%s"' % messages_header_filename(receiver), - '"HandleMessage.h"', - '"ArgumentDecoder.h"', - ]) + headers = { + '"%s"' % messages_header_filename(receiver): None, + '"HandleMessage.h"': None, + '"ArgumentDecoder.h"': None, + } + type_conditions = {} for parameter in receiver.iterparameters(): type = parameter.type + condition = parameter.condition + + if type in type_conditions: + if not type_conditions[type]: + condition = type_conditions[type] + else: + if not condition: + type_conditions[type] = condition + else: + type_conditions[type] = condition + argument_encoder_headers = argument_coder_headers_for_type(parameter.type) if argument_encoder_headers: - headers.update(argument_encoder_headers) + for header in argument_encoder_headers: + headers[header] = condition continue type_headers = headers_for_type(type) - headers.update(type_headers) + for header in type_headers: + headers[header] = condition for message in receiver.messages: if message.reply_parameters is not None: @@ -471,11 +491,13 @@ def generate_message_handler(file): type = reply_parameter.type argument_encoder_headers = argument_coder_headers_for_type(type) if argument_encoder_headers: - headers.update(argument_encoder_headers) + for header in argument_encoder_headers: + headers[header] = message.condition continue type_headers = headers_for_type(type) - headers.update(type_headers) + for header in type_headers: + headers[header] = message.condition result = [] @@ -487,7 +509,13 @@ def generate_message_handler(file): result.append('#if %s\n\n' % receiver.condition) result.append('#include "%s.h"\n\n' % receiver.name) - result += ['#include %s\n' % header for header in sorted(headers)] + for headercondition in sorted(headers): + if headers[headercondition]: + result.append('#if %s\n' % headers[headercondition]) + result += ['#include %s\n' % headercondition] + result.append('#endif\n') + else: + result += ['#include %s\n' % headercondition] result.append('\n') result.append('namespace WebKit {\n\n') diff --git a/Source/WebKit2/Scripts/webkit2/messages_unittest.py b/Source/WebKit2/Scripts/webkit2/messages_unittest.py index 8ed8cee..90d59ae 100644 --- a/Source/WebKit2/Scripts/webkit2/messages_unittest.py +++ b/Source/WebKit2/Scripts/webkit2/messages_unittest.py @@ -68,7 +68,9 @@ messages -> WebPage { GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins) GetPluginProcessConnection(WTF::String pluginPath) -> (CoreIPC::Connection::Handle connectionHandle) delayed +#if PLATFORM(MAC) DidCreateWebProcessConnection(CoreIPC::MachPort connectionIdentifier) +#endif #if PLATFORM(MAC) # Keyboard support @@ -179,7 +181,7 @@ _expected_results = { 'parameters': ( ('CoreIPC::MachPort', 'connectionIdentifier'), ), - 'condition': None, + 'condition': 'PLATFORM(MAC)', }, { 'name': 'InterpretKeyEvent', @@ -291,7 +293,9 @@ enum Kind { RunJavaScriptAlertID, GetPluginsID, GetPluginProcessConnectionID, +#if PLATFORM(MAC) DidCreateWebProcessConnectionID, +#endif #if PLATFORM(MAC) InterpretKeyEventID, #endif @@ -418,6 +422,7 @@ struct GetPluginProcessConnection : CoreIPC::Arguments1<const WTF::String&> { } }; +#if PLATFORM(MAC) struct DidCreateWebProcessConnection : CoreIPC::Arguments1<const CoreIPC::MachPort&> { static const Kind messageID = DidCreateWebProcessConnectionID; typedef CoreIPC::Arguments1<const CoreIPC::MachPort&> DecodeType; @@ -426,6 +431,7 @@ struct DidCreateWebProcessConnection : CoreIPC::Arguments1<const CoreIPC::MachPo { } }; +#endif #if PLATFORM(MAC) struct InterpretKeyEvent : CoreIPC::Arguments1<uint32_t> { @@ -486,14 +492,22 @@ _expected_receiver_implementation = """/* #include "WebPage.h" +#if PLATFORM(MAC) #include "ArgumentCoders.h" +#endif #include "ArgumentDecoder.h" #include "Connection.h" #include "HandleMessage.h" +#if PLATFORM(MAC) #include "MachPort.h" +#endif #include "Plugin.h" +#if PLATFORM(MAC) #include "WebCoreArgumentCoders.h" +#endif +#if ENABLE(TOUCH_EVENTS) #include "WebEvent.h" +#endif #include "WebPageMessages.h" #include "WebPreferencesStore.h" @@ -525,9 +539,11 @@ void WebPage::didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID case Messages::WebPage::SendIntsID: CoreIPC::handleMessage<Messages::WebPage::SendInts>(arguments, this, &WebPage::sendInts); return; +#if PLATFORM(MAC) case Messages::WebPage::DidCreateWebProcessConnectionID: CoreIPC::handleMessage<Messages::WebPage::DidCreateWebProcessConnection>(arguments, this, &WebPage::didCreateWebProcessConnection); return; +#endif default: break; } diff --git a/Source/WebKit2/Shared/API/c/WKBase.h b/Source/WebKit2/Shared/API/c/WKBase.h index 900cd51..1baa872 100644 --- a/Source/WebKit2/Shared/API/c/WKBase.h +++ b/Source/WebKit2/Shared/API/c/WKBase.h @@ -84,8 +84,10 @@ typedef const struct OpaqueWKFramePolicyListener* WKFramePolicyListenerRef; typedef const struct OpaqueWKGeolocationManager* WKGeolocationManagerRef; typedef const struct OpaqueWKGeolocationPermissionRequest* WKGeolocationPermissionRequestRef; typedef const struct OpaqueWKGeolocationPosition* WKGeolocationPositionRef; +typedef const struct OpaqueWKIconDatabase* WKIconDatabaseRef; typedef const struct OpaqueWKInspector* WKInspectorRef; typedef const struct OpaqueWKKeyValueStorageManager* WKKeyValueStorageManagerRef; +typedef const struct OpaqueWKMediaCacheManager* WKMediaCacheManagerRef; typedef const struct OpaqueWKNavigationData* WKNavigationDataRef; typedef const struct OpaqueWKOpenPanelParameters* WKOpenPanelParametersRef; typedef const struct OpaqueWKOpenPanelResultListener* WKOpenPanelResultListenerRef; diff --git a/Source/WebKit2/Shared/API/c/WKMutableDictionary.cpp b/Source/WebKit2/Shared/API/c/WKMutableDictionary.cpp index 0d96ca1..ecd680c 100644 --- a/Source/WebKit2/Shared/API/c/WKMutableDictionary.cpp +++ b/Source/WebKit2/Shared/API/c/WKMutableDictionary.cpp @@ -51,3 +51,8 @@ bool WKDictionarySetItem(WKMutableDictionaryRef dictionaryRef, WKStringRef keyRe { return toImpl(dictionaryRef)->set(toImpl(keyRef)->string(), toImpl(itemRef)); } + +void WKDictionaryRemoveItem(WKMutableDictionaryRef dictionaryRef, WKStringRef keyRef) +{ + toImpl(dictionaryRef)->remove(toImpl(keyRef)->string()); +} diff --git a/Source/WebKit2/Shared/API/c/WKMutableDictionary.h b/Source/WebKit2/Shared/API/c/WKMutableDictionary.h index 467c1d4..2459f91 100644 --- a/Source/WebKit2/Shared/API/c/WKMutableDictionary.h +++ b/Source/WebKit2/Shared/API/c/WKMutableDictionary.h @@ -42,6 +42,7 @@ WK_EXPORT bool WKDictionaryIsMutable(WKDictionaryRef dictionary); WK_EXPORT bool WKDictionaryAddItem(WKMutableDictionaryRef dictionary, WKStringRef key, WKTypeRef item); WK_EXPORT bool WKDictionarySetItem(WKMutableDictionaryRef dictionary, WKStringRef key, WKTypeRef item); +WK_EXPORT void WKDictionaryRemoveItem(WKMutableDictionaryRef dictionary, WKStringRef key); #ifdef __cplusplus } diff --git a/Source/WebKit2/Shared/API/c/WKString.cpp b/Source/WebKit2/Shared/API/c/WKString.cpp index 72841a4..0c388c6 100644 --- a/Source/WebKit2/Shared/API/c/WKString.cpp +++ b/Source/WebKit2/Shared/API/c/WKString.cpp @@ -67,6 +67,11 @@ bool WKStringIsEqualToUTF8CString(WKStringRef aRef, const char* b) return toImpl(aRef)->equalToUTF8String(b); } +bool WKStringIsEqualToUTF8CStringIgnoringCase(WKStringRef aRef, const char* b) +{ + return toImpl(aRef)->equalToUTF8StringIgnoringCase(b); +} + WKStringRef WKStringCreateWithJSString(JSStringRef jsStringRef) { RefPtr<WebString> webString = WebString::create(jsStringRef); diff --git a/Source/WebKit2/Shared/API/c/WKString.h b/Source/WebKit2/Shared/API/c/WKString.h index e79839e..dffcab2 100644 --- a/Source/WebKit2/Shared/API/c/WKString.h +++ b/Source/WebKit2/Shared/API/c/WKString.h @@ -47,6 +47,7 @@ WK_EXPORT size_t WKStringGetUTF8CString(WKStringRef string, char* buffer, size_t WK_EXPORT bool WKStringIsEqual(WKStringRef a, WKStringRef b); WK_EXPORT bool WKStringIsEqualToUTF8CString(WKStringRef a, const char* b); +WK_EXPORT bool WKStringIsEqualToUTF8CStringIgnoringCase(WKStringRef a, const char* b); #ifdef __cplusplus } diff --git a/Source/WebKit2/Shared/API/c/WKURL.cpp b/Source/WebKit2/Shared/API/c/WKURL.cpp index 6b7e567..dacd589 100644 --- a/Source/WebKit2/Shared/API/c/WKURL.cpp +++ b/Source/WebKit2/Shared/API/c/WKURL.cpp @@ -49,3 +49,13 @@ bool WKURLIsEqual(WKURLRef a, WKURLRef b) { return toImpl(a)->string() == toImpl(b)->string(); } + +WKStringRef WKURLCopyHostName(WKURLRef url) +{ + return toCopiedAPI(toImpl(url)->host()); +} + +WKStringRef WKURLCopyScheme(WKURLRef url) +{ + return toCopiedAPI(toImpl(url)->protocol()); +} diff --git a/Source/WebKit2/Shared/API/c/WKURL.h b/Source/WebKit2/Shared/API/c/WKURL.h index 738bce5..f599f16 100644 --- a/Source/WebKit2/Shared/API/c/WKURL.h +++ b/Source/WebKit2/Shared/API/c/WKURL.h @@ -36,7 +36,9 @@ WK_EXPORT WKTypeID WKURLGetTypeID(); WK_EXPORT WKURLRef WKURLCreateWithUTF8CString(const char* string); -WK_EXPORT WKStringRef WKURLCopyString(WKURLRef URL); +WK_EXPORT WKStringRef WKURLCopyString(WKURLRef url); +WK_EXPORT WKStringRef WKURLCopyHostName(WKURLRef url); +WK_EXPORT WKStringRef WKURLCopyScheme(WKURLRef url); WK_EXPORT bool WKURLIsEqual(WKURLRef a, WKURLRef b); diff --git a/Source/WebKit2/Shared/API/c/cf/WKErrorCF.cpp b/Source/WebKit2/Shared/API/c/cf/WKErrorCF.cpp new file mode 100644 index 0000000..95a1b43 --- /dev/null +++ b/Source/WebKit2/Shared/API/c/cf/WKErrorCF.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WKErrorCF.h" + +#include "WKAPICast.h" +#include "WebError.h" + +using namespace WebCore; +using namespace WebKit; + +WKErrorRef WKErrorCreateWithCFError(CFErrorRef cfError) +{ + RefPtr<WebError> error = WebError::create(ResourceError(cfError)); + return toAPI(error.release().releaseRef()); +} + +CFErrorRef WKErrorCopyCFError(CFAllocatorRef alloc, WKErrorRef error) +{ + RetainPtr<CFErrorRef> cfError = toImpl(error)->platformError().cfError(); + return cfError.leakRef(); +} diff --git a/Source/WebKit2/Shared/API/c/cf/WKErrorCF.h b/Source/WebKit2/Shared/API/c/cf/WKErrorCF.h new file mode 100644 index 0000000..298f7c2 --- /dev/null +++ b/Source/WebKit2/Shared/API/c/cf/WKErrorCF.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WKErrorCF_h +#define WKErrorCF_h + +#include <CoreFoundation/CoreFoundation.h> +#include <WebKit2/WKBase.h> + +#ifdef __cplusplus +extern "C" { +#endif + +WK_EXPORT WKErrorRef WKErrorCreateWithCFError(CFErrorRef error); +WK_EXPORT CFErrorRef WKErrorCopyCFError(CFAllocatorRef alloc, WKErrorRef error); + +#ifdef __cplusplus +} +#endif + +#endif /* WKErrorCF_h */ diff --git a/Source/WebKit2/Shared/API/c/cf/WKURLResponseCF.cpp b/Source/WebKit2/Shared/API/c/cf/WKURLResponseCF.cpp index 42473c8..10b4941 100644 --- a/Source/WebKit2/Shared/API/c/cf/WKURLResponseCF.cpp +++ b/Source/WebKit2/Shared/API/c/cf/WKURLResponseCF.cpp @@ -33,6 +33,9 @@ using namespace WebKit; WKURLResponseRef WKURLResponseCreateWithCFURLResponse(CFURLResponseRef urlResponse) { + if (!urlResponse) + return 0; + CFURLResponseRef copiedURLResponse = CFURLResponseCreateCopy(kCFAllocatorDefault, urlResponse); RefPtr<WebURLResponse> response = WebURLResponse::create(copiedURLResponse); return toAPI(response.release().releaseRef()); @@ -40,5 +43,12 @@ WKURLResponseRef WKURLResponseCreateWithCFURLResponse(CFURLResponseRef urlRespon CFURLResponseRef WKURLResponseCopyCFURLResponse(CFAllocatorRef alloc, WKURLResponseRef urlResponse) { + if (!urlResponse) + return 0; + + PlatformResponse platformURLResponse = toImpl(urlResponse)->platformResponse(); + if (!platformURLResponse) + return 0; + return CFURLResponseCreateCopy(alloc, toImpl(urlResponse)->platformResponse()); } diff --git a/Source/WebKit2/Shared/API/c/cg/WKImageCG.cpp b/Source/WebKit2/Shared/API/c/cg/WKImageCG.cpp index 61b5f17..7af747e 100644 --- a/Source/WebKit2/Shared/API/c/cg/WKImageCG.cpp +++ b/Source/WebKit2/Shared/API/c/cg/WKImageCG.cpp @@ -36,6 +36,14 @@ using namespace WebCore; CGImageRef WKImageCreateCGImage(WKImageRef imageRef) { - OwnPtr<GraphicsContext> sourceContext = toImpl(imageRef)->bitmap()->createGraphicsContext(); - return CGBitmapContextCreateImage(sourceContext->platformContext()); + return toImpl(imageRef)->bitmap()->makeCGImageCopy().leakRef(); +} + +WKImageRef WKImageCreateFromCGImage(CGImageRef imageRef, WKImageOptions options) +{ + IntSize imageSize(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); + RefPtr<WebImage> webImage = WebImage::create(imageSize, toImageOptions(options)); + OwnPtr<GraphicsContext> graphicsContext = webImage->bitmap()->createGraphicsContext(); + CGContextDrawImage(graphicsContext->platformContext(), CGRectMake(0, 0, imageSize.width(), imageSize.height()), imageRef); + return toAPI(webImage.release().leakRef()); } diff --git a/Source/WebKit2/Shared/API/c/cg/WKImageCG.h b/Source/WebKit2/Shared/API/c/cg/WKImageCG.h index 7705c31..800b02e 100644 --- a/Source/WebKit2/Shared/API/c/cg/WKImageCG.h +++ b/Source/WebKit2/Shared/API/c/cg/WKImageCG.h @@ -28,6 +28,7 @@ #include <CoreGraphics/CGImage.h> #include <WebKit2/WKBase.h> +#include <WebKit2/WKImage.h> #ifdef __cplusplus extern "C" { @@ -35,6 +36,8 @@ extern "C" { WK_EXPORT CGImageRef WKImageCreateCGImage(WKImageRef image); +WK_EXPORT WKImageRef WKImageCreateFromCGImage(CGImageRef imageRef, WKImageOptions options); + #ifdef __cplusplus } #endif diff --git a/Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.h b/Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.h index 7d44478..d098f34 100644 --- a/Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.h +++ b/Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.h @@ -33,6 +33,7 @@ extern "C" { #endif +WK_EXPORT WKCertificateInfoRef WKCertificateInfoCreateWithCertficateChain(CFArrayRef certificateChain); WK_EXPORT CFArrayRef WKCertificateInfoGetCertificateChain(WKCertificateInfoRef certificateInfo); #ifdef __cplusplus diff --git a/Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm b/Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm index a2f348d..34dd431 100644 --- a/Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm +++ b/Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm @@ -31,6 +31,12 @@ using namespace WebKit; +WKCertificateInfoRef WKCertificateInfoCreateWithCertficateChain(CFArrayRef certificateChain) +{ + RefPtr<WebCertificateInfo> certificateInfo = WebCertificateInfo::create(PlatformCertificateInfo(certificateChain)); + return toAPI(certificateInfo.release().leakRef()); +} + CFArrayRef WKCertificateInfoGetCertificateChain(WKCertificateInfoRef certificateInfoRef) { return toImpl(certificateInfoRef)->platformCertificateInfo().certificateChain(); diff --git a/Source/WebKit2/Shared/API/c/win/WKBaseWin.h b/Source/WebKit2/Shared/API/c/win/WKBaseWin.h index e2ee9a7..fdd4607 100644 --- a/Source/WebKit2/Shared/API/c/win/WKBaseWin.h +++ b/Source/WebKit2/Shared/API/c/win/WKBaseWin.h @@ -31,5 +31,6 @@ #endif typedef const struct OpaqueWKView* WKViewRef; +typedef const struct OpaqueWKEditCommand* WKEditCommandRef; #endif /* WKBaseWin_h */ diff --git a/Source/WebKit2/Shared/API/c/win/WKCertificateInfoWin.cpp b/Source/WebKit2/Shared/API/c/win/WKCertificateInfoWin.cpp index ada20ef..674f94e 100644 --- a/Source/WebKit2/Shared/API/c/win/WKCertificateInfoWin.cpp +++ b/Source/WebKit2/Shared/API/c/win/WKCertificateInfoWin.cpp @@ -31,6 +31,11 @@ using namespace WebKit; +WKCertificateInfoRef WKCertificateInfoCreateWithCertificate(PCCERT_CONTEXT certificate) +{ + return toAPI(WebCertificateInfo::create(PlatformCertificateInfo(certificate)).leakRef()); +} + size_t WKCertificateInfoGetCertificateChainLength(WKCertificateInfoRef certificateInfoRef) { return toImpl(certificateInfoRef)->platformCertificateInfo().certificateChain().size(); diff --git a/Source/WebKit2/Shared/API/c/win/WKCertificateInfoWin.h b/Source/WebKit2/Shared/API/c/win/WKCertificateInfoWin.h index 0fcd818..a3ee9e5 100644 --- a/Source/WebKit2/Shared/API/c/win/WKCertificateInfoWin.h +++ b/Source/WebKit2/Shared/API/c/win/WKCertificateInfoWin.h @@ -33,6 +33,7 @@ extern "C" { #endif +WK_EXPORT WKCertificateInfoRef WKCertificateInfoCreateWithCertificate(PCCERT_CONTEXT certificate); WK_EXPORT size_t WKCertificateInfoGetCertificateChainLength(WKCertificateInfoRef certificateInfo); WK_EXPORT PCCERT_CONTEXT WKCertificateInfoGetCertificateContextAtIndex(WKCertificateInfoRef certificateInfo, size_t index); diff --git a/Source/WebKit2/Shared/APIObject.h b/Source/WebKit2/Shared/APIObject.h index 24f8cba..7f50b51 100644 --- a/Source/WebKit2/Shared/APIObject.h +++ b/Source/WebKit2/Shared/APIObject.h @@ -72,11 +72,14 @@ public: TypeFormSubmissionListener, TypeFrame, TypeFramePolicyListener, + TypeFullScreenManager, TypeGeolocationManager, TypeGeolocationPermissionRequest, TypeGeolocationPosition, + TypeIconDatabase, TypeInspector, TypeKeyValueStorageManager, + TypeMediaCacheManager, TypeNavigationData, TypeOpenPanelParameters, TypeOpenPanelResultListener, @@ -101,7 +104,8 @@ public: TypeBundleScriptWorld, // Platform specific - TypeView + TypeView, + TypeEditCommandProxy }; virtual ~APIObject() diff --git a/Source/WebKit2/Shared/DictionaryPopupInfo.cpp b/Source/WebKit2/Shared/DictionaryPopupInfo.cpp index 15cb306..45bf91d 100644 --- a/Source/WebKit2/Shared/DictionaryPopupInfo.cpp +++ b/Source/WebKit2/Shared/DictionaryPopupInfo.cpp @@ -28,6 +28,10 @@ #include "WebCoreArgumentCoders.h" +#if PLATFORM(MAC) +#include "ArgumentCodersCF.h" +#endif + namespace WebKit { void DictionaryPopupInfo::encode(CoreIPC::ArgumentEncoder* encoder) const @@ -35,6 +39,10 @@ void DictionaryPopupInfo::encode(CoreIPC::ArgumentEncoder* encoder) const encoder->encode(origin); encoder->encode(fontInfo); encoder->encodeEnum(type); + +#if PLATFORM(MAC) + CoreIPC::encode(encoder, options.get()); +#endif } bool DictionaryPopupInfo::decode(CoreIPC::ArgumentDecoder* decoder, DictionaryPopupInfo& result) @@ -45,6 +53,10 @@ bool DictionaryPopupInfo::decode(CoreIPC::ArgumentDecoder* decoder, DictionaryPo return false; if (!decoder->decodeEnum(result.type)) return false; +#if PLATFORM(MAC) + if (!CoreIPC::decode(decoder, result.options)) + return false; +#endif return true; } diff --git a/Source/WebKit2/Shared/DictionaryPopupInfo.h b/Source/WebKit2/Shared/DictionaryPopupInfo.h index 5682fcd..68c81a7 100644 --- a/Source/WebKit2/Shared/DictionaryPopupInfo.h +++ b/Source/WebKit2/Shared/DictionaryPopupInfo.h @@ -29,6 +29,10 @@ #include "FontInfo.h" #include <WebCore/FloatPoint.h> +#if PLATFORM(MAC) +#include <wtf/RetainPtr.h> +#endif + namespace CoreIPC { class ArgumentDecoder; class ArgumentEncoder; @@ -48,6 +52,9 @@ struct DictionaryPopupInfo { WebCore::FloatPoint origin; FontInfo fontInfo; Type type; +#if PLATFORM(MAC) + RetainPtr<CFDictionaryRef> options; +#endif }; } // namespace WebKit diff --git a/Source/WebKit2/Shared/HTTPCookieAcceptPolicy.h b/Source/WebKit2/Shared/HTTPCookieAcceptPolicy.h new file mode 100644 index 0000000..d7a645e --- /dev/null +++ b/Source/WebKit2/Shared/HTTPCookieAcceptPolicy.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef HTTPCookieAcceptPolicy_h +#define HTTPCookieAcceptPolicy_h + +namespace WebKit { + +enum { + HTTPCookieAcceptPolicyAlways = 0, + HTTPCookieAcceptPolicyNever = 1, + HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain = 2, +}; +typedef unsigned HTTPCookieAcceptPolicy; + +} // namespace WebKit + +#endif // HTTPCookieAcceptPolicy_h diff --git a/Source/WebKit2/Shared/LayerTreeContext.h b/Source/WebKit2/Shared/LayerTreeContext.h index e2938aa..233b7ae 100644 --- a/Source/WebKit2/Shared/LayerTreeContext.h +++ b/Source/WebKit2/Shared/LayerTreeContext.h @@ -26,13 +26,13 @@ #ifndef LayerTreeContext_h #define LayerTreeContext_h -#if USE(ACCELERATED_COMPOSITING) - namespace CoreIPC { class ArgumentDecoder; class ArgumentEncoder; } +#if USE(ACCELERATED_COMPOSITING) + namespace WebKit { class LayerTreeContext { diff --git a/Source/WebKit2/Shared/MutableDictionary.cpp b/Source/WebKit2/Shared/MutableDictionary.cpp index 222caf3..2f905ec 100644 --- a/Source/WebKit2/Shared/MutableDictionary.cpp +++ b/Source/WebKit2/Shared/MutableDictionary.cpp @@ -48,4 +48,9 @@ bool MutableDictionary::set(const String& key, APIObject* item) return result.second; } +void MutableDictionary::remove(const String& key) +{ + m_map.remove(key); +} + } // namespace WebKit diff --git a/Source/WebKit2/Shared/MutableDictionary.h b/Source/WebKit2/Shared/MutableDictionary.h index f5ee4e7..5898cb7 100644 --- a/Source/WebKit2/Shared/MutableDictionary.h +++ b/Source/WebKit2/Shared/MutableDictionary.h @@ -43,6 +43,7 @@ public: bool add(const String& key, APIObject*); bool set(const String& key, APIObject*); + void remove(const String& key); virtual bool isMutable() { return true; } diff --git a/Source/WebKit2/Shared/PlatformPopupMenuData.cpp b/Source/WebKit2/Shared/PlatformPopupMenuData.cpp index a5ebb45..1f56daf 100644 --- a/Source/WebKit2/Shared/PlatformPopupMenuData.cpp +++ b/Source/WebKit2/Shared/PlatformPopupMenuData.cpp @@ -51,13 +51,12 @@ void PlatformPopupMenuData::encode(CoreIPC::ArgumentEncoder* encoder) const encoder->encode(m_clientInsetRight); encoder->encode(m_popupWidth); encoder->encode(m_itemHeight); - encoder->encode(m_backingStoreSize); - SharedMemory::Handle notSelectedBackingStoreHandle; + ShareableBitmap::Handle notSelectedBackingStoreHandle; m_notSelectedBackingStore->createHandle(notSelectedBackingStoreHandle); encoder->encode(notSelectedBackingStoreHandle); - SharedMemory::Handle selectedBackingStoreHandle; + ShareableBitmap::Handle selectedBackingStoreHandle; m_selectedBackingStore->createHandle(selectedBackingStoreHandle); encoder->encode(selectedBackingStoreHandle); #elif PLATFORM(MAC) @@ -80,18 +79,16 @@ bool PlatformPopupMenuData::decode(CoreIPC::ArgumentDecoder* decoder, PlatformPo return false; if (!decoder->decode(data.m_itemHeight)) return false; - if (!decoder->decode(data.m_backingStoreSize)) - return false; - SharedMemory::Handle notSelectedBackingStoreHandle; + ShareableBitmap::Handle notSelectedBackingStoreHandle; if (!decoder->decode(notSelectedBackingStoreHandle)) return false; - data.m_notSelectedBackingStore = ShareableBitmap::create(data.m_backingStoreSize, notSelectedBackingStoreHandle); + data.m_notSelectedBackingStore = ShareableBitmap::create(notSelectedBackingStoreHandle); - SharedMemory::Handle selectedBackingStoreHandle; + ShareableBitmap::Handle selectedBackingStoreHandle; if (!decoder->decode(selectedBackingStoreHandle)) return false; - data.m_selectedBackingStore = ShareableBitmap::create(data.m_backingStoreSize, selectedBackingStoreHandle); + data.m_selectedBackingStore = ShareableBitmap::create(selectedBackingStoreHandle); #elif PLATFORM(MAC) if (!decoder->decode(data.fontInfo)) return false; diff --git a/Source/WebKit2/Shared/PlatformPopupMenuData.h b/Source/WebKit2/Shared/PlatformPopupMenuData.h index f79b4b2..5b3f58d 100644 --- a/Source/WebKit2/Shared/PlatformPopupMenuData.h +++ b/Source/WebKit2/Shared/PlatformPopupMenuData.h @@ -50,7 +50,6 @@ struct PlatformPopupMenuData { int m_clientInsetRight; int m_popupWidth; int m_itemHeight; - WebCore::IntSize m_backingStoreSize; RefPtr<ShareableBitmap> m_notSelectedBackingStore; RefPtr<ShareableBitmap> m_selectedBackingStore; #elif PLATFORM(MAC) diff --git a/Source/WebKit2/Shared/Plugins/NPIdentifierData.h b/Source/WebKit2/Shared/Plugins/NPIdentifierData.h index dbe979e..1a7c772 100644 --- a/Source/WebKit2/Shared/Plugins/NPIdentifierData.h +++ b/Source/WebKit2/Shared/Plugins/NPIdentifierData.h @@ -28,7 +28,7 @@ #if ENABLE(PLUGIN_PROCESS) -#include <WebCore/npruntime.h> +#include <WebCore/npruntime_internal.h> #include <wtf/text/CString.h> namespace CoreIPC { diff --git a/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp b/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp index 2fd7244..46742af 100644 --- a/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp +++ b/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp @@ -33,21 +33,18 @@ #include "NPRuntimeUtilities.h" #include "NPVariantData.h" -// FIXME: This code shouldn't know about NPJSObject. -#include "NPJSObject.h" - namespace WebKit { -PassOwnPtr<NPObjectMessageReceiver> NPObjectMessageReceiver::create(NPRemoteObjectMap* npRemoteObjectMap, uint64_t npObjectID, NPObject* npObject) +PassOwnPtr<NPObjectMessageReceiver> NPObjectMessageReceiver::create(NPRemoteObjectMap* npRemoteObjectMap, Plugin* plugin, uint64_t npObjectID, NPObject* npObject) { - return adoptPtr(new NPObjectMessageReceiver(npRemoteObjectMap, npObjectID, npObject)); + return adoptPtr(new NPObjectMessageReceiver(npRemoteObjectMap, plugin, npObjectID, npObject)); } -NPObjectMessageReceiver::NPObjectMessageReceiver(NPRemoteObjectMap* npRemoteObjectMap, uint64_t npObjectID, NPObject* npObject) +NPObjectMessageReceiver::NPObjectMessageReceiver(NPRemoteObjectMap* npRemoteObjectMap, Plugin* plugin, uint64_t npObjectID, NPObject* npObject) : m_npRemoteObjectMap(npRemoteObjectMap) + , m_plugin(plugin) , m_npObjectID(npObjectID) , m_npObject(npObject) - , m_shouldReleaseObjectWhenInvalidating(!NPJSObject::isNPJSObject(npObject)) { retainNPObject(m_npObject); } @@ -56,13 +53,6 @@ NPObjectMessageReceiver::~NPObjectMessageReceiver() { m_npRemoteObjectMap->unregisterNPObject(m_npObjectID); - // If we're invalidating the remote object map, we don't always want to release the underlying NPObject. - // One example of this is NPJSObjects in the Web process, which have already been deallocated by the plug-in view. - // FIXME: This is not the ideal way to handle this. Maybe NPObjectMessageReceiver should be notified somehow when the underlying - // NPObject is deallocated. - if (m_npRemoteObjectMap->isInvalidating() && !m_shouldReleaseObjectWhenInvalidating) - return; - releaseNPObject(m_npObject); } @@ -90,7 +80,7 @@ void NPObjectMessageReceiver::invoke(const NPIdentifierData& methodNameData, con Vector<NPVariant> arguments; for (size_t i = 0; i < argumentsData.size(); ++i) - arguments.append(m_npRemoteObjectMap->npVariantDataToNPVariant(argumentsData[i])); + arguments.append(m_npRemoteObjectMap->npVariantDataToNPVariant(argumentsData[i], m_plugin)); NPVariant result; VOID_TO_NPVARIANT(result); @@ -98,7 +88,7 @@ void NPObjectMessageReceiver::invoke(const NPIdentifierData& methodNameData, con returnValue = m_npObject->_class->invoke(m_npObject, methodNameData.createNPIdentifier(), arguments.data(), arguments.size(), &result); if (returnValue) { // Convert the NPVariant to an NPVariantData. - resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result); + resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result, m_plugin); } // Release all arguments. @@ -118,7 +108,7 @@ void NPObjectMessageReceiver::invokeDefault(const Vector<NPVariantData>& argumen Vector<NPVariant> arguments; for (size_t i = 0; i < argumentsData.size(); ++i) - arguments.append(m_npRemoteObjectMap->npVariantDataToNPVariant(argumentsData[i])); + arguments.append(m_npRemoteObjectMap->npVariantDataToNPVariant(argumentsData[i], m_plugin)); NPVariant result; VOID_TO_NPVARIANT(result); @@ -126,7 +116,7 @@ void NPObjectMessageReceiver::invokeDefault(const Vector<NPVariantData>& argumen returnValue = m_npObject->_class->invokeDefault(m_npObject, arguments.data(), arguments.size(), &result); if (returnValue) { // Convert the NPVariant to an NPVariantData. - resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result); + resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result, m_plugin); } // Release all arguments. @@ -160,7 +150,7 @@ void NPObjectMessageReceiver::getProperty(const NPIdentifierData& propertyNameDa return; // Convert the NPVariant to an NPVariantData. - resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result); + resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result, m_plugin); // And release the result. releaseNPVariantValue(&result); @@ -173,7 +163,7 @@ void NPObjectMessageReceiver::setProperty(const NPIdentifierData& propertyNameDa return; } - NPVariant propertyValue = m_npRemoteObjectMap->npVariantDataToNPVariant(propertyValueData); + NPVariant propertyValue = m_npRemoteObjectMap->npVariantDataToNPVariant(propertyValueData, m_plugin); // Set the property. returnValue = m_npObject->_class->setProperty(m_npObject, propertyNameData.createNPIdentifier(), &propertyValue); @@ -221,7 +211,7 @@ void NPObjectMessageReceiver::construct(const Vector<NPVariantData>& argumentsDa Vector<NPVariant> arguments; for (size_t i = 0; i < argumentsData.size(); ++i) - arguments.append(m_npRemoteObjectMap->npVariantDataToNPVariant(argumentsData[i])); + arguments.append(m_npRemoteObjectMap->npVariantDataToNPVariant(argumentsData[i], m_plugin)); NPVariant result; VOID_TO_NPVARIANT(result); @@ -229,7 +219,7 @@ void NPObjectMessageReceiver::construct(const Vector<NPVariantData>& argumentsDa returnValue = m_npObject->_class->construct(m_npObject, arguments.data(), arguments.size(), &result); if (returnValue) { // Convert the NPVariant to an NPVariantData. - resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result); + resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result, m_plugin); } // Release all arguments. diff --git a/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h b/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h index cfb66e1..22352d2 100644 --- a/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h +++ b/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h @@ -38,20 +38,22 @@ namespace WebKit { class NPIdentifierData; class NPRemoteObjectMap; class NPVariantData; +class Plugin; class NPObjectMessageReceiver { WTF_MAKE_NONCOPYABLE(NPObjectMessageReceiver); public: - static PassOwnPtr<NPObjectMessageReceiver> create(NPRemoteObjectMap* npRemoteObjectMap, uint64_t npObjectID, NPObject* npObject); + static PassOwnPtr<NPObjectMessageReceiver> create(NPRemoteObjectMap*, Plugin*, uint64_t npObjectID, NPObject*); ~NPObjectMessageReceiver(); CoreIPC::SyncReplyMode didReceiveSyncNPObjectMessageReceiverMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*); + Plugin* plugin() const { return m_plugin; } NPObject* npObject() const { return m_npObject; } private: - NPObjectMessageReceiver(NPRemoteObjectMap* npRemoteObjectMap, uint64_t npObjectID, NPObject* npObject); + NPObjectMessageReceiver(NPRemoteObjectMap*, Plugin*, uint64_t npObjectID, NPObject*); // Message handlers. void deallocate(); @@ -66,9 +68,9 @@ private: void construct(const Vector<NPVariantData>& argumentsData, bool& returnValue, NPVariantData& resultData); NPRemoteObjectMap* m_npRemoteObjectMap; + Plugin* m_plugin; uint64_t m_npObjectID; NPObject* m_npObject; - bool m_shouldReleaseObjectWhenInvalidating; }; } // namespace WebKit diff --git a/Source/WebKit2/Shared/Plugins/NPObjectProxy.cpp b/Source/WebKit2/Shared/Plugins/NPObjectProxy.cpp index 04a6e7d..61daa6c 100644 --- a/Source/WebKit2/Shared/Plugins/NPObjectProxy.cpp +++ b/Source/WebKit2/Shared/Plugins/NPObjectProxy.cpp @@ -38,16 +38,17 @@ namespace WebKit { -NPObjectProxy* NPObjectProxy::create(NPRemoteObjectMap* npRemoteObjectMap, uint64_t npObjectID) +NPObjectProxy* NPObjectProxy::create(NPRemoteObjectMap* npRemoteObjectMap, Plugin* plugin, uint64_t npObjectID) { NPObjectProxy* npObjectProxy = toNPObjectProxy(createNPObject(0, npClass())); - npObjectProxy->initialize(npRemoteObjectMap, npObjectID); + npObjectProxy->initialize(npRemoteObjectMap, plugin, npObjectID); return npObjectProxy; } NPObjectProxy::NPObjectProxy() : m_npRemoteObjectMap(0) + , m_plugin(0) , m_npObjectID(0) { } @@ -69,19 +70,24 @@ bool NPObjectProxy::isNPObjectProxy(NPObject* npObject) void NPObjectProxy::invalidate() { ASSERT(m_npRemoteObjectMap); + ASSERT(m_plugin); m_npRemoteObjectMap = 0; + m_plugin = 0; } -void NPObjectProxy::initialize(NPRemoteObjectMap* npRemoteObjectMap, uint64_t npObjectID) +void NPObjectProxy::initialize(NPRemoteObjectMap* npRemoteObjectMap, Plugin* plugin, uint64_t npObjectID) { ASSERT(!m_npRemoteObjectMap); + ASSERT(!m_plugin); ASSERT(!m_npObjectID); ASSERT(npRemoteObjectMap); + ASSERT(plugin); ASSERT(npObjectID); m_npRemoteObjectMap = npRemoteObjectMap; + m_plugin = plugin; m_npObjectID = npObjectID; } @@ -108,7 +114,7 @@ bool NPObjectProxy::invoke(NPIdentifier methodName, const NPVariant* arguments, NPIdentifierData methodNameData = NPIdentifierData::fromNPIdentifier(methodName); Vector<NPVariantData> argumentsData; for (uint32_t i = 0; i < argumentCount; ++i) - argumentsData.append(m_npRemoteObjectMap->npVariantToNPVariantData(arguments[i])); + argumentsData.append(m_npRemoteObjectMap->npVariantToNPVariantData(arguments[i], m_plugin)); bool returnValue = false; NPVariantData resultData; @@ -119,7 +125,7 @@ bool NPObjectProxy::invoke(NPIdentifier methodName, const NPVariant* arguments, if (!returnValue) return false; - *result = m_npRemoteObjectMap->npVariantDataToNPVariant(resultData); + *result = m_npRemoteObjectMap->npVariantDataToNPVariant(resultData, m_plugin); return true; } @@ -130,7 +136,7 @@ bool NPObjectProxy::invokeDefault(const NPVariant* arguments, uint32_t argumentC Vector<NPVariantData> argumentsData; for (uint32_t i = 0; i < argumentCount; ++i) - argumentsData.append(m_npRemoteObjectMap->npVariantToNPVariantData(arguments[i])); + argumentsData.append(m_npRemoteObjectMap->npVariantToNPVariantData(arguments[i], m_plugin)); bool returnValue = false; NPVariantData resultData; @@ -141,7 +147,7 @@ bool NPObjectProxy::invokeDefault(const NPVariant* arguments, uint32_t argumentC if (!returnValue) return false; - *result = m_npRemoteObjectMap->npVariantDataToNPVariant(resultData); + *result = m_npRemoteObjectMap->npVariantDataToNPVariant(resultData, m_plugin); return true; } @@ -176,7 +182,7 @@ bool NPObjectProxy::getProperty(NPIdentifier propertyName, NPVariant* result) if (!returnValue) return false; - *result = m_npRemoteObjectMap->npVariantDataToNPVariant(resultData); + *result = m_npRemoteObjectMap->npVariantDataToNPVariant(resultData, m_plugin); return true; } @@ -186,7 +192,7 @@ bool NPObjectProxy::setProperty(NPIdentifier propertyName, const NPVariant* valu return false; NPIdentifierData propertyNameData = NPIdentifierData::fromNPIdentifier(propertyName); - NPVariantData propertyValueData = m_npRemoteObjectMap->npVariantToNPVariantData(*value); + NPVariantData propertyValueData = m_npRemoteObjectMap->npVariantToNPVariantData(*value, m_plugin); bool returnValue = false; @@ -242,7 +248,7 @@ bool NPObjectProxy::construct(const NPVariant* arguments, uint32_t argumentCount Vector<NPVariantData> argumentsData; for (uint32_t i = 0; i < argumentCount; ++i) - argumentsData.append(m_npRemoteObjectMap->npVariantToNPVariantData(arguments[i])); + argumentsData.append(m_npRemoteObjectMap->npVariantToNPVariantData(arguments[i], m_plugin)); bool returnValue = false; NPVariantData resultData; @@ -253,7 +259,7 @@ bool NPObjectProxy::construct(const NPVariant* arguments, uint32_t argumentCount if (!returnValue) return false; - *result = m_npRemoteObjectMap->npVariantDataToNPVariant(resultData); + *result = m_npRemoteObjectMap->npVariantDataToNPVariant(resultData, m_plugin); return true; } diff --git a/Source/WebKit2/Shared/Plugins/NPObjectProxy.h b/Source/WebKit2/Shared/Plugins/NPObjectProxy.h index e4c00c5..f472cb8 100644 --- a/Source/WebKit2/Shared/Plugins/NPObjectProxy.h +++ b/Source/WebKit2/Shared/Plugins/NPObjectProxy.h @@ -28,18 +28,19 @@ #if ENABLE(PLUGIN_PROCESS) -#include <WebCore/npruntime.h> +#include <WebCore/npruntime_internal.h> #include <wtf/Noncopyable.h> namespace WebKit { class NPRemoteObjectMap; +class Plugin; class NPObjectProxy : public NPObject { WTF_MAKE_NONCOPYABLE(NPObjectProxy); public: - static NPObjectProxy* create(NPRemoteObjectMap* npRemoteObjectMap, uint64_t npObjectID); + static NPObjectProxy* create(NPRemoteObjectMap*, Plugin*, uint64_t npObjectID); static bool isNPObjectProxy(NPObject*); @@ -49,6 +50,7 @@ public: return static_cast<NPObjectProxy*>(npObject); } + Plugin* plugin() const { return m_plugin; } uint64_t npObjectID() const { return m_npObjectID; } void invalidate(); @@ -57,7 +59,7 @@ private: NPObjectProxy(); ~NPObjectProxy(); - void initialize(NPRemoteObjectMap* npRemoteObjectMap, uint64_t npObjectID); + void initialize(NPRemoteObjectMap*, Plugin*, uint64_t npObjectID); bool hasMethod(NPIdentifier methodName); bool invoke(NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result); @@ -83,6 +85,7 @@ private: static bool NP_Construct(NPObject*, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result); NPRemoteObjectMap* m_npRemoteObjectMap; + Plugin* m_plugin; uint64_t m_npObjectID; }; diff --git a/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp b/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp index 0e164f1..70978c5 100644 --- a/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp +++ b/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp @@ -50,7 +50,6 @@ PassRefPtr<NPRemoteObjectMap> NPRemoteObjectMap::create(CoreIPC::Connection* con NPRemoteObjectMap::NPRemoteObjectMap(CoreIPC::Connection* connection) : m_connection(connection) - , m_isInvalidating(false) { } @@ -60,9 +59,9 @@ NPRemoteObjectMap::~NPRemoteObjectMap() ASSERT(m_registeredNPObjects.isEmpty()); } -NPObject* NPRemoteObjectMap::createNPObjectProxy(uint64_t remoteObjectID) +NPObject* NPRemoteObjectMap::createNPObjectProxy(uint64_t remoteObjectID, Plugin* plugin) { - NPObjectProxy* npObjectProxy = NPObjectProxy::create(this, remoteObjectID); + NPObjectProxy* npObjectProxy = NPObjectProxy::create(this, plugin, remoteObjectID); m_npObjectProxies.add(npObjectProxy); @@ -71,16 +70,16 @@ NPObject* NPRemoteObjectMap::createNPObjectProxy(uint64_t remoteObjectID) void NPRemoteObjectMap::npObjectProxyDestroyed(NPObject* npObject) { - ASSERT(NPObjectProxy::isNPObjectProxy(npObject)); - ASSERT(m_npObjectProxies.contains(npObject)); + NPObjectProxy* npObjectProxy = NPObjectProxy::toNPObjectProxy(npObject); + ASSERT(m_npObjectProxies.contains(npObjectProxy)); - m_npObjectProxies.remove(npObject); + m_npObjectProxies.remove(npObjectProxy); } -uint64_t NPRemoteObjectMap::registerNPObject(NPObject* npObject) +uint64_t NPRemoteObjectMap::registerNPObject(NPObject* npObject, Plugin* plugin) { uint64_t npObjectID = generateNPObjectID(); - m_registeredNPObjects.set(npObjectID, NPObjectMessageReceiver::create(this, npObjectID, npObject).leakPtr()); + m_registeredNPObjects.set(npObjectID, NPObjectMessageReceiver::create(this, plugin, npObjectID, npObject).leakPtr()); return npObjectID; } @@ -90,7 +89,7 @@ void NPRemoteObjectMap::unregisterNPObject(uint64_t npObjectID) m_registeredNPObjects.remove(npObjectID); } -NPVariantData NPRemoteObjectMap::npVariantToNPVariantData(const NPVariant& variant) +NPVariantData NPRemoteObjectMap::npVariantToNPVariantData(const NPVariant& variant, Plugin* plugin) { switch (variant.type) { case NPVariantType_Void: @@ -124,7 +123,7 @@ NPVariantData NPRemoteObjectMap::npVariantToNPVariantData(const NPVariant& varia return NPVariantData::makeRemoteNPObjectID(npObjectID); } - uint64_t npObjectID = registerNPObject(npObject); + uint64_t npObjectID = registerNPObject(npObject, plugin); return NPVariantData::makeLocalNPObjectID(npObjectID); } @@ -134,7 +133,7 @@ NPVariantData NPRemoteObjectMap::npVariantToNPVariantData(const NPVariant& varia return NPVariantData::makeVoid(); } -NPVariant NPRemoteObjectMap::npVariantDataToNPVariant(const NPVariantData& npVariantData) +NPVariant NPRemoteObjectMap::npVariantDataToNPVariant(const NPVariantData& npVariantData, Plugin* plugin) { NPVariant npVariant; @@ -178,7 +177,7 @@ NPVariant NPRemoteObjectMap::npVariantDataToNPVariant(const NPVariantData& npVar break; } case NPVariantData::RemoteNPObjectID: { - NPObject* npObjectProxy = createNPObjectProxy(npVariantData.remoteNPObjectIDValue()); + NPObject* npObjectProxy = createNPObjectProxy(npVariantData.remoteNPObjectIDValue(), plugin); OBJECT_TO_NPVARIANT(npObjectProxy, npVariant); break; } @@ -187,25 +186,37 @@ NPVariant NPRemoteObjectMap::npVariantDataToNPVariant(const NPVariantData& npVar return npVariant; } -void NPRemoteObjectMap::invalidate() +void NPRemoteObjectMap::pluginDestroyed(Plugin* plugin) { - ASSERT(!m_isInvalidating); - - m_isInvalidating = true; - Vector<NPObjectMessageReceiver*> messageReceivers; - copyValuesToVector(m_registeredNPObjects, messageReceivers); + + // Gather the receivers associated with this plug-in. + for (HashMap<uint64_t, NPObjectMessageReceiver*>::const_iterator it = m_registeredNPObjects.begin(), end = m_registeredNPObjects.end(); it != end; ++it) { + NPObjectMessageReceiver* npObjectMessageReceiver = it->second; + if (npObjectMessageReceiver->plugin() == plugin) + messageReceivers.append(npObjectMessageReceiver); + } // Now delete all the receivers. deleteAllValues(messageReceivers); - ASSERT(m_registeredNPObjects.isEmpty()); + Vector<NPObjectProxy*> objectProxies; + for (HashSet<NPObjectProxy*>::const_iterator it = m_npObjectProxies.begin(), end = m_npObjectProxies.end(); it != end; ++it) { + NPObjectProxy* npObjectProxy = *it; - for (HashSet<NPObject*>::const_iterator it = m_npObjectProxies.begin(), end = m_npObjectProxies.end(); it != end; ++it) - NPObjectProxy::toNPObjectProxy(*it)->invalidate(); - m_npObjectProxies.clear(); + if (npObjectProxy->plugin() == plugin) + objectProxies.append(npObjectProxy); + } + + // Invalidate and remove all proxies associated with this plug-in. + for (size_t i = 0; i < objectProxies.size(); ++i) { + NPObjectProxy* npObjectProxy = objectProxies[i]; - m_isInvalidating = false; + npObjectProxy->invalidate(); + + ASSERT(m_npObjectProxies.contains(npObjectProxy)); + m_npObjectProxies.remove(npObjectProxy); + } } CoreIPC::SyncReplyMode NPRemoteObjectMap::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply) diff --git a/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h b/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h index ff0bbbb..812d4d7 100644 --- a/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h +++ b/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h @@ -39,6 +39,7 @@ namespace WebKit { class NPObjectMessageReceiver; class NPObjectProxy; class NPVariantData; +class Plugin; class NPRemoteObjectMap : public RefCounted<NPRemoteObjectMap> { public: @@ -46,23 +47,22 @@ public: ~NPRemoteObjectMap(); // Creates an NPObjectProxy wrapper for the remote object with the given remote object ID. - NPObject* createNPObjectProxy(uint64_t remoteObjectID); + NPObject* createNPObjectProxy(uint64_t remoteObjectID, Plugin*); void npObjectProxyDestroyed(NPObject*); // Expose the given NPObject as a remote object. Returns the objectID. - uint64_t registerNPObject(NPObject*); + uint64_t registerNPObject(NPObject*, Plugin*); void unregisterNPObject(uint64_t); // Given an NPVariant, creates an NPVariantData object (a CoreIPC representation of an NPVariant). - NPVariantData npVariantToNPVariantData(const NPVariant&); + NPVariantData npVariantToNPVariantData(const NPVariant&, Plugin*); // Given an NPVariantData, creates an NPVariant object. - NPVariant npVariantDataToNPVariant(const NPVariantData&); + NPVariant npVariantDataToNPVariant(const NPVariantData&, Plugin*); CoreIPC::Connection* connection() const { return m_connection; } - bool isInvalidating() const { return m_isInvalidating; } - void invalidate(); + void pluginDestroyed(Plugin*); CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply); @@ -70,14 +70,12 @@ private: explicit NPRemoteObjectMap(CoreIPC::Connection*); CoreIPC::Connection* m_connection; - bool m_isInvalidating; - // A map of NPObjectMessageReceiver classes, wrapping objects that we export to the // other end of the connection. HashMap<uint64_t, NPObjectMessageReceiver*> m_registeredNPObjects; // A set of NPObjectProxy objects associated with this map. - HashSet<NPObject*> m_npObjectProxies; + HashSet<NPObjectProxy*> m_npObjectProxies; }; } // namespace WebKit diff --git a/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp b/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp index 7bbdaa8..54af967 100644 --- a/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp +++ b/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp @@ -58,16 +58,6 @@ NetscapePluginModule::~NetscapePluginModule() ASSERT(initializedNetscapePluginModules().find(this) == notFound); } -void NetscapePluginModule::pluginCreated() -{ - incrementLoadCount(); -} - -void NetscapePluginModule::pluginDestroyed() -{ - decrementLoadCount(); -} - Vector<String> NetscapePluginModule::sitesWithData() { Vector<String> sites; @@ -235,8 +225,21 @@ bool NetscapePluginModule::tryLoad() // reversed. Failing to follow this order results in crashes (e.g., in Silverlight on Mac and // in Flash and QuickTime on Windows). #if PLUGIN_ARCHITECTURE(MAC) - if (initializeFuncPtr(netscapeBrowserFuncs()) != NPERR_NO_ERROR || getEntryPointsFuncPtr(&m_pluginFuncs) != NPERR_NO_ERROR) - return false; +#ifndef NP_NO_CARBON + // Plugins (at least QT) require that you call UseResFile on the resource file before loading it. + ResFileRefNum currentResourceFile = CurResFile(); + + ResFileRefNum pluginResourceFile = m_module->bundleResourceMap(); + UseResFile(pluginResourceFile); +#endif + bool result = initializeFuncPtr(netscapeBrowserFuncs()) == NPERR_NO_ERROR && getEntryPointsFuncPtr(&m_pluginFuncs) == NPERR_NO_ERROR; + +#ifndef NP_NO_CARBON + // Restore the resource file. + UseResFile(currentResourceFile); +#endif + + return result; #elif PLUGIN_ARCHITECTURE(WIN) if (getEntryPointsFuncPtr(&m_pluginFuncs) != NPERR_NO_ERROR || initializeFuncPtr(netscapeBrowserFuncs()) != NPERR_NO_ERROR) return false; diff --git a/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h b/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h index aee26bb..4ec7991 100644 --- a/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h +++ b/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h @@ -45,9 +45,9 @@ public: ~NetscapePluginModule(); const NPPluginFuncs& pluginFuncs() const { return m_pluginFuncs; } - - void pluginCreated(); - void pluginDestroyed(); + + void incrementLoadCount(); + void decrementLoadCount(); static bool getPluginInfo(const String& pluginPath, PluginInfoStore::Plugin&); @@ -68,9 +68,6 @@ private: void applyX11QuirksBeforeLoad(); #endif - void incrementLoadCount(); - void decrementLoadCount(); - bool tryGetSitesWithData(Vector<String>&); bool tryClearSiteData(const String& site, uint64_t flags, uint64_t maxAge); diff --git a/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm b/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm index accab46..d290f5b 100644 --- a/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm +++ b/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm @@ -86,13 +86,35 @@ static bool getPluginArchitecture(CFBundleRef bundle, cpu_type_t& pluginArchitec return false; } + +static RetainPtr<CFDictionaryRef> getMIMETypesFromPluginBundle(CFBundleRef bundle) +{ + CFStringRef propertyListFilename = static_cast<CFStringRef>(CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("WebPluginMIMETypesFilename"))); + if (propertyListFilename) { + RetainPtr<CFStringRef> propertyListPath(AdoptCF, CFStringCreateWithFormat(kCFAllocatorDefault, 0, CFSTR("%@/Library/Preferences/%@"), NSHomeDirectory(), propertyListFilename)); + RetainPtr<CFURLRef> propertyListURL(AdoptCF, CFURLCreateWithFileSystemPath(kCFAllocatorDefault, propertyListPath.get(), kCFURLPOSIXPathStyle, FALSE)); + + CFDataRef propertyListData; + CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault, propertyListURL.get(), &propertyListData, 0, 0, 0); + RetainPtr<CFPropertyListRef> propertyList(AdoptCF, CFPropertyListCreateWithData(kCFAllocatorDefault, propertyListData, kCFPropertyListImmutable, 0, 0)); + if (propertyListData) + CFRelease(propertyListData); + + // FIXME: Have the plug-in create the MIME types property list if it doesn't exist. + // https://bugs.webkit.org/show_bug.cgi?id=57204 + if (!propertyList || CFGetTypeID(propertyList.get()) != CFDictionaryGetTypeID()) + return 0; + + return static_cast<CFDictionaryRef>(CFDictionaryGetValue(static_cast<CFDictionaryRef>(propertyList.get()), CFSTR("WebPluginMIMETypes"))); + } + + return static_cast<CFDictionaryRef>(CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("WebPluginMIMETypes"))); +} static bool getPluginInfoFromPropertyLists(CFBundleRef bundle, PluginInfo& pluginInfo) { - // FIXME: Handle WebPluginMIMETypesFilenameKey. - - CFDictionaryRef mimeTypes = static_cast<CFDictionaryRef>(CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("WebPluginMIMETypes"))); - if (!mimeTypes || CFGetTypeID(mimeTypes) != CFDictionaryGetTypeID()) + RetainPtr<CFDictionaryRef> mimeTypes = getMIMETypesFromPluginBundle(bundle); + if (!mimeTypes || CFGetTypeID(mimeTypes.get()) != CFDictionaryGetTypeID()) return false; // Get the plug-in name. @@ -106,10 +128,10 @@ static bool getPluginInfoFromPropertyLists(CFBundleRef bundle, PluginInfo& plugi pluginInfo.desc = pluginDescription; // Get the MIME type mapping dictionary. - CFIndex numMimeTypes = CFDictionaryGetCount(mimeTypes); + CFIndex numMimeTypes = CFDictionaryGetCount(mimeTypes.get()); Vector<CFStringRef> mimeTypesVector(numMimeTypes); Vector<CFDictionaryRef> mimeTypeInfoVector(numMimeTypes); - CFDictionaryGetKeysAndValues(mimeTypes, reinterpret_cast<const void**>(mimeTypesVector.data()), reinterpret_cast<const void**>(mimeTypeInfoVector.data())); + CFDictionaryGetKeysAndValues(mimeTypes.get(), reinterpret_cast<const void**>(mimeTypesVector.data()), reinterpret_cast<const void**>(mimeTypeInfoVector.data())); for (CFIndex i = 0; i < numMimeTypes; ++i) { MimeClassInfo mimeClassInfo; @@ -142,8 +164,15 @@ static bool getPluginInfoFromPropertyLists(CFBundleRef bundle, PluginInfo& plugi CFStringRef extension = static_cast<CFStringRef>(CFArrayGetValueAtIndex(extensionsArray, i)); if (!extension || CFGetTypeID(extension) != CFStringGetTypeID()) continue; - - mimeClassInfo.extensions.append(String(extension).lower()); + + // The DivX plug-in lists multiple extensions in a comma separated string instead of using + // multiple array elements in the property list. Work around this here by splitting the + // extension string into components. + Vector<String> extensionComponents; + String(extension).lower().split(',', extensionComponents); + + for (size_t i = 0; i < extensionComponents.size(); ++i) + mimeClassInfo.extensions.append(extensionComponents[i]); } // Add this MIME type. @@ -333,8 +362,24 @@ void NetscapePluginModule::determineQuirks() if (plugin.bundleIdentifier == "com.macromedia.Flash Player.plugin") { // Flash requires that the return value of getprogname() be "WebKitPluginHost". m_pluginQuirks.add(PluginQuirks::PrognameShouldBeWebKitPluginHost); + + // Flash supports snapshotting. m_pluginQuirks.add(PluginQuirks::SupportsSnapshotting); } + + if (plugin.bundleIdentifier == "com.microsoft.SilverlightPlugin") { + // Silverlight doesn't explicitly opt into transparency, so we'll do it whenever + // there's a 'background' attribute. + m_pluginQuirks.add(PluginQuirks::MakeTransparentIfBackgroundAttributeExists); + } + +#ifndef NP_NO_QUICKDRAW + if (plugin.bundleIdentifier == "com.apple.ist.ds.appleconnect.webplugin") { + // The AppleConnect plug-in uses QuickDraw but doesn't paint or receive events + // so we'll allow it to be instantiated even though we don't support QuickDraw. + m_pluginQuirks.add(PluginQuirks::AllowHalfBakedQuickDrawSupport); + } +#endif } } // namespace WebKit diff --git a/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp b/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp index b5e3aad..76ecda7 100644 --- a/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp +++ b/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp @@ -40,7 +40,7 @@ namespace WebKit { #if PLATFORM(QT) static void initializeGTK() { - QLibrary library("libgtk-x11-2.0.so.0"); + QLibrary library(QLatin1String("libgtk-x11-2.0.so.0")); if (library.load()) { typedef void *(*gtk_init_check_ptr)(int*, char***); gtk_init_check_ptr gtkInitCheck = reinterpret_cast<gtk_init_check_ptr>(library.resolve("gtk_init_check")); diff --git a/Source/WebKit2/Shared/Plugins/PluginQuirks.h b/Source/WebKit2/Shared/Plugins/PluginQuirks.h index 9f8c1c4..ea4643b 100644 --- a/Source/WebKit2/Shared/Plugins/PluginQuirks.h +++ b/Source/WebKit2/Shared/Plugins/PluginQuirks.h @@ -36,8 +36,25 @@ public: // The plug-in wants the call to getprogame() to return "WebKitPluginHost". // Adobe Flash Will not handle key down events otherwise. PrognameShouldBeWebKitPluginHost, + // Supports receiving a paint event, even when using CoreAnimation rendering. SupportsSnapshotting, + + // Make the plug-in transparent if it has a "background" attribute set. + // Microsoft Silverlight doesn't opt into transparency using NPN_SetValue and + // NPPVpluginTransparentBool, so we'll always force if the plug-in has a "background" + // attribute specified, regardless of it's value. + // FIXME: We could get more fancy here and check for specific values that we know are + // transparent. + MakeTransparentIfBackgroundAttributeExists, + +#ifndef NP_NO_QUICKDRAW + // Allow the plug-in to use the QuickDraw drawing model, since wek now that the plug-in + // will never paint or receive events. Used by the AppleConnect plug-in. + AllowHalfBakedQuickDrawSupport, +#endif + + // X11 specific quirks: #elif PLUGIN_ARCHITECTURE(X11) // Flash and npwrapper ask the browser about which GTK version does it use // and refuse to load and work if it is not GTK 2 so we need to fake it in diff --git a/Source/WebKit2/UIProcess/API/C/win/WKBaseWin.h b/Source/WebKit2/Shared/ResourceCachesToClear.h index e2ee9a7..df9367c 100644 --- a/Source/WebKit2/UIProcess/API/C/win/WKBaseWin.h +++ b/Source/WebKit2/Shared/ResourceCachesToClear.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,13 +23,16 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WKBaseWin_h -#define WKBaseWin_h +#ifndef ResourceCachesToClear_h +#define ResourceCachesToClear_h -#ifndef WKBase_h -#error "Please #include \"WKBase.h\" instead of this file directly." -#endif +namespace WebKit { -typedef const struct OpaqueWKView* WKViewRef; +enum ResourceCachesToClear { + AllResourceCaches = 0, + InMemoryResourceCachesOnly = 1 +}; -#endif /* WKBaseWin_h */ +} // namespace WebKit + +#endif // ResourceCachesToClear_h diff --git a/Source/WebKit2/Shared/ShareableBitmap.cpp b/Source/WebKit2/Shared/ShareableBitmap.cpp index ab1991f..cde3aa1 100644 --- a/Source/WebKit2/Shared/ShareableBitmap.cpp +++ b/Source/WebKit2/Shared/ShareableBitmap.cpp @@ -27,13 +27,37 @@ #include "ShareableBitmap.h" #include "SharedMemory.h" +#include "WebCoreArgumentCoders.h" #include <WebCore/GraphicsContext.h> using namespace WebCore; namespace WebKit { -PassRefPtr<ShareableBitmap> ShareableBitmap::create(const WebCore::IntSize& size) +ShareableBitmap::Handle::Handle() + : m_flags(0) +{ +} + +void ShareableBitmap::Handle::encode(CoreIPC::ArgumentEncoder* encoder) const +{ + encoder->encode(m_handle); + encoder->encode(m_size); + encoder->encode(m_flags); +} + +bool ShareableBitmap::Handle::decode(CoreIPC::ArgumentDecoder* decoder, Handle& handle) +{ + if (!decoder->decode(handle.m_handle)) + return false; + if (!decoder->decode(handle.m_size)) + return false; + if (!decoder->decode(handle.m_flags)) + return false; + return true; +} + +PassRefPtr<ShareableBitmap> ShareableBitmap::create(const IntSize& size, Flags flags) { size_t numBytes = numBytesForSize(size); @@ -41,10 +65,10 @@ PassRefPtr<ShareableBitmap> ShareableBitmap::create(const WebCore::IntSize& size if (!tryFastMalloc(numBytes).getValue(data)) return 0; - return adoptRef(new ShareableBitmap(size, data)); + return adoptRef(new ShareableBitmap(size, flags, data)); } -PassRefPtr<ShareableBitmap> ShareableBitmap::createShareable(const IntSize& size) +PassRefPtr<ShareableBitmap> ShareableBitmap::createShareable(const IntSize& size, Flags flags) { size_t numBytes = numBytesForSize(size); @@ -52,44 +76,50 @@ PassRefPtr<ShareableBitmap> ShareableBitmap::createShareable(const IntSize& size if (!sharedMemory) return 0; - return adoptRef(new ShareableBitmap(size, sharedMemory)); + return adoptRef(new ShareableBitmap(size, flags, sharedMemory)); } -PassRefPtr<ShareableBitmap> ShareableBitmap::create(const WebCore::IntSize& size, PassRefPtr<SharedMemory> sharedMemory) +PassRefPtr<ShareableBitmap> ShareableBitmap::create(const IntSize& size, Flags flags, PassRefPtr<SharedMemory> sharedMemory) { ASSERT(sharedMemory); size_t numBytes = numBytesForSize(size); ASSERT_UNUSED(numBytes, sharedMemory->size() >= numBytes); - return adoptRef(new ShareableBitmap(size, sharedMemory)); + return adoptRef(new ShareableBitmap(size, flags, sharedMemory)); } -PassRefPtr<ShareableBitmap> ShareableBitmap::create(const WebCore::IntSize& size, const SharedMemory::Handle& handle) +PassRefPtr<ShareableBitmap> ShareableBitmap::create(const Handle& handle) { // Create the shared memory. - RefPtr<SharedMemory> sharedMemory = SharedMemory::create(handle, SharedMemory::ReadWrite); + RefPtr<SharedMemory> sharedMemory = SharedMemory::create(handle.m_handle, SharedMemory::ReadWrite); if (!sharedMemory) return 0; - return create(size, sharedMemory.release()); + return create(handle.m_size, handle.m_flags, sharedMemory.release()); } -bool ShareableBitmap::createHandle(SharedMemory::Handle& handle) +bool ShareableBitmap::createHandle(Handle& handle) { ASSERT(isBackedBySharedMemory()); - return m_sharedMemory->createHandle(handle, SharedMemory::ReadWrite); + if (!m_sharedMemory->createHandle(handle.m_handle, SharedMemory::ReadWrite)) + return false; + handle.m_size = m_size; + handle.m_flags = m_flags; + return true; } -ShareableBitmap::ShareableBitmap(const IntSize& size, void* data) +ShareableBitmap::ShareableBitmap(const IntSize& size, Flags flags, void* data) : m_size(size) + , m_flags(flags) , m_data(data) { } -ShareableBitmap::ShareableBitmap(const IntSize& size, PassRefPtr<SharedMemory> sharedMemory) +ShareableBitmap::ShareableBitmap(const IntSize& size, Flags flags, PassRefPtr<SharedMemory> sharedMemory) : m_size(size) + , m_flags(flags) , m_sharedMemory(sharedMemory) , m_data(0) { diff --git a/Source/WebKit2/Shared/ShareableBitmap.h b/Source/WebKit2/Shared/ShareableBitmap.h index f9a3af0..fe7fa0a 100644 --- a/Source/WebKit2/Shared/ShareableBitmap.h +++ b/Source/WebKit2/Shared/ShareableBitmap.h @@ -33,6 +33,10 @@ #include <wtf/RefCounted.h> #include <wtf/RefPtr.h> +#if PLATFORM(CG) +#include <wtf/RetainPtr.h> +#endif + namespace WebCore { class GraphicsContext; } @@ -41,20 +45,43 @@ namespace WebKit { class ShareableBitmap : public RefCounted<ShareableBitmap> { public: + enum Flag { + SupportsAlpha = 1 << 0, + }; + typedef unsigned Flags; + + class Handle { + WTF_MAKE_NONCOPYABLE(Handle); + public: + Handle(); + + bool isNull() const { return m_handle.isNull(); } + + void encode(CoreIPC::ArgumentEncoder*) const; + static bool decode(CoreIPC::ArgumentDecoder*, Handle&); + + private: + friend class ShareableBitmap; + + mutable SharedMemory::Handle m_handle; + WebCore::IntSize m_size; + Flags m_flags; + }; + // Create a shareable bitmap that uses malloced memory. - static PassRefPtr<ShareableBitmap> create(const WebCore::IntSize&); + static PassRefPtr<ShareableBitmap> create(const WebCore::IntSize&, Flags); // Create a shareable bitmap whose backing memory can be shared with another process. - static PassRefPtr<ShareableBitmap> createShareable(const WebCore::IntSize&); + static PassRefPtr<ShareableBitmap> createShareable(const WebCore::IntSize&, Flags); // Create a shareable bitmap from an already existing shared memory block. - static PassRefPtr<ShareableBitmap> create(const WebCore::IntSize&, PassRefPtr<SharedMemory>); + static PassRefPtr<ShareableBitmap> create(const WebCore::IntSize&, Flags, PassRefPtr<SharedMemory>); - // Create a shareable bitmap from a shared memory handle. - static PassRefPtr<ShareableBitmap> create(const WebCore::IntSize&, const SharedMemory::Handle&); + // Create a shareable bitmap from a handle. + static PassRefPtr<ShareableBitmap> create(const Handle&); - // Create a shared memory handle. - bool createHandle(SharedMemory::Handle&); + // Create a handle. + bool createHandle(Handle&); ~ShareableBitmap(); @@ -71,18 +98,31 @@ public: bool isBackedBySharedMemory() const { return m_sharedMemory; } +#if PLATFORM(CG) + // This creates a copied CGImageRef (most likely a copy-on-write) of the shareable bitmap. + RetainPtr<CGImageRef> makeCGImageCopy(); + + // This creates a CGImageRef that directly references the shared bitmap data. + // This is only safe to use when we know that the contents of the shareable bitmap won't change. + RetainPtr<CGImageRef> makeCGImage(); +#endif + private: - ShareableBitmap(const WebCore::IntSize&, void*); - ShareableBitmap(const WebCore::IntSize&, PassRefPtr<SharedMemory>); + ShareableBitmap(const WebCore::IntSize&, Flags, void*); + ShareableBitmap(const WebCore::IntSize&, Flags, PassRefPtr<SharedMemory>); static size_t numBytesForSize(const WebCore::IntSize& size) { return size.width() * size.height() * 4; } - static void releaseData(void* typelessBitmap, void* typelessData); - +#if PLATFORM(CG) + static void releaseBitmapContextData(void* typelessBitmap, void* typelessData); + static void releaseDataProviderData(void* typelessBitmap, const void* typelessData, size_t); +#endif + void* data() const; size_t sizeInBytes() const { return numBytesForSize(m_size); } WebCore::IntSize m_size; + Flags m_flags; // If the shareable bitmap is backed by shared memory, this points to the shared memory object. RefPtr<SharedMemory> m_sharedMemory; diff --git a/Source/WebKit2/Shared/UpdateInfo.h b/Source/WebKit2/Shared/UpdateInfo.h index 7b5454e..8e08ed0 100644 --- a/Source/WebKit2/Shared/UpdateInfo.h +++ b/Source/WebKit2/Shared/UpdateInfo.h @@ -26,7 +26,7 @@ #ifndef UpdateInfo_h #define UpdateInfo_h -#include "SharedMemory.h" +#include "ShareableBitmap.h" #include <WebCore/IntRect.h> #include <wtf/Noncopyable.h> @@ -60,7 +60,7 @@ public: Vector<WebCore::IntRect> updateRects; // The handle of the shareable bitmap containing the updates. Will be null if there are no updates. - SharedMemory::Handle bitmapHandle; + ShareableBitmap::Handle bitmapHandle; }; } // namespace WebKit diff --git a/Source/WebKit2/Shared/UserMessageCoders.h b/Source/WebKit2/Shared/UserMessageCoders.h index 1326a98..ad72493 100644 --- a/Source/WebKit2/Shared/UserMessageCoders.h +++ b/Source/WebKit2/Shared/UserMessageCoders.h @@ -31,7 +31,9 @@ #include "ImmutableArray.h" #include "ImmutableDictionary.h" #include "ShareableBitmap.h" +#include "WebCertificateInfo.h" #include "WebCoreArgumentCoders.h" +#include "WebData.h" #include "WebImage.h" #include "WebNumber.h" #include "WebSerializedScriptValue.h" @@ -47,6 +49,8 @@ namespace WebKit { // - SerializedScriptValue -> SerializedScriptValue // - String -> String // - UserContentURLPattern -> UserContentURLPattern +// - WebCertificateInfo -> WebCertificateInfo +// - WebData -> WebData // - WebDouble -> WebDouble // - WebImage -> WebImage // - WebUInt64 -> WebUInt64 @@ -128,16 +132,25 @@ public: return true; } - SharedMemory::Handle handle; + ShareableBitmap::Handle handle; if (!image->bitmap()->createHandle(handle)) return false; encoder->encode(true); - encoder->encode(image->size()); encoder->encode(handle); return true; } + case APIObject::TypeData: { + WebData* data = static_cast<WebData*>(m_root); + encoder->encodeBytes(data->bytes(), data->size()); + return true; + } + case APIObject::TypeCertificateInfo: { + WebCertificateInfo* certificateInfo = static_cast<WebCertificateInfo*>(m_root); + encoder->encode(certificateInfo->platformCertificateInfo()); + return true; + } default: break; } @@ -162,6 +175,8 @@ protected: // - SerializedScriptValue -> SerializedScriptValue // - String -> String // - UserContentURLPattern -> UserContentURLPattern +// - WebCertificateInfo -> WebCertificateInfo +// - WebData -> WebData // - WebDouble -> WebDouble // - WebImage -> WebImage // - WebUInt64 -> WebUInt64 @@ -277,17 +292,27 @@ public: if (!didEncode) break; - WebCore::IntSize size; - if (!decoder->decode(size)) - return false; - - SharedMemory::Handle handle; + ShareableBitmap::Handle handle; if (!decoder->decode(handle)) return false; - coder.m_root = WebImage::create(ShareableBitmap::create(size, handle)); + coder.m_root = WebImage::create(ShareableBitmap::create(handle)); return true; } + case APIObject::TypeData: { + Vector<uint8_t> buffer; + if (!decoder->decodeBytes(buffer)) + return false; + coder.m_root = WebData::create(buffer); + break; + } + case APIObject::TypeCertificateInfo: { + PlatformCertificateInfo platformCertificateInfo; + if (!decoder->decode(platformCertificateInfo)) + return false; + coder.m_root = WebCertificateInfo::create(platformCertificateInfo); + break; + } default: break; } diff --git a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp index e97c7fd..99b3c00 100644 --- a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp +++ b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp @@ -37,25 +37,21 @@ namespace CoreIPC { void encodeImage(ArgumentEncoder* encoder, Image* image) { - RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(image->size()); + RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(image->size(), ShareableBitmap::SupportsAlpha); bitmap->createGraphicsContext()->drawImage(image, ColorSpaceDeviceRGB, IntPoint()); - SharedMemory::Handle handle; + ShareableBitmap::Handle handle; bitmap->createHandle(handle); - encoder->encode(image->size()); encoder->encode(handle); } bool decodeImage(ArgumentDecoder* decoder, RefPtr<Image>& image) { - IntSize imageSize; - if (!decoder->decode(imageSize)) - return false; - SharedMemory::Handle handle; + ShareableBitmap::Handle handle; if (!decoder->decode(handle)) return false; - RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(imageSize, handle); + RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(handle); if (!bitmap) return false; image = createImage(bitmap.get()); diff --git a/Source/WebKit2/Shared/WebCoreArgumentCoders.h b/Source/WebKit2/Shared/WebCoreArgumentCoders.h index 1679bb6..e12b9be 100644 --- a/Source/WebKit2/Shared/WebCoreArgumentCoders.h +++ b/Source/WebKit2/Shared/WebCoreArgumentCoders.h @@ -277,26 +277,22 @@ template<> struct ArgumentCoder<WebCore::ResourceResponse> { } }; +// These two functions are implemented in a platform specific manner. +void encodeResourceError(ArgumentEncoder*, const WebCore::ResourceError&); +bool decodeResourceError(ArgumentDecoder*, WebCore::ResourceError&); + template<> struct ArgumentCoder<WebCore::ResourceError> { static void encode(ArgumentEncoder* encoder, const WebCore::ResourceError& resourceError) { - encoder->encode(CoreIPC::In(resourceError.domain(), resourceError.errorCode(), resourceError.failingURL(), resourceError.localizedDescription())); + encodeResourceError(encoder, resourceError); } static bool decode(ArgumentDecoder* decoder, WebCore::ResourceError& resourceError) { - String domain; - int errorCode; - String failingURL; - String localizedDescription; - if (!decoder->decode(CoreIPC::Out(domain, errorCode, failingURL, localizedDescription))) - return false; - resourceError = WebCore::ResourceError(domain, errorCode, failingURL, localizedDescription); - return true; + return decodeResourceError(decoder, resourceError); } }; - template<> struct ArgumentCoder<WebCore::WindowFeatures> { static void encode(ArgumentEncoder* encoder, const WebCore::WindowFeatures& windowFeatures) { diff --git a/Source/WebKit2/Shared/WebData.h b/Source/WebKit2/Shared/WebData.h index 789b965..538e496 100644 --- a/Source/WebKit2/Shared/WebData.h +++ b/Source/WebKit2/Shared/WebData.h @@ -38,34 +38,60 @@ class WebData : public APIObject { public: static const Type APIType = TypeData; + typedef void (*FreeDataFunction)(unsigned char*, const void* context); + + static PassRefPtr<WebData> createWithoutCopying(const unsigned char* bytes, size_t size, FreeDataFunction freeDataFunction, const void* context) + { + return adoptRef(new WebData(bytes, size, freeDataFunction, context)); + } + static PassRefPtr<WebData> create(const unsigned char* bytes, size_t size) { - return adoptRef(new WebData(bytes, size)); + unsigned char *copiedBytes = 0; + + if (size) { + copiedBytes = static_cast<unsigned char*>(fastMalloc(size)); + memcpy(copiedBytes, bytes, size); + } + + return createWithoutCopying(copiedBytes, size, fastFreeBytes, 0); } static PassRefPtr<WebData> create(const Vector<unsigned char>& buffer) { - return adoptRef(new WebData(buffer)); + return create(buffer.data(), buffer.size()); } - - const unsigned char* bytes() const { return m_buffer.data(); } - size_t size() const { return m_buffer.size(); } + + ~WebData() + { + m_freeDataFunction(const_cast<unsigned char*>(m_bytes), m_context); + } + + const unsigned char* bytes() const { return m_bytes; } + size_t size() const { return m_size; } private: - WebData(const unsigned char* bytes, size_t size) - : m_buffer(size) + WebData(const unsigned char* bytes, size_t size, FreeDataFunction freeDataFunction, const void* context) + : m_bytes(bytes) + , m_size(size) + , m_freeDataFunction(freeDataFunction) + , m_context(context) { - memcpy(m_buffer.data(), bytes, size); } - - WebData(const Vector<unsigned char>& buffer) - : m_buffer(buffer) + + static void fastFreeBytes(unsigned char* bytes, const void*) { + if (bytes) + fastFree(static_cast<void*>(bytes)); } virtual Type type() const { return APIType; } - Vector<unsigned char> m_buffer; + const unsigned char* m_bytes; + size_t m_size; + + FreeDataFunction m_freeDataFunction; + const void* m_context; }; } // namespace WebKit diff --git a/Source/WebKit2/Shared/WebImage.cpp b/Source/WebKit2/Shared/WebImage.cpp index e245268..b0e4bff 100644 --- a/Source/WebKit2/Shared/WebImage.cpp +++ b/Source/WebKit2/Shared/WebImage.cpp @@ -35,8 +35,8 @@ namespace WebKit { PassRefPtr<WebImage> WebImage::create(const IntSize& size, ImageOptions options) { if (options & ImageOptionsShareable) - return WebImage::create(ShareableBitmap::createShareable(size)); - return WebImage::create(ShareableBitmap::create(size)); + return WebImage::create(ShareableBitmap::createShareable(size, ShareableBitmap::SupportsAlpha)); + return WebImage::create(ShareableBitmap::create(size, ShareableBitmap::SupportsAlpha)); } PassRefPtr<WebImage> WebImage::create(PassRefPtr<ShareableBitmap> bitmap) diff --git a/Source/WebKit2/Shared/WebMemorySampler.cpp b/Source/WebKit2/Shared/WebMemorySampler.cpp index 82b2be9..ef17a2b 100644 --- a/Source/WebKit2/Shared/WebMemorySampler.cpp +++ b/Source/WebKit2/Shared/WebMemorySampler.cpp @@ -117,7 +117,7 @@ bool WebMemorySampler::isRunning() const void WebMemorySampler::initializeTempLogFile() { - m_sampleLogFilePath = String((openTemporaryFile(processName().utf8().data(), m_sampleLogFile)).data()); + m_sampleLogFilePath = openTemporaryFile(processName(), m_sampleLogFile); writeHeaders(); } diff --git a/Source/WebKit2/Shared/WebPageCreationParameters.cpp b/Source/WebKit2/Shared/WebPageCreationParameters.cpp index 33b53e3..c5dff58 100644 --- a/Source/WebKit2/Shared/WebPageCreationParameters.cpp +++ b/Source/WebKit2/Shared/WebPageCreationParameters.cpp @@ -51,6 +51,7 @@ void WebPageCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) const encoder->encode(highestUsedBackForwardItemID); encoder->encode(canRunBeforeUnloadConfirmPanel); encoder->encode(canRunModal); + encoder->encode(userSpaceScaleFactor); #if PLATFORM(MAC) encoder->encode(isSmartInsertDeleteEnabled); @@ -99,6 +100,8 @@ bool WebPageCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, WebPag return false; if (!decoder->decode(parameters.canRunModal)) return false; + if (!decoder->decode(parameters.userSpaceScaleFactor)) + return false; #if PLATFORM(MAC) if (!decoder->decode(parameters.isSmartInsertDeleteEnabled)) diff --git a/Source/WebKit2/Shared/WebPageCreationParameters.h b/Source/WebKit2/Shared/WebPageCreationParameters.h index 31759e1..5fb152f 100644 --- a/Source/WebKit2/Shared/WebPageCreationParameters.h +++ b/Source/WebKit2/Shared/WebPageCreationParameters.h @@ -71,6 +71,8 @@ struct WebPageCreationParameters { bool canRunBeforeUnloadConfirmPanel; bool canRunModal; + float userSpaceScaleFactor; + #if PLATFORM(MAC) bool isSmartInsertDeleteEnabled; #endif diff --git a/Source/WebKit2/Shared/WebPreferencesStore.cpp b/Source/WebKit2/Shared/WebPreferencesStore.cpp index c215782..c072740 100644 --- a/Source/WebKit2/Shared/WebPreferencesStore.cpp +++ b/Source/WebKit2/Shared/WebPreferencesStore.cpp @@ -49,6 +49,8 @@ namespace WebPreferencesKey { static bool hasXSSAuditorEnabledTestRunnerOverride; static bool xssAuditorEnabledTestRunnerOverride; +static bool hasAllowUniversalAccessFromFileURLsTestRunnerOverride; +static bool allowUniversalAccessFromFileURLsTestRunnerOverride; WebPreferencesStore::WebPreferencesStore() { @@ -67,6 +69,9 @@ bool WebPreferencesStore::decode(CoreIPC::ArgumentDecoder* decoder, WebPreferenc if (hasXSSAuditorEnabledTestRunnerOverride) s.m_boolValues.set(WebPreferencesKey::xssAuditorEnabledKey(), xssAuditorEnabledTestRunnerOverride); + if (hasAllowUniversalAccessFromFileURLsTestRunnerOverride) + s.m_boolValues.set(WebPreferencesKey::allowUniversalAccessFromFileURLsKey(), allowUniversalAccessFromFileURLsTestRunnerOverride); + return true; } @@ -76,6 +81,12 @@ void WebPreferencesStore::overrideXSSAuditorEnabledForTestRunner(bool enabled) xssAuditorEnabledTestRunnerOverride = enabled; } +void WebPreferencesStore::overrideAllowUniversalAccessFromFileURLsForTestRunner(bool enabled) +{ + hasAllowUniversalAccessFromFileURLsTestRunnerOverride = true; + allowUniversalAccessFromFileURLsTestRunnerOverride = enabled; +} + void WebPreferencesStore::removeTestRunnerOverrides() { hasXSSAuditorEnabledTestRunnerOverride = false; diff --git a/Source/WebKit2/Shared/WebPreferencesStore.h b/Source/WebKit2/Shared/WebPreferencesStore.h index f00a90e..43ef487 100644 --- a/Source/WebKit2/Shared/WebPreferencesStore.h +++ b/Source/WebKit2/Shared/WebPreferencesStore.h @@ -54,6 +54,7 @@ namespace WebKit { macro(NeedsSiteSpecificQuirks, needsSiteSpecificQuirks, Bool, bool, false) \ macro(AcceleratedCompositingEnabled, acceleratedCompositingEnabled, Bool, bool, true) \ macro(AcceleratedDrawingEnabled, acceleratedDrawingEnabled, Bool, bool, false) \ + macro(CanvasUsesAcceleratedDrawing, canvasUsesAcceleratedDrawing, Bool, bool, true) \ macro(CompositingBordersVisible, compositingBordersVisible, Bool, bool, false) \ macro(CompositingRepaintCountersVisible, compositingRepaintCountersVisible, Bool, bool, false) \ macro(WebGLEnabled, webGLEnabled, Bool, bool, false) \ @@ -68,6 +69,10 @@ namespace WebKit { macro(DOMPasteAllowed, domPasteAllowed, Bool, bool, false) \ macro(JavaScriptCanAccessClipboard, javaScriptCanAccessClipboard, Bool, bool, false) \ macro(ShouldPrintBackgrounds, shouldPrintBackgrounds, Bool, bool, false) \ + macro(FullScreenEnabled, fullScreenEnabled, Bool, bool, true) \ + macro(WebSecurityEnabled, webSecurityEnabled, Bool, bool, true) \ + macro(AllowUniversalAccessFromFileURLs, allowUniversalAccessFromFileURLs, Bool, bool, false) \ + macro(AllowFileAccessFromFileURLs, allowFileAccessFromFileURLs, Bool, bool, false) \ \ #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \ @@ -163,6 +168,7 @@ struct WebPreferencesStore { double getDoubleValueForKey(const String& key) const; static void overrideXSSAuditorEnabledForTestRunner(bool); + static void overrideAllowUniversalAccessFromFileURLsForTestRunner(bool); static void removeTestRunnerOverrides(); HashMap<String, String> m_stringValues; diff --git a/Source/WebKit2/Shared/WebProcessCreationParameters.cpp b/Source/WebKit2/Shared/WebProcessCreationParameters.cpp index 360c6d7..db3cd4c 100644 --- a/Source/WebKit2/Shared/WebProcessCreationParameters.cpp +++ b/Source/WebKit2/Shared/WebProcessCreationParameters.cpp @@ -51,6 +51,7 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) con encoder->encode(injectedBundlePathExtensionHandle); encoder->encode(applicationCacheDirectory); encoder->encode(databaseDirectory); + encoder->encode(localStorageDirectory); encoder->encode(urlSchemesRegistererdAsEmptyDocument); encoder->encode(urlSchemesRegisteredAsSecure); encoder->encode(urlSchemesForWhichDomainRelaxationIsForbidden); @@ -60,6 +61,7 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) con encoder->encode(clearResourceCaches); encoder->encode(clearApplicationCache); encoder->encode(shouldAlwaysUseComplexTextCodePath); + encoder->encode(iconDatabaseEnabled); encoder->encode(languageCode); encoder->encode(textCheckerState); encoder->encode(defaultRequestTimeoutInterval); @@ -79,6 +81,7 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) con encoder->encode(cfURLCachePath); encoder->encode(cfURLCacheDiskCapacity); encoder->encode(cfURLCacheMemoryCapacity); + encoder->encode(initialHTTPCookieAcceptPolicy); #endif } @@ -92,6 +95,8 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web return false; if (!decoder->decode(parameters.databaseDirectory)) return false; + if (!decoder->decode(parameters.localStorageDirectory)) + return false; if (!decoder->decode(parameters.urlSchemesRegistererdAsEmptyDocument)) return false; if (!decoder->decode(parameters.urlSchemesRegisteredAsSecure)) @@ -110,6 +115,8 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web return false; if (!decoder->decode(parameters.shouldAlwaysUseComplexTextCodePath)) return false; + if (!decoder->decode(parameters.iconDatabaseEnabled)) + return false; if (!decoder->decode(parameters.languageCode)) return false; if (!decoder->decode(parameters.textCheckerState)) @@ -145,6 +152,8 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web return false; if (!decoder->decode(parameters.cfURLCacheMemoryCapacity)) return false; + if (!decoder->decode(parameters.initialHTTPCookieAcceptPolicy)) + return false; #endif return true; diff --git a/Source/WebKit2/Shared/WebProcessCreationParameters.h b/Source/WebKit2/Shared/WebProcessCreationParameters.h index a57be99..112d6eb 100644 --- a/Source/WebKit2/Shared/WebProcessCreationParameters.h +++ b/Source/WebKit2/Shared/WebProcessCreationParameters.h @@ -54,6 +54,7 @@ struct WebProcessCreationParameters { String applicationCacheDirectory; String databaseDirectory; + String localStorageDirectory; Vector<String> urlSchemesRegistererdAsEmptyDocument; Vector<String> urlSchemesRegisteredAsSecure; Vector<String> urlSchemesForWhichDomainRelaxationIsForbidden; @@ -69,6 +70,8 @@ struct WebProcessCreationParameters { bool shouldAlwaysUseComplexTextCodePath; + bool iconDatabaseEnabled; + String languageCode; TextCheckerState textCheckerState; @@ -97,6 +100,8 @@ struct WebProcessCreationParameters { uint64_t cfURLCacheDiskCapacity; uint64_t cfURLCacheMemoryCapacity; + uint32_t initialHTTPCookieAcceptPolicy; + bool shouldPaintNativeControls; #endif }; diff --git a/Source/WebKit2/Shared/WebString.h b/Source/WebKit2/Shared/WebString.h index a77293b..6827276 100644 --- a/Source/WebKit2/Shared/WebString.h +++ b/Source/WebKit2/Shared/WebString.h @@ -74,6 +74,7 @@ public: bool equal(WebString* other) { return m_string == other->m_string; } bool equalToUTF8String(const char* other) { return m_string == String::fromUTF8(other); } + bool equalToUTF8StringIgnoringCase(const char* other) { return equalIgnoringCase(m_string, other); } const String& string() const { return m_string; } diff --git a/Source/WebKit2/Shared/WebURL.h b/Source/WebKit2/Shared/WebURL.h index 1b0826b..14bd99f 100644 --- a/Source/WebKit2/Shared/WebURL.h +++ b/Source/WebKit2/Shared/WebURL.h @@ -27,6 +27,9 @@ #define WebURL_h #include "APIObject.h" +#include <WebCore/KURL.h> +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> #include <wtf/text/WTFString.h> @@ -48,15 +51,35 @@ public: const String& string() const { return m_string; } + String host() const + { + parseURLIfNecessary(); + return m_parsedURL->isValid() ? m_parsedURL->host() : String(); + } + + String protocol() const + { + parseURLIfNecessary(); + return m_parsedURL->isValid() ? m_parsedURL->protocol() : String(); + } + private: WebURL(const String& string) : m_string(string) { } + void parseURLIfNecessary() const + { + if (m_parsedURL) + return; + m_parsedURL = WTF::adoptPtr(new WebCore::KURL(WebCore::KURL(), m_string)); + } + virtual Type type() const { return APIType; } String m_string; + mutable OwnPtr<WebCore::KURL> m_parsedURL; }; } // namespace WebKit diff --git a/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp b/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp index 936b6b3..c762d5b 100644 --- a/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp +++ b/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp @@ -48,6 +48,9 @@ enum CFType { CFNumber, CFString, CFURL, +#if PLATFORM(MAC) + SecCertificate, +#endif Null, Unknown, }; @@ -76,6 +79,10 @@ static CFType typeFromCFTypeRef(CFTypeRef type) return CFString; if (typeID == CFURLGetTypeID()) return CFURL; +#if PLATFORM(MAC) + if (typeID == SecCertificateGetTypeID()) + return SecCertificate; +#endif ASSERT_NOT_REACHED(); return Unknown; @@ -110,6 +117,11 @@ static void encode(ArgumentEncoder* encoder, CFTypeRef typeRef) case CFURL: encode(encoder, static_cast<CFURLRef>(typeRef)); return; +#if PLATFORM(MAC) + case SecCertificate: + encode(encoder, (SecCertificateRef)typeRef); + return; +#endif case Null: return; case Unknown: @@ -178,6 +190,15 @@ static bool decode(ArgumentDecoder* decoder, RetainPtr<CFTypeRef>& result) result.adoptCF(url.leakRef()); return true; } +#if PLATFORM(MAC) + case SecCertificate: { + RetainPtr<SecCertificateRef> certificate; + if (!decode(decoder, certificate)) + return false; + result.adoptCF(certificate.leakRef()); + return true; + } +#endif case Null: result = tokenNullTypeRef(); return true; @@ -459,5 +480,22 @@ bool decode(ArgumentDecoder* decoder, RetainPtr<CFURLRef>& result) return true; } -} // namespace CoreIPC +#if PLATFORM(MAC) +void encode(ArgumentEncoder* encoder, SecCertificateRef certificate) +{ + RetainPtr<CFDataRef> data(AdoptCF, SecCertificateCopyData(certificate)); + encode(encoder, data.get()); +} +bool decode(ArgumentDecoder* decoder, RetainPtr<SecCertificateRef>& result) +{ + RetainPtr<CFDataRef> data; + if (!decode(decoder, data)) + return false; + + result.adoptCF(SecCertificateCreateWithData(0, data.get())); + return true; +} +#endif + +} // namespace CoreIPC diff --git a/Source/WebKit2/Shared/cf/ArgumentCodersCF.h b/Source/WebKit2/Shared/cf/ArgumentCodersCF.h index 4caec5f..291a093 100644 --- a/Source/WebKit2/Shared/cf/ArgumentCodersCF.h +++ b/Source/WebKit2/Shared/cf/ArgumentCodersCF.h @@ -28,6 +28,10 @@ #include <wtf/RetainPtr.h> +#if PLATFORM(MAC) +#include <Security/SecCertificate.h> +#endif + namespace CoreIPC { class ArgumentEncoder; @@ -61,6 +65,12 @@ bool decode(ArgumentDecoder*, RetainPtr<CFStringRef>& result); void encode(ArgumentEncoder*, CFURLRef); bool decode(ArgumentDecoder*, RetainPtr<CFURLRef>& result); +#if PLATFORM(MAC) +// SecCertificateRef +void encode(ArgumentEncoder*, SecCertificateRef); +bool decode(ArgumentDecoder*, RetainPtr<SecCertificateRef>& result); +#endif + CFTypeRef tokenNullTypeRef(); } // namespace CoreIPC diff --git a/Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp b/Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp index 28ba7ea..6bcc108 100644 --- a/Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp +++ b/Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp @@ -34,14 +34,26 @@ using namespace WebCore; namespace WebKit { +static CGBitmapInfo bitmapInfo(ShareableBitmap::Flags flags) +{ + CGBitmapInfo info = kCGBitmapByteOrder32Host; + if (flags & ShareableBitmap::SupportsAlpha) + info |= kCGImageAlphaPremultipliedFirst; + else + info |= kCGImageAlphaNoneSkipFirst; + + return info; +} + PassOwnPtr<GraphicsContext> ShareableBitmap::createGraphicsContext() { RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); - ref(); // Balanced by deref in releaseData. + + ref(); // Balanced by deref in releaseBitmapContextData. RetainPtr<CGContextRef> bitmapContext(AdoptCF, CGBitmapContextCreateWithData(data(), m_size.width(), m_size.height(), 8, m_size.width() * 4, colorSpace.get(), - kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, releaseData, this)); + bitmapInfo(m_flags), releaseBitmapContextData, this)); // We want the origin to be in the top left corner so we flip the backing store context. CGContextTranslateCTM(bitmapContext.get(), 0, m_size.height()); @@ -52,14 +64,38 @@ PassOwnPtr<GraphicsContext> ShareableBitmap::createGraphicsContext() void ShareableBitmap::paint(WebCore::GraphicsContext& context, const IntPoint& dstPoint, const IntRect& srcRect) { - paintBitmapContext(context.platformContext(), createGraphicsContext()->platformContext(), dstPoint, srcRect); + paintImage(context.platformContext(), makeCGImageCopy().get(), dstPoint, srcRect); +} + +RetainPtr<CGImageRef> ShareableBitmap::makeCGImageCopy() +{ + OwnPtr<GraphicsContext> graphicsContext = createGraphicsContext(); + RetainPtr<CGImageRef> image(AdoptCF, CGBitmapContextCreateImage(graphicsContext->platformContext())); + return image; +} + +RetainPtr<CGImageRef> ShareableBitmap::makeCGImage() +{ + ref(); // Balanced by deref in releaseDataProviderData. + RetainPtr<CGDataProvider> dataProvider(AdoptCF, CGDataProviderCreateWithData(this, data(), sizeInBytes(), releaseDataProviderData)); + + RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); + RetainPtr<CGImageRef> image(AdoptCF, CGImageCreate(m_size.width(), m_size.height(), 8, 32, m_size.width() * 4, colorSpace.get(), bitmapInfo(m_flags), dataProvider.get(), 0, false, kCGRenderingIntentDefault)); + return image; } -void ShareableBitmap::releaseData(void* typelessBitmap, void* typelessData) +void ShareableBitmap::releaseBitmapContextData(void* typelessBitmap, void* typelessData) { ShareableBitmap* bitmap = static_cast<ShareableBitmap*>(typelessBitmap); ASSERT_UNUSED(typelessData, bitmap->data() == typelessData); bitmap->deref(); // Balanced by ref in createGraphicsContext. } +void ShareableBitmap::releaseDataProviderData(void* typelessBitmap, const void* typelessData, size_t) +{ + ShareableBitmap* bitmap = static_cast<ShareableBitmap*>(typelessBitmap); + ASSERT_UNUSED(typelessData, bitmap->data() == typelessData); + bitmap->deref(); // Balanced by ref in createCGImage. +} + } // namespace WebKit diff --git a/Source/WebKit2/Shared/cg/WebCoreArgumentCodersCG.cpp b/Source/WebKit2/Shared/cg/WebCoreArgumentCodersCG.cpp index 058cf51..fb1395f 100644 --- a/Source/WebKit2/Shared/cg/WebCoreArgumentCodersCG.cpp +++ b/Source/WebKit2/Shared/cg/WebCoreArgumentCodersCG.cpp @@ -36,7 +36,7 @@ namespace CoreIPC { RefPtr<Image> createImage(ShareableBitmap* bitmap) { - RetainPtr<CGImageRef> platformImage(AdoptCF, CGBitmapContextCreateImage(bitmap->createGraphicsContext()->platformContext())); + RetainPtr<CGImageRef> platformImage = bitmap->makeCGImage(); if (!platformImage) return 0; // BitmapImage::create adopts the CGImageRef that's passed in, which is why we need to leakRef here. diff --git a/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp b/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp index 2770a3f..73527ce 100644 --- a/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp +++ b/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp @@ -39,7 +39,12 @@ void encodeResourceRequest(ArgumentEncoder* encoder, const WebCore::ResourceRequ bool decodeResourceRequest(ArgumentDecoder* decoder, WebCore::ResourceRequest& resourceRequest) { notImplemented(); - return false; + + // FIXME: Add real implementation when we want to implement something that + // depends on this like the policy client. + // https://bugs.webkit.org/show_bug.cgi?id=55934 + resourceRequest = WebCore::ResourceRequest(); + return true; } void encodeResourceResponse(ArgumentEncoder* encoder, const WebCore::ResourceResponse& resourceResponse) @@ -50,7 +55,27 @@ void encodeResourceResponse(ArgumentEncoder* encoder, const WebCore::ResourceRes bool decodeResourceResponse(ArgumentDecoder* decoder, WebCore::ResourceResponse& resourceResponse) { notImplemented(); - return false; + + // FIXME: Ditto. + resourceResponse = WebCore::ResourceResponse(); + return true; +} + +void encodeResourceError(ArgumentEncoder* encoder, const WebCore::ResourceError& resourceError) +{ + encoder->encode(CoreIPC::In(resourceError.domain(), resourceError.errorCode(), resourceError.failingURL(), resourceError.localizedDescription())); +} + +bool decodeResourceError(ArgumentDecoder* decoder, WebCore::ResourceError& resourceError) +{ + String domain; + int errorCode; + String failingURL; + String localizedDescription; + if (!decoder->decode(CoreIPC::Out(domain, errorCode, failingURL, localizedDescription))) + return false; + resourceError = WebCore::ResourceError(domain, errorCode, failingURL, localizedDescription); + return true; } } diff --git a/Source/WebKit2/Shared/gtk/WebEventFactory.cpp b/Source/WebKit2/Shared/gtk/WebEventFactory.cpp index a9acbb3..d8f8b46 100644 --- a/Source/WebKit2/Shared/gtk/WebEventFactory.cpp +++ b/Source/WebKit2/Shared/gtk/WebEventFactory.cpp @@ -28,6 +28,7 @@ #include "config.h" #include "WebEventFactory.h" +#include "GtkVersioning.h" #include "PlatformKeyboardEvent.h" #include "Scrollbar.h" #include "WindowsKeyboardCodes.h" @@ -41,7 +42,7 @@ namespace WebKit { static inline bool isGdkKeyCodeFromKeyPad(unsigned keyval) { - return keyval >= GDK_KEY_KP_Space && keyval <= GDK_KEY_KP_9; + return keyval >= GDK_KP_Space && keyval <= GDK_KP_9; } static inline WebEvent::Modifiers modifiersForEvent(const GdkEvent* event) diff --git a/Source/WebKit2/Shared/mac/PlatformCertificateInfo.h b/Source/WebKit2/Shared/mac/PlatformCertificateInfo.h index be7eb36..7ef5b37 100644 --- a/Source/WebKit2/Shared/mac/PlatformCertificateInfo.h +++ b/Source/WebKit2/Shared/mac/PlatformCertificateInfo.h @@ -40,6 +40,7 @@ class PlatformCertificateInfo { public: PlatformCertificateInfo(); explicit PlatformCertificateInfo(const WebCore::ResourceResponse&); + explicit PlatformCertificateInfo(CFArrayRef certificateChain); CFArrayRef certificateChain() const { return m_certificateChain.get(); } diff --git a/Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm b/Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm index 0c0b737..5ae772c 100644 --- a/Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm +++ b/Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm @@ -26,10 +26,10 @@ #import "config.h" #import "PlatformCertificateInfo.h" +#import "ArgumentCodersCF.h" #import "ArgumentDecoder.h" #import "ArgumentEncoder.h" #import <WebKitSystemInterface.h> -#import <Security/Security.h> using namespace WebCore; @@ -44,47 +44,34 @@ PlatformCertificateInfo::PlatformCertificateInfo(const ResourceResponse& respons { } +PlatformCertificateInfo::PlatformCertificateInfo(CFArrayRef certificateChain) + : m_certificateChain(certificateChain) +{ +} + void PlatformCertificateInfo::encode(CoreIPC::ArgumentEncoder* encoder) const { - // Special case no certificates, if (!m_certificateChain) { - encoder->encodeUInt64(std::numeric_limits<uint64_t>::max()); + encoder->encodeBool(false); return; } - uint64_t length = CFArrayGetCount(m_certificateChain.get()); - encoder->encodeUInt64(length); - - for (size_t i = 0; i < length; ++i) { - RetainPtr<CFDataRef> data(AdoptCF, SecCertificateCopyData((SecCertificateRef)CFArrayGetValueAtIndex(m_certificateChain.get(), i))); - encoder->encodeBytes(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get())); - } + encoder->encodeBool(true); + CoreIPC::encode(encoder, m_certificateChain.get()); } bool PlatformCertificateInfo::decode(CoreIPC::ArgumentDecoder* decoder, PlatformCertificateInfo& c) { - uint64_t length; - if (!decoder->decode(length)) + bool hasCertificateChain; + if (!decoder->decode(hasCertificateChain)) return false; - if (length == std::numeric_limits<uint64_t>::max()) { - // This is the no certificates case. + if (!hasCertificateChain) return true; - } - - RetainPtr<CFMutableArrayRef> array(AdoptCF, CFArrayCreateMutable(0, length, &kCFTypeArrayCallBacks)); - - for (size_t i = 0; i < length; ++i) { - Vector<uint8_t> bytes; - if (!decoder->decodeBytes(bytes)) - return false; - RetainPtr<CFDataRef> data(AdoptCF, CFDataCreateWithBytesNoCopy(0, bytes.data(), bytes.size(), kCFAllocatorNull)); - RetainPtr<SecCertificateRef> certificate(AdoptCF, SecCertificateCreateWithData(0, data.get())); - CFArrayAppendValue(array.get(), certificate.get()); - } + if (!CoreIPC::decode(decoder, c.m_certificateChain)) + return false; - c.m_certificateChain = array; return true; } diff --git a/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm b/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm index a12e566..321cb40 100644 --- a/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm +++ b/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm @@ -27,11 +27,15 @@ #import "WebCoreArgumentCoders.h" #import "ArgumentCodersCF.h" +#import "PlatformCertificateInfo.h" #import "WebKitSystemInterface.h" +using namespace WebCore; +using namespace WebKit; + namespace CoreIPC { -void encodeResourceRequest(ArgumentEncoder* encoder, const WebCore::ResourceRequest& resourceRequest) +void encodeResourceRequest(ArgumentEncoder* encoder, const ResourceRequest& resourceRequest) { bool requestIsPresent = resourceRequest.nsURLRequest(); encoder->encode(requestIsPresent); @@ -43,14 +47,14 @@ void encodeResourceRequest(ArgumentEncoder* encoder, const WebCore::ResourceRequ encode(encoder, dictionary.get()); } -bool decodeResourceRequest(ArgumentDecoder* decoder, WebCore::ResourceRequest& resourceRequest) +bool decodeResourceRequest(ArgumentDecoder* decoder, ResourceRequest& resourceRequest) { bool requestIsPresent; if (!decoder->decode(requestIsPresent)) return false; if (!requestIsPresent) { - resourceRequest = WebCore::ResourceRequest(); + resourceRequest = ResourceRequest(); return true; } @@ -62,11 +66,11 @@ bool decodeResourceRequest(ArgumentDecoder* decoder, WebCore::ResourceRequest& r if (!nsURLRequest) return false; - resourceRequest = WebCore::ResourceRequest(nsURLRequest); + resourceRequest = ResourceRequest(nsURLRequest); return true; } -void encodeResourceResponse(ArgumentEncoder* encoder, const WebCore::ResourceResponse& resourceResponse) +void encodeResourceResponse(ArgumentEncoder* encoder, const ResourceResponse& resourceResponse) { bool responseIsPresent = resourceResponse.nsURLResponse(); encoder->encode(responseIsPresent); @@ -78,14 +82,14 @@ void encodeResourceResponse(ArgumentEncoder* encoder, const WebCore::ResourceRes encode(encoder, dictionary.get()); } -bool decodeResourceResponse(ArgumentDecoder* decoder, WebCore::ResourceResponse& resourceResponse) +bool decodeResourceResponse(ArgumentDecoder* decoder, ResourceResponse& resourceResponse) { bool responseIsPresent; if (!decoder->decode(responseIsPresent)) return false; if (!responseIsPresent) { - resourceResponse = WebCore::ResourceResponse(); + resourceResponse = ResourceResponse(); return true; } @@ -97,7 +101,93 @@ bool decodeResourceResponse(ArgumentDecoder* decoder, WebCore::ResourceResponse& if (!nsURLResponse) return false; - resourceResponse = WebCore::ResourceResponse(nsURLResponse); + resourceResponse = ResourceResponse(nsURLResponse); + return true; +} + +static NSString* nsString(const String& string) +{ + return string.impl() ? [NSString stringWithCharacters:reinterpret_cast<const UniChar*>(string.characters()) length:string.length()] : @""; +} + +void encodeResourceError(ArgumentEncoder* encoder, const ResourceError& resourceError) +{ + bool errorIsNull = resourceError.isNull(); + encoder->encode(errorIsNull); + + if (errorIsNull) + return; + + NSError *nsError = resourceError.nsError(); + + String domain = [nsError domain]; + encoder->encode(domain); + + int64_t code = [nsError code]; + encoder->encode(code); + + HashMap<String, String> stringUserInfoMap; + + NSDictionary* userInfo = [nsError userInfo]; + for (NSString *key in userInfo) { + id value = [userInfo objectForKey:key]; + if (![value isKindOfClass:[NSString class]]) + continue; + + stringUserInfoMap.set(key, (NSString *)value); + continue; + } + encoder->encode(stringUserInfoMap); + + id peerCertificateChain = [userInfo objectForKey:@"NSErrorPeerCertificateChainKey"]; + ASSERT(!peerCertificateChain || [peerCertificateChain isKindOfClass:[NSArray class]]); + encoder->encode(PlatformCertificateInfo((CFArrayRef)peerCertificateChain)); +} + +bool decodeResourceError(ArgumentDecoder* decoder, ResourceError& resourceError) +{ + bool errorIsNull; + if (!decoder->decode(errorIsNull)) + return false; + + if (errorIsNull) { + resourceError = ResourceError(); + return true; + } + + String domain; + if (!decoder->decode(domain)) + return false; + + int64_t code; + if (!decoder->decode(code)) + return false; + + HashMap<String, String> stringUserInfoMap; + if (!decoder->decode(stringUserInfoMap)) + return false; + + PlatformCertificateInfo certificate; + if (!decoder->decode(certificate)) + return false; + + NSUInteger userInfoSize = stringUserInfoMap.size(); + if (certificate.certificateChain()) + userInfoSize++; + + NSMutableDictionary* userInfo = [NSMutableDictionary dictionaryWithCapacity:userInfoSize]; + + HashMap<String, String>::const_iterator it = stringUserInfoMap.begin(); + HashMap<String, String>::const_iterator end = stringUserInfoMap.end(); + for (; it != end; ++it) + [userInfo setObject:nsString(it->second) forKey:nsString(it->first)]; + + if (certificate.certificateChain()) + [userInfo setObject:(NSArray *)certificate.certificateChain() forKey:@"NSErrorPeerCertificateChainKey"]; + + NSError *nsError = [[NSError alloc] initWithDomain:nsString(domain) code:code userInfo:userInfo]; + + resourceError = ResourceError(nsError); return true; } diff --git a/Source/WebKit2/Shared/mac/WebEventFactory.mm b/Source/WebKit2/Shared/mac/WebEventFactory.mm index 8f02f6b..67ab1ba 100644 --- a/Source/WebKit2/Shared/mac/WebEventFactory.mm +++ b/Source/WebKit2/Shared/mac/WebEventFactory.mm @@ -34,6 +34,18 @@ using namespace WebCore; namespace WebKit { +static WebMouseEvent::Button currentMouseButton() +{ + NSUInteger pressedMouseButtons = [NSEvent pressedMouseButtons]; + if (!pressedMouseButtons) + return WebMouseEvent::NoButton; + if (pressedMouseButtons == 1 << 0) + return WebMouseEvent::LeftButton; + if (pressedMouseButtons == 1 << 1) + return WebMouseEvent::RightButton; + return WebMouseEvent::MiddleButton; +} + static WebMouseEvent::Button mouseButtonForEvent(NSEvent *event) { switch ([event type]) { @@ -49,6 +61,9 @@ static WebMouseEvent::Button mouseButtonForEvent(NSEvent *event) case NSOtherMouseUp: case NSOtherMouseDragged: return WebMouseEvent::MiddleButton; + case NSMouseEntered: + case NSMouseExited: + return currentMouseButton(); default: return WebMouseEvent::NoButton; } diff --git a/Source/WebKit2/Shared/qt/WebCoreArgumentCodersQt.cpp b/Source/WebKit2/Shared/qt/WebCoreArgumentCodersQt.cpp index a5d5f12..8377923 100644 --- a/Source/WebKit2/Shared/qt/WebCoreArgumentCodersQt.cpp +++ b/Source/WebKit2/Shared/qt/WebCoreArgumentCodersQt.cpp @@ -60,4 +60,21 @@ bool decodeResourceResponse(ArgumentDecoder* decoder, WebCore::ResourceResponse& return true; } +void encodeResourceError(ArgumentEncoder* encoder, const WebCore::ResourceError& resourceError) +{ + encoder->encode(CoreIPC::In(resourceError.domain(), resourceError.errorCode(), resourceError.failingURL(), resourceError.localizedDescription())); +} + +bool decodeResourceError(ArgumentDecoder* decoder, WebCore::ResourceError& resourceError) +{ + String domain; + int errorCode; + String failingURL; + String localizedDescription; + if (!decoder->decode(CoreIPC::Out(domain, errorCode, failingURL, localizedDescription))) + return false; + resourceError = WebCore::ResourceError(domain, errorCode, failingURL, localizedDescription); + return true; +} + } // namespace CoreIPC diff --git a/Source/WebKit2/Shared/win/PlatformCertificateInfo.cpp b/Source/WebKit2/Shared/win/PlatformCertificateInfo.cpp index ade2291..0d1ca36 100644 --- a/Source/WebKit2/Shared/win/PlatformCertificateInfo.cpp +++ b/Source/WebKit2/Shared/win/PlatformCertificateInfo.cpp @@ -65,14 +65,23 @@ PlatformCertificateInfo::PlatformCertificateInfo(const ResourceResponse& respons PCERT_SIMPLE_CHAIN firstSimpleChain = chainContext->rgpChain[0]; for (unsigned i = 0; i < firstSimpleChain->cElement; ++i) { PCCERT_CONTEXT certificateContext = firstSimpleChain->rgpElement[i]->pCertContext; - ::CertDuplicateCertificateContext(certificateContext); - m_certificateChain.append(certificateContext); + PCCERT_CONTEXT certificateContextCopy = ::CertDuplicateCertificateContext(certificateContext); + m_certificateChain.append(certificateContextCopy); } #else // FIXME: WinCairo implementation #endif } +PlatformCertificateInfo::PlatformCertificateInfo(PCCERT_CONTEXT certificateContext) +{ + if (!certificateContext) + return; + + PCCERT_CONTEXT certificateContextCopy = ::CertDuplicateCertificateContext(certificateContext); + m_certificateChain.append(certificateContextCopy); +} + PlatformCertificateInfo::~PlatformCertificateInfo() { clearCertificateChain(); @@ -81,8 +90,8 @@ PlatformCertificateInfo::~PlatformCertificateInfo() PlatformCertificateInfo::PlatformCertificateInfo(const PlatformCertificateInfo& other) { for (size_t i = 0; i < other.m_certificateChain.size(); ++i) { - ::CertDuplicateCertificateContext(other.m_certificateChain[i]); - m_certificateChain.append(other.m_certificateChain[i]); + PCCERT_CONTEXT certificateContextCopy = ::CertDuplicateCertificateContext(other.m_certificateChain[i]); + m_certificateChain.append(certificateContextCopy); } } @@ -90,8 +99,8 @@ PlatformCertificateInfo& PlatformCertificateInfo::operator=(const PlatformCertif { clearCertificateChain(); for (size_t i = 0; i < other.m_certificateChain.size(); ++i) { - ::CertDuplicateCertificateContext(other.m_certificateChain[i]); - m_certificateChain.append(other.m_certificateChain[i]); + PCCERT_CONTEXT certificateContextCopy = ::CertDuplicateCertificateContext(other.m_certificateChain[i]); + m_certificateChain.append(certificateContextCopy); } return *this; } diff --git a/Source/WebKit2/Shared/win/PlatformCertificateInfo.h b/Source/WebKit2/Shared/win/PlatformCertificateInfo.h index e483d37..dd999ef 100644 --- a/Source/WebKit2/Shared/win/PlatformCertificateInfo.h +++ b/Source/WebKit2/Shared/win/PlatformCertificateInfo.h @@ -43,6 +43,7 @@ class PlatformCertificateInfo { public: PlatformCertificateInfo(); explicit PlatformCertificateInfo(const WebCore::ResourceResponse&); + explicit PlatformCertificateInfo(PCCERT_CONTEXT); ~PlatformCertificateInfo(); PlatformCertificateInfo(const PlatformCertificateInfo&); diff --git a/Source/WebKit2/Shared/win/WebCoreArgumentCodersWin.cpp b/Source/WebKit2/Shared/win/WebCoreArgumentCodersWin.cpp index 9513e90..d659ac4 100644 --- a/Source/WebKit2/Shared/win/WebCoreArgumentCodersWin.cpp +++ b/Source/WebKit2/Shared/win/WebCoreArgumentCodersWin.cpp @@ -28,6 +28,8 @@ #if USE(CFNETWORK) #include "ArgumentCodersCF.h" +#include "PlatformCertificateInfo.h" +#include <WebCore/CertificateCFWin.h> #include <WebKitSystemInterface/WebKitSystemInterface.h> #endif @@ -117,4 +119,39 @@ bool decodeResourceResponse(ArgumentDecoder* decoder, WebCore::ResourceResponse& #endif } +void encodeResourceError(ArgumentEncoder* encoder, const WebCore::ResourceError& resourceError) +{ + encoder->encode(CoreIPC::In(resourceError.domain(), resourceError.errorCode(), resourceError.failingURL(), resourceError.localizedDescription())); + +#if USE(CFNETWORK) + encoder->encode(WebKit::PlatformCertificateInfo(resourceError.certificate())); +#endif +} + +bool decodeResourceError(ArgumentDecoder* decoder, WebCore::ResourceError& resourceError) +{ + String domain; + int errorCode; + String failingURL; + String localizedDescription; + if (!decoder->decode(CoreIPC::Out(domain, errorCode, failingURL, localizedDescription))) + return false; + +#if USE(CFNETWORK) + WebKit::PlatformCertificateInfo certificate; + if (!decoder->decode(certificate)) + return false; + + const Vector<PCCERT_CONTEXT> certificateChain = certificate.certificateChain(); + if (!certificateChain.isEmpty()) { + ASSERT(certificateChain.size() == 1); + resourceError = WebCore::ResourceError(domain, errorCode, failingURL, localizedDescription, WebCore::copyCertificateToData(certificateChain.first()).get()); + return true; + } +#endif + + resourceError = WebCore::ResourceError(domain, errorCode, failingURL, localizedDescription); + return true; +} + } // namespace CoreIPC diff --git a/Source/WebKit2/UIProcess/API/C/WKAPICast.h b/Source/WebKit2/UIProcess/API/C/WKAPICast.h index a2983e9..a440c6f 100644 --- a/Source/WebKit2/UIProcess/API/C/WKAPICast.h +++ b/Source/WebKit2/UIProcess/API/C/WKAPICast.h @@ -29,12 +29,16 @@ #include "CacheModel.h" #include "FontSmoothingLevel.h" +#include "HTTPCookieAcceptPolicy.h" +#include "ResourceCachesToClear.h" #include "WKContext.h" +#include "WKCookieManager.h" #include "WKCredentialTypes.h" #include "WKPage.h" #include "WKPreferencesPrivate.h" #include "WKProtectionSpaceTypes.h" #include "WKSharedAPICast.h" +#include <WebCore/CookieJar.h> #include <WebCore/Credential.h> #include <WebCore/FrameLoaderTypes.h> #include <WebCore/ProtectionSpace.h> @@ -58,8 +62,10 @@ class WebFramePolicyListenerProxy; class WebFrameProxy; class WebGeolocationManagerProxy; class WebGeolocationPosition; +class WebIconDatabase; class WebInspectorProxy; class WebKeyValueStorageManagerProxy; +class WebMediaCacheManagerProxy; class WebNavigationData; class WebOpenPanelParameters; class WebOpenPanelResultListenerProxy; @@ -86,7 +92,9 @@ WK_ADD_API_MAPPING(WKFrameRef, WebFrameProxy) WK_ADD_API_MAPPING(WKGeolocationManagerRef, WebGeolocationManagerProxy) WK_ADD_API_MAPPING(WKGeolocationPermissionRequestRef, GeolocationPermissionRequestProxy) WK_ADD_API_MAPPING(WKGeolocationPositionRef, WebGeolocationPosition) +WK_ADD_API_MAPPING(WKIconDatabaseRef, WebIconDatabase) WK_ADD_API_MAPPING(WKKeyValueStorageManagerRef, WebKeyValueStorageManagerProxy) +WK_ADD_API_MAPPING(WKMediaCacheManagerRef, WebMediaCacheManagerProxy) WK_ADD_API_MAPPING(WKNavigationDataRef, WebNavigationData) WK_ADD_API_MAPPING(WKOpenPanelParametersRef, WebOpenPanelParameters) WK_ADD_API_MAPPING(WKOpenPanelResultListenerRef, WebOpenPanelResultListenerProxy) @@ -235,6 +243,49 @@ inline WebCore::CredentialPersistence toCredentialPersistence(WKCredentialPersis } } +inline ResourceCachesToClear toResourceCachesToClear(WKResourceCachesToClear wkResourceCachesToClear) +{ + switch (wkResourceCachesToClear) { + case kWKAllResourceCaches: + return AllResourceCaches; + case kWKInMemoryResourceCachesOnly: + return InMemoryResourceCachesOnly; + } + + ASSERT_NOT_REACHED(); + return AllResourceCaches; +} + +inline HTTPCookieAcceptPolicy toHTTPCookieAcceptPolicy(WKHTTPCookieAcceptPolicy policy) +{ + switch (policy) { + case kWKHTTPCookieAcceptPolicyAlways: + return HTTPCookieAcceptPolicyAlways; + case kWKHTTPCookieAcceptPolicyNever: + return HTTPCookieAcceptPolicyNever; + case kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain: + return HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain; + } + + ASSERT_NOT_REACHED(); + return HTTPCookieAcceptPolicyAlways; +} + +inline WKHTTPCookieAcceptPolicy toAPI(HTTPCookieAcceptPolicy policy) +{ + switch (policy) { + case HTTPCookieAcceptPolicyAlways: + return kWKHTTPCookieAcceptPolicyAlways; + case HTTPCookieAcceptPolicyNever: + return kWKHTTPCookieAcceptPolicyNever; + case HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain: + return kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain; + } + + ASSERT_NOT_REACHED(); + return kWKHTTPCookieAcceptPolicyAlways; +} + } // namespace WebKit #if defined(WIN32) || defined(_WIN32) diff --git a/Source/WebKit2/UIProcess/API/C/WKContext.cpp b/Source/WebKit2/UIProcess/API/C/WKContext.cpp index 6e4e5e0..bf196b7 100644 --- a/Source/WebKit2/UIProcess/API/C/WKContext.cpp +++ b/Source/WebKit2/UIProcess/API/C/WKContext.cpp @@ -148,9 +148,9 @@ void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef contextRef, toImpl(contextRef)->setDomainRelaxationForbiddenForURLScheme(toImpl(urlScheme)->string()); } -void WKContextClearResourceCaches(WKContextRef contextRef) +void WKContextClearResourceCaches(WKContextRef contextRef, WKResourceCachesToClear cachesToClear) { - toImpl(contextRef)->clearResourceCaches(); + toImpl(contextRef)->clearResourceCaches(toResourceCachesToClear(cachesToClear)); } void WKContextClearApplicationCache(WKContextRef contextRef) @@ -178,11 +178,21 @@ WKGeolocationManagerRef WKContextGetGeolocationManager(WKContextRef contextRef) return toAPI(toImpl(contextRef)->geolocationManagerProxy()); } +WKIconDatabaseRef WKContextGetIconDatabase(WKContextRef contextRef) +{ + return toAPI(toImpl(contextRef)->iconDatabase()); +} + WKKeyValueStorageManagerRef WKContextGetKeyValueStorageManager(WKContextRef contextRef) { return toAPI(toImpl(contextRef)->keyValueStorageManagerProxy()); } +WKMediaCacheManagerRef WKContextGetMediaCacheManager(WKContextRef contextRef) +{ + return toAPI(toImpl(contextRef)->mediaCacheManagerProxy()); +} + WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef contextRef) { return toAPI(toImpl(contextRef)->pluginSiteDataManager()); @@ -203,7 +213,17 @@ void WKContextStopMemorySampler(WKContextRef contextRef) toImpl(contextRef)->stopMemorySampler(); } +void WKContextSetIconDatabasePath(WKContextRef contextRef, WKStringRef iconDatabasePath) +{ + toImpl(contextRef)->setIconDatabasePath(toImpl(iconDatabasePath)->string()); +} + void WKContextSetDatabaseDirectory(WKContextRef contextRef, WKStringRef databaseDirectory) { toImpl(contextRef)->setDatabaseDirectory(toImpl(databaseDirectory)->string()); } + +void WKContextSetLocalStorageDirectory(WKContextRef contextRef, WKStringRef localStorageDirectory) +{ + toImpl(contextRef)->setLocalStorageDirectory(toImpl(localStorageDirectory)->string()); +} diff --git a/Source/WebKit2/UIProcess/API/C/WKContext.h b/Source/WebKit2/UIProcess/API/C/WKContext.h index f8e7cee..606574f 100644 --- a/Source/WebKit2/UIProcess/API/C/WKContext.h +++ b/Source/WebKit2/UIProcess/API/C/WKContext.h @@ -39,6 +39,12 @@ enum { }; typedef uint32_t WKCacheModel; +enum { + kWKAllResourceCaches = 0, + kWKInMemoryResourceCachesOnly = 1 +}; +typedef uint32_t WKResourceCachesToClear; + // Injected Bundle Client typedef void (*WKContextDidReceiveMessageFromInjectedBundleCallback)(WKContextRef page, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo); typedef void (*WKContextDidReceiveSynchronousMessageFromInjectedBundleCallback)(WKContextRef page, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void *clientInfo); @@ -71,6 +77,7 @@ typedef struct WKContextHistoryClient WKContextHistoryClient; // Download Client typedef void (*WKContextDownloadDidStartCallback)(WKContextRef context, WKDownloadRef download, const void *clientInfo); +typedef void (*WKContextDownloadDidReceiveAuthenticationChallengeCallback)(WKContextRef context, WKDownloadRef download, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo); typedef void (*WKContextDownloadDidReceiveResponseCallback)(WKContextRef context, WKDownloadRef download, WKURLResponseRef response, const void *clientInfo); typedef void (*WKContextDownloadDidReceiveDataCallback)(WKContextRef context, WKDownloadRef download, uint64_t length, const void *clientInfo); typedef bool (*WKContextDownloadShouldDecodeSourceDataOfMIMETypeCallback)(WKContextRef context, WKDownloadRef download, WKStringRef mimeType, const void *clientInfo); @@ -85,6 +92,7 @@ struct WKContextDownloadClient { int version; const void * clientInfo; WKContextDownloadDidStartCallback didStart; + WKContextDownloadDidReceiveAuthenticationChallengeCallback didReceiveAuthenticationChallenge; WKContextDownloadDidReceiveResponseCallback didReceiveResponse; WKContextDownloadDidReceiveDataCallback didReceiveData; WKContextDownloadShouldDecodeSourceDataOfMIMETypeCallback shouldDecodeSourceDataOfMIMEType; @@ -117,7 +125,7 @@ WK_EXPORT void WKContextAddVisitedLink(WKContextRef context, WKStringRef visited WK_EXPORT void WKContextSetCacheModel(WKContextRef context, WKCacheModel cacheModel); WK_EXPORT WKCacheModel WKContextGetCacheModel(WKContextRef context); -WK_EXPORT void WKContextClearResourceCaches(WKContextRef context); +WK_EXPORT void WKContextClearResourceCaches(WKContextRef context, WKResourceCachesToClear cachesToClear); WK_EXPORT void WKContextClearApplicationCache(WKContextRef context); WK_EXPORT void WKContextStartMemorySampler(WKContextRef context, WKDoubleRef interval); @@ -127,7 +135,9 @@ WK_EXPORT WKApplicationCacheManagerRef WKContextGetApplicationCacheManager(WKCon WK_EXPORT WKCookieManagerRef WKContextGetCookieManager(WKContextRef context); WK_EXPORT WKDatabaseManagerRef WKContextGetDatabaseManager(WKContextRef context); WK_EXPORT WKGeolocationManagerRef WKContextGetGeolocationManager(WKContextRef context); +WK_EXPORT WKIconDatabaseRef WKContextGetIconDatabase(WKContextRef context); WK_EXPORT WKKeyValueStorageManagerRef WKContextGetKeyValueStorageManager(WKContextRef context); +WK_EXPORT WKMediaCacheManagerRef WKContextGetMediaCacheManager(WKContextRef context); WK_EXPORT WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef context); WK_EXPORT WKResourceCacheManagerRef WKContextGetResourceCacheManager(WKContextRef context); diff --git a/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h b/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h index bcd24a5..5fd7dd3 100644 --- a/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h +++ b/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h @@ -54,9 +54,12 @@ WK_EXPORT void WKContextRegisterURLSchemeAsSecure(WKContextRef context, WKString WK_EXPORT void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef context, WKStringRef urlScheme); -// FIXME: This function is only effective if called before the Web process is launched. But -// we should really change this setting to be on WebPreferences and changeable at runtime. +WK_EXPORT void WKContextSetIconDatabasePath(WKContextRef context, WKStringRef iconDatabasePath); + +// FIXME: These functions are only effective if called before the Web process is launched. But +// we should really change these settings to be on WebPreferences and changeable at runtime. WK_EXPORT void WKContextSetDatabaseDirectory(WKContextRef context, WKStringRef databaseDirectory); +WK_EXPORT void WKContextSetLocalStorageDirectory(WKContextRef context, WKStringRef localStorageDirectory); #ifdef __cplusplus } diff --git a/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp b/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp index 83578f7..50e2732 100644 --- a/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp +++ b/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp @@ -58,6 +58,16 @@ void WKCookieManagerDeleteAllCookies(WKCookieManagerRef cookieManagerRef) toImpl(cookieManagerRef)->deleteAllCookies(); } +void WKCookieManagerSetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager, WKHTTPCookieAcceptPolicy policy) +{ + toImpl(cookieManager)->setHTTPCookieAcceptPolicy(toHTTPCookieAcceptPolicy(policy)); +} + +void WKCookieManagerGetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager, void* context, WKCookieManagerGetHTTPCookieAcceptPolicyFunction callback) +{ + toImpl(cookieManager)->getHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyCallback::create(context, callback)); +} + void WKCookieManagerStartObservingCookieChanges(WKCookieManagerRef cookieManager) { toImpl(cookieManager)->startObservingCookieChanges(); diff --git a/Source/WebKit2/UIProcess/API/C/WKCookieManager.h b/Source/WebKit2/UIProcess/API/C/WKCookieManager.h index 75d8ef5..4da60f4 100644 --- a/Source/WebKit2/UIProcess/API/C/WKCookieManager.h +++ b/Source/WebKit2/UIProcess/API/C/WKCookieManager.h @@ -32,6 +32,13 @@ extern "C" { #endif +enum { + kWKHTTPCookieAcceptPolicyAlways = 0, + kWKHTTPCookieAcceptPolicyNever = 1, + kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain = 2 +}; +typedef uint32_t WKHTTPCookieAcceptPolicy; + // Cookie Manager Client typedef void (*WKCookieManagerCookiesDidChangeCallback)(WKCookieManagerRef cookieManager, const void *clientInfo); @@ -52,6 +59,10 @@ WK_EXPORT void WKCookieManagerGetHostnamesWithCookies(WKCookieManagerRef cookieM WK_EXPORT void WKCookieManagerDeleteCookiesForHostname(WKCookieManagerRef cookieManager, WKStringRef hostname); WK_EXPORT void WKCookieManagerDeleteAllCookies(WKCookieManagerRef cookieManager); +WK_EXPORT void WKCookieManagerSetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager, WKHTTPCookieAcceptPolicy policy); +typedef void (*WKCookieManagerGetHTTPCookieAcceptPolicyFunction)(WKHTTPCookieAcceptPolicy, WKErrorRef, void*); +WK_EXPORT void WKCookieManagerGetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager, void* context, WKCookieManagerGetHTTPCookieAcceptPolicyFunction callback); + WK_EXPORT void WKCookieManagerStartObservingCookieChanges(WKCookieManagerRef cookieManager); WK_EXPORT void WKCookieManagerStopObservingCookieChanges(WKCookieManagerRef cookieManager); diff --git a/Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp b/Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp new file mode 100644 index 0000000..c8e87a0 --- /dev/null +++ b/Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WKIconDatabase.h" + +#include "WKAPICast.h" +#include "WebIconDatabase.h" + +using namespace WebKit; + +WKTypeID WKIconDatabaseGetTypeID() +{ + return toAPI(WebIconDatabase::APIType); +} + +void WKIconDatabaseRetainIconForURL(WKIconDatabaseRef iconDatabaseRef, WKURLRef pageURLRef) +{ + toImpl(iconDatabaseRef)->retainIconForPageURL(toWTFString(pageURLRef)); +} + +void WKIconDatabaseReleaseIconForURL(WKIconDatabaseRef iconDatabaseRef, WKURLRef pageURLRef) +{ + toImpl(iconDatabaseRef)->releaseIconForPageURL(toWTFString(pageURLRef)); +} + +void WKIconDatabaseEnableDatabaseCleanup(WKIconDatabaseRef iconDatabaseRef) +{ + toImpl(iconDatabaseRef)->enableDatabaseCleanup(); +} diff --git a/Source/WebKit2/UIProcess/API/C/WKIconDatabase.h b/Source/WebKit2/UIProcess/API/C/WKIconDatabase.h new file mode 100644 index 0000000..1ea1860 --- /dev/null +++ b/Source/WebKit2/UIProcess/API/C/WKIconDatabase.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WKIconDatabase_h +#define WKIconDatabase_h + +#include <WebKit2/WKBase.h> + +#ifdef __cplusplus +extern "C" { +#endif + +WK_EXPORT WKTypeID WKIconDatabaseGetTypeID(); + +WK_EXPORT void WKIconDatabaseRetainIconForURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL); +WK_EXPORT void WKIconDatabaseReleaseIconForURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL); +WK_EXPORT void WKIconDatabaseEnableDatabaseCleanup(WKIconDatabaseRef iconDatabase); + +#ifdef __cplusplus +} +#endif + +#endif /* WKIconDatabase_h */ diff --git a/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp b/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp new file mode 100644 index 0000000..6e2ecce --- /dev/null +++ b/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WKMediaCacheManager.h" + +#include "WKAPICast.h" +#include "WebMediaCacheManagerProxy.h" + +using namespace WebKit; + +WKTypeID WKMediaCacheManagerGetTypeID() +{ + return toAPI(WebMediaCacheManagerProxy::APIType); +} + +void WKMediaCacheManagerGetHostnamesWithMediaCache(WKMediaCacheManagerRef mediaCacheManagerRef, void* context, WKMediaCacheManagerGetHostnamesWithMediaCacheFunction callback) +{ + toImpl(mediaCacheManagerRef)->getHostnamesWithMediaCache(ArrayCallback::create(context, callback)); +} + +void WKMediaCacheManagerClearCacheForHostname(WKMediaCacheManagerRef mediaCacheManagerRef, WKStringRef hostname) +{ + toImpl(mediaCacheManagerRef)->clearCacheForHostname(toWTFString(hostname)); +} + +void WKMediaCacheManagerClearCacheForAllHostnames(WKMediaCacheManagerRef mediaCacheManagerRef) +{ + toImpl(mediaCacheManagerRef)->clearCacheForAllHostnames(); +} diff --git a/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h b/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h new file mode 100644 index 0000000..eee1b92 --- /dev/null +++ b/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WKMediaCacheManager_h +#define WKMediaCacheManager_h + +#include <WebKit2/WKBase.h> + +#ifdef __cplusplus +extern "C" { +#endif + +WK_EXPORT WKTypeID WKMediaCacheManagerGetTypeID(); + +typedef void (*WKMediaCacheManagerGetHostnamesWithMediaCacheFunction)(WKArrayRef, WKErrorRef, void*); +WK_EXPORT void WKMediaCacheManagerGetHostnamesWithMediaCache(WKMediaCacheManagerRef mediaCacheManager, void* context, WKMediaCacheManagerGetHostnamesWithMediaCacheFunction function); + +WK_EXPORT void WKMediaCacheManagerClearCacheForHostname(WKMediaCacheManagerRef mediaCacheManager, WKStringRef hostname); +WK_EXPORT void WKMediaCacheManagerClearCacheForAllHostnames(WKMediaCacheManagerRef mediaCacheManager); + +#ifdef __cplusplus +} +#endif + +#endif // WKMediaCacheManager_h diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.cpp b/Source/WebKit2/UIProcess/API/C/WKPage.cpp index c4e8eae..7061e39 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPage.cpp +++ b/Source/WebKit2/UIProcess/API/C/WKPage.cpp @@ -56,7 +56,7 @@ WKPageGroupRef WKPageGetPageGroup(WKPageRef pageRef) void WKPageLoadURL(WKPageRef pageRef, WKURLRef URLRef) { - toImpl(pageRef)->loadURL(toImpl(URLRef)->string()); + toImpl(pageRef)->loadURL(toWTFString(URLRef)); } void WKPageLoadURLRequest(WKPageRef pageRef, WKURLRequestRef urlRequestRef) diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.h b/Source/WebKit2/UIProcess/API/C/WKPage.h index 655e999..03f49f7 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPage.h +++ b/Source/WebKit2/UIProcess/API/C/WKPage.h @@ -173,6 +173,7 @@ typedef void (*WKPageDrawHeaderCallback)(WKPageRef page, WKFrameRef frame, WKRec typedef void (*WKPageDrawFooterCallback)(WKPageRef page, WKFrameRef frame, WKRect rect, const void* clientInfo); typedef void (*WKPagePrintFrameCallback)(WKPageRef page, WKFrameRef frame, const void* clientInfo); typedef void (*WKPageDidCompleteRubberBandForMainFrameCallback)(WKPageRef page, WKSize initialOverhang, const void* clientInfo); +typedef void (*WKPageSaveDataToFileInDownloadsFolderCallback)(WKPageRef page, WKStringRef suggestedFilename, WKStringRef mimeType, WKURLRef originatingURL, WKDataRef data, const void* clientInfo); struct WKPageUIClient { int version; @@ -210,6 +211,7 @@ struct WKPageUIClient { WKPagePrintFrameCallback printFrame; WKPageCallback runModal; WKPageDidCompleteRubberBandForMainFrameCallback didCompleteRubberBandForMainFrame; + WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder; }; typedef struct WKPageUIClient WKPageUIClient; diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp index 7ba9ba0..0122531 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp +++ b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp @@ -311,6 +311,16 @@ bool WKPreferencesGetAcceleratedDrawingEnabled(WKPreferencesRef preferencesRef) return toImpl(preferencesRef)->acceleratedDrawingEnabled(); } +void WKPreferencesSetCanvasUsesAcceleratedDrawing(WKPreferencesRef preferencesRef, bool flag) +{ + toImpl(preferencesRef)->setCanvasUsesAcceleratedDrawing(flag); +} + +bool WKPreferencesGetCanvasUsesAcceleratedDrawing(WKPreferencesRef preferencesRef) +{ + return toImpl(preferencesRef)->canvasUsesAcceleratedDrawing(); +} + void WKPreferencesSetAcceleratedCompositingEnabled(WKPreferencesRef preferencesRef, bool flag) { toImpl(preferencesRef)->setAcceleratedCompositingEnabled(flag); @@ -480,3 +490,43 @@ bool WKPreferencesGetJavaScriptCanAccessClipboard(WKPreferencesRef preferencesRe { return toImpl(preferencesRef)->javaScriptCanAccessClipboard(); } + +void WKPreferencesSetFullScreenEnabled(WKPreferencesRef preferencesRef, bool enabled) +{ + toImpl(preferencesRef)->setFullScreenEnabled(enabled); +} + +bool WKPreferencesGetFullScreenEnabled(WKPreferencesRef preferencesRef) +{ + return toImpl(preferencesRef)->fullScreenEnabled(); +} + +void WKPreferencesSetWebSecurityEnabled(WKPreferencesRef preferencesRef, bool enabled) +{ + toImpl(preferencesRef)->setWebSecurityEnabled(enabled); +} + +bool WKPreferencesGetWebSecurityEnabled(WKPreferencesRef preferencesRef) +{ + return toImpl(preferencesRef)->webSecurityEnabled(); +} + +void WKPreferencesSetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef, bool allowed) +{ + toImpl(preferencesRef)->setAllowUniversalAccessFromFileURLs(allowed); +} + +bool WKPreferencesGetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef) +{ + return toImpl(preferencesRef)->allowUniversalAccessFromFileURLs(); +} + +void WKPreferencesSetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef, bool allowed) +{ + toImpl(preferencesRef)->setAllowFileAccessFromFileURLs(allowed); +} + +bool WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef) +{ + return toImpl(preferencesRef)->allowFileAccessFromFileURLs(); +} diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferences.h b/Source/WebKit2/UIProcess/API/C/WKPreferences.h index 5c6c478..f2486bf 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPreferences.h +++ b/Source/WebKit2/UIProcess/API/C/WKPreferences.h @@ -150,6 +150,11 @@ WK_EXPORT bool WKPreferencesGetShouldPrintBackgrounds(WKPreferencesRef preferenc WK_EXPORT void WKPreferencesSetJavaScriptCanAccessClipboard(WKPreferencesRef preferencesRef, bool enabled); WK_EXPORT bool WKPreferencesGetJavaScriptCanAccessClipboard(WKPreferencesRef preferencesRef); +// Defaults to false +WK_EXPORT void WKPreferencesSetFullScreenEnabled(WKPreferencesRef preferencesRef, bool enabled); +WK_EXPORT bool WKPreferencesGetFullScreenEnabled(WKPreferencesRef preferencesRef); + + #ifdef __cplusplus } #endif diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h b/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h index 426119b..ddf1b9a 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h +++ b/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h @@ -52,6 +52,10 @@ WK_EXPORT void WKPreferencesSetAcceleratedDrawingEnabled(WKPreferencesRef, bool) WK_EXPORT bool WKPreferencesGetAcceleratedDrawingEnabled(WKPreferencesRef); // Defaults to true. +WK_EXPORT void WKPreferencesSetCanvasUsesAcceleratedDrawing(WKPreferencesRef, bool); +WK_EXPORT bool WKPreferencesGetCanvasUsesAcceleratedDrawing(WKPreferencesRef); + +// Defaults to true. WK_EXPORT void WKPreferencesSetAcceleratedCompositingEnabled(WKPreferencesRef, bool); WK_EXPORT bool WKPreferencesGetAcceleratedCompositingEnabled(WKPreferencesRef); @@ -99,6 +103,18 @@ WK_EXPORT bool WKPreferencesGetPaginateDuringLayoutEnabled(WKPreferencesRef pref WK_EXPORT void WKPreferencesSetDOMPasteAllowed(WKPreferencesRef preferences, bool enabled); WK_EXPORT bool WKPreferencesGetDOMPasteAllowed(WKPreferencesRef preferences); +// Defaults to true. +WK_EXPORT void WKPreferencesSetWebSecurityEnabled(WKPreferencesRef preferences, bool enabled); +WK_EXPORT bool WKPreferencesGetWebSecurityEnabled(WKPreferencesRef preferences); + +// Defaults to false. +WK_EXPORT void WKPreferencesSetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferences, bool allowed); +WK_EXPORT bool WKPreferencesGetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferences); + +// Defaults to false. +WK_EXPORT void WKPreferencesSetFileAccessFromFileURLsAllowed(WKPreferencesRef preferences, bool allowed); +WK_EXPORT bool WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferences); + #ifdef __cplusplus } #endif diff --git a/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.cpp b/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.cpp new file mode 100644 index 0000000..5e50dd8 --- /dev/null +++ b/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTAwBILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WKIconDatabaseCG.h" + +#include "WebIconDatabase.h" +#include "WKAPICast.h" +#include "WKSharedAPICast.h" +#include <WebCore/Image.h> + +using namespace WebKit; +using namespace WebCore; + +CGImageRef WKIconDatabaseGetCGImageForURL(WKIconDatabaseRef iconDatabaseRef, WKURLRef urlRef) +{ + Image* image = toImpl(iconDatabaseRef)->imageForPageURL(toWTFString(urlRef)); + return image ? image->getCGImageRef() : 0; +} diff --git a/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.h b/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.h new file mode 100644 index 0000000..48cf5bf --- /dev/null +++ b/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WKIconDatabaseCG_h +#define WKIconDatabaseCG_h + +#include <CoreGraphics/CGImage.h> +#include <WebKit2/WKBase.h> + +#ifdef __cplusplus +extern "C" { +#endif + +WK_EXPORT CGImageRef WKIconDatabaseGetCGImageForURL(WKIconDatabaseRef iconDatabase, WKURLRef urlString); + +#ifdef __cplusplus +} +#endif + +#endif /* WKIconDatabaseCG_h */ diff --git a/Source/WebKit2/UIProcess/API/C/win/WKAPICastWin.h b/Source/WebKit2/UIProcess/API/C/win/WKAPICastWin.h index 6acb1a6..09cf06f 100644 --- a/Source/WebKit2/UIProcess/API/C/win/WKAPICastWin.h +++ b/Source/WebKit2/UIProcess/API/C/win/WKAPICastWin.h @@ -33,8 +33,10 @@ namespace WebKit { class WebView; +class WebEditCommandProxy; WK_ADD_API_MAPPING(WKViewRef, WebView) +WK_ADD_API_MAPPING(WKEditCommandRef, WebEditCommandProxy) } diff --git a/Source/WebKit2/UIProcess/API/C/win/WKContextPrivateWin.h b/Source/WebKit2/UIProcess/API/C/win/WKContextPrivateWin.h index c8a9c34..0d49ac9 100644 --- a/Source/WebKit2/UIProcess/API/C/win/WKContextPrivateWin.h +++ b/Source/WebKit2/UIProcess/API/C/win/WKContextPrivateWin.h @@ -28,6 +28,7 @@ #include <WebKit2/WKBase.h> #include <WebKit2/WKContext.h> +#include <WebKit2/WKCookieManager.h> #ifndef __cplusplus #include <stdbool.h> @@ -40,6 +41,9 @@ extern "C" { // Defaults to true. WK_EXPORT void WKContextSetShouldPaintNativeControls(WKContextRef, bool); +// Defaults to WKHTTPCookieAcceptPolicyAlways. +WK_EXPORT void WKContextSetInitialHTTPCookieAcceptPolicy(WKContextRef, WKHTTPCookieAcceptPolicy); + #ifdef __cplusplus } #endif diff --git a/Source/WebKit2/UIProcess/API/C/win/WKContextWin.cpp b/Source/WebKit2/UIProcess/API/C/win/WKContextWin.cpp index 110951f..4971540 100644 --- a/Source/WebKit2/UIProcess/API/C/win/WKContextWin.cpp +++ b/Source/WebKit2/UIProcess/API/C/win/WKContextWin.cpp @@ -36,3 +36,8 @@ void WKContextSetShouldPaintNativeControls(WKContextRef contextRef, bool b) { toImpl(contextRef)->setShouldPaintNativeControls(b); } + +void WKContextSetInitialHTTPCookieAcceptPolicy(WKContextRef contextRef, WKHTTPCookieAcceptPolicy policy) +{ + toImpl(contextRef)->setInitialHTTPCookieAcceptPolicy(toHTTPCookieAcceptPolicy(policy)); +} diff --git a/Source/WebKit2/UIProcess/API/C/win/WKView.cpp b/Source/WebKit2/UIProcess/API/C/win/WKView.cpp index 62603fe..05ae0d7 100644 --- a/Source/WebKit2/UIProcess/API/C/win/WKView.cpp +++ b/Source/WebKit2/UIProcess/API/C/win/WKView.cpp @@ -72,6 +72,11 @@ void WKViewSetInitialFocus(WKViewRef viewRef, bool forward) toImpl(viewRef)->setInitialFocus(forward); } +void WKViewSetScrollOffsetOnNextResize(WKViewRef viewRef, WKSize scrollOffset) +{ + toImpl(viewRef)->setScrollOffsetOnNextResize(toIntSize(scrollOffset)); +} + void WKViewSetFindIndicatorCallback(WKViewRef viewRef, WKViewFindIndicatorCallback callback, void* context) { toImpl(viewRef)->setFindIndicatorCallback(callback, context); @@ -81,3 +86,20 @@ WKViewFindIndicatorCallback WKViewGetFindIndicatorCallback(WKViewRef viewRef, vo { return toImpl(viewRef)->getFindIndicatorCallback(context); } + +void WKViewSetViewUndoClient(WKViewRef viewRef, const WKViewUndoClient* wkClient) +{ + if (wkClient && wkClient->version) + return; + toImpl(viewRef)->initializeUndoClient(wkClient); +} + +void WKViewReapplyEditCommand(WKViewRef viewRef, WKEditCommandRef command) +{ + toImpl(viewRef)->reapplyEditCommand(toImpl(command)); +} + +void WKViewUnapplyEditCommand(WKViewRef viewRef, WKEditCommandRef command) +{ + toImpl(viewRef)->unapplyEditCommand(toImpl(command)); +} diff --git a/Source/WebKit2/UIProcess/API/C/win/WKView.h b/Source/WebKit2/UIProcess/API/C/win/WKView.h index 213897e..c8ac44c 100644 --- a/Source/WebKit2/UIProcess/API/C/win/WKView.h +++ b/Source/WebKit2/UIProcess/API/C/win/WKView.h @@ -27,12 +27,31 @@ #define WKView_h #include <WebKit2/WKBase.h> +#include <WebKit2/WKGeometry.h> #include <windows.h> #ifdef __cplusplus extern "C" { #endif +// Undo Client. +enum { + kWKViewUndo = 0, + kWKViewRedo = 1 +}; +typedef uint32_t WKViewUndoType; + +typedef void (*WKViewRegisterEditCommandCallback)(WKViewRef, WKEditCommandRef, WKViewUndoType undoOrRedo, const void *clientInfo); +typedef void (*WKViewClearAllEditCommandsCallback)(WKViewRef, const void *clientInfo); + +struct WKViewUndoClient { + int version; + const void * clientInfo; + WKViewRegisterEditCommandCallback registerEditCommand; + WKViewClearAllEditCommandsCallback clearAllEditCommands; +}; +typedef struct WKViewUndoClient WKViewUndoClient; + WK_EXPORT WKTypeID WKViewGetTypeID(); WK_EXPORT WKViewRef WKViewCreate(RECT rect, WKContextRef context, WKPageGroupRef pageGroup, HWND parentWindow); @@ -41,10 +60,15 @@ WK_EXPORT HWND WKViewGetWindow(WKViewRef view); WK_EXPORT WKPageRef WKViewGetPage(WKViewRef view); +WK_EXPORT void WKViewSetViewUndoClient(WKViewRef view, const WKViewUndoClient* client); +WK_EXPORT void WKViewReapplyEditCommand(WKViewRef view, WKEditCommandRef command); +WK_EXPORT void WKViewUnapplyEditCommand(WKViewRef view, WKEditCommandRef command); + WK_EXPORT void WKViewSetParentWindow(WKViewRef view, HWND parentWindow); WK_EXPORT void WKViewWindowAncestryDidChange(WKViewRef view); WK_EXPORT void WKViewSetIsInWindow(WKViewRef view, bool isInWindow); WK_EXPORT void WKViewSetInitialFocus(WKViewRef view, bool forward); +WK_EXPORT void WKViewSetScrollOffsetOnNextResize(WKViewRef view, WKSize scrollOffset); typedef void (*WKViewFindIndicatorCallback)(WKViewRef, HBITMAP selectionBitmap, RECT selectionRectInWindowCoordinates, bool fadeout, void*); WK_EXPORT void WKViewSetFindIndicatorCallback(WKViewRef view, WKViewFindIndicatorCallback callback, void* context); diff --git a/Source/WebKit2/UIProcess/API/mac/PDFViewController.h b/Source/WebKit2/UIProcess/API/mac/PDFViewController.h index d22d8b5..dc30f56 100644 --- a/Source/WebKit2/UIProcess/API/mac/PDFViewController.h +++ b/Source/WebKit2/UIProcess/API/mac/PDFViewController.h @@ -41,6 +41,8 @@ namespace CoreIPC { namespace WebKit { +class WebPageProxy; + class PDFViewController { WTF_MAKE_NONCOPYABLE(PDFViewController); @@ -49,6 +51,9 @@ public: ~PDFViewController(); WKView* wkView() const { return m_wkView; } + WebPageProxy* page() const; + NSView* pdfView() const; + void setPDFDocumentData(const String& mimeType, const String& suggestedFilename, const CoreIPC::DataReference&); double zoomFactor() const; @@ -58,6 +63,7 @@ public: NSPrintOperation *makePrintOperation(NSPrintInfo *); void openPDFInFinder(); + void savePDFToDownloadsFolder(); private: explicit PDFViewController(WKView *wkView); diff --git a/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm b/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm index 5d9b860..5c64000 100644 --- a/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm +++ b/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm @@ -29,6 +29,7 @@ #import "DataReference.h" #import "WKAPICast.h" #import "WKView.h" +#import "WebData.h" #import "WebPageGroup.h" #import "WebPageProxy.h" #import "WebPreferences.h" @@ -116,7 +117,7 @@ extern "C" NSString *_NSPathForSystemFramework(NSString *framework); if (!_pdfViewController) return; - WebPreferences *preferences = toImpl([_pdfViewController->wkView() pageRef])->pageGroup()->preferences(); + WebPreferences *preferences = _pdfViewController->page()->pageGroup()->preferences(); CGFloat scaleFactor = preferences->pdfScaleFactor(); if (!scaleFactor) @@ -135,7 +136,7 @@ extern "C" NSString *_NSPathForSystemFramework(NSString *framework); if (!_pdfViewController) return; - WebPreferences* preferences = toImpl([_pdfViewController->wkView() pageRef])->pageGroup()->preferences(); + WebPreferences* preferences = _pdfViewController->page()->pageGroup()->preferences(); CGFloat scaleFactor = [_pdfView autoScales] ? 0 : [_pdfView scaleFactor]; preferences->setPDFScaleFactor(scaleFactor); @@ -187,6 +188,11 @@ extern "C" NSString *_NSPathForSystemFramework(NSString *framework); _pdfViewController->openPDFInFinder(); } +- (void)PDFViewSavePDFToDownloadFolder:(PDFView *)sender +{ + _pdfViewController->savePDFToDownloadsFolder(); +} + @end namespace WebKit { @@ -212,6 +218,16 @@ PDFViewController::~PDFViewController() m_wkPDFView = nullptr; } +WebPageProxy* PDFViewController::page() const +{ + return toImpl([m_wkView pageRef]); +} + +NSView* PDFViewController::pdfView() const +{ + return m_wkPDFView.get(); +} + static RetainPtr<CFDataRef> convertPostScriptDataSourceToPDF(const CoreIPC::DataReference& dataReference) { // Convert PostScript to PDF using Quartz 2D API @@ -330,6 +346,32 @@ void PDFViewController::openPDFInFinder() [[NSWorkspace sharedWorkspace] openFile:path]; } +static void releaseCFData(unsigned char*, const void* data) +{ + ASSERT(CFGetTypeID(data) == CFDataGetTypeID()); + + // Balanced by CFRetain in savePDFToDownloadsFolder. + CFRelease(data); +} + +void PDFViewController::savePDFToDownloadsFolder() +{ + // We don't want to write the file until we have a document to write. (see 5267607). + if (![m_pdfView document]) { + NSBeep(); + return; + } + + ASSERT(m_pdfData); + + // Balanced by CFRelease in releaseCFData. + CFRetain(m_pdfData.get()); + + RefPtr<WebData> data = WebData::createWithoutCopying(CFDataGetBytePtr(m_pdfData.get()), CFDataGetLength(m_pdfData.get()), releaseCFData, m_pdfData.get()); + + page()->saveDataToFileInDownloadsFolder(m_suggestedFilename.get(), page()->mainFrame()->mimeType(), page()->mainFrame()->url(), data.get()); +} + static NSString *temporaryPDFDirectoryPath() { static NSString *temporaryPDFDirectoryPath; diff --git a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h index e01cf66..e217fc5 100644 --- a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h +++ b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h @@ -26,6 +26,7 @@ #ifndef PageClientImpl_h #define PageClientImpl_h +#include "CorrectionPanel.h" #include "PageClient.h" #include <wtf/RetainPtr.h> @@ -62,6 +63,7 @@ private: virtual void processDidCrash(); virtual void pageClosed(); virtual void didRelaunchProcess(); + virtual void setFocus(bool focused); virtual void takeFocus(bool direction); virtual void toolTipChanged(const String& oldToolTip, const String& newToolTip); virtual void setCursor(const WebCore::Cursor&); @@ -70,11 +72,12 @@ private: virtual void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo); virtual void clearAllEditCommands(); virtual void interceptKeyEvent(const NativeWebKeyboardEvent& event, Vector<WebCore::KeypressCommand>& commandName, uint32_t selectionStart, uint32_t selectionEnd, Vector<WebCore::CompositionUnderline>& underlines); - virtual void setDragImage(const WebCore::IntPoint& clientPosition, const WebCore::IntSize& imageSize, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag); + virtual void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag); virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&); virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&); - + virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&); + virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled); virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*); @@ -87,7 +90,6 @@ private: virtual void accessibilityWebProcessTokenReceived(const CoreIPC::DataReference&); virtual void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled); - virtual void setAutodisplay(bool); virtual CGContextRef containingWindowGraphicsContext(); @@ -103,8 +105,18 @@ private: virtual void didPerformDictionaryLookup(const String&, double scaleFactor, const DictionaryPopupInfo&); + virtual void showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings); + virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel); + virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingCorrectionPanel); + virtual void recordAutocorrectionResponse(WebCore::EditorClient::AutocorrectionResponseType, const String& replacedString, const String& replacementString); + + virtual float userSpaceScaleFactor() const; + WKView* m_wkView; RetainPtr<WebEditorUndoTargetObjC> m_undoTarget; +#if !defined(BUILDING_ON_SNOW_LEOPARD) + CorrectionPanel m_correctionPanel; +#endif }; } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm index 88bb9a4..7a0d62d 100644 --- a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm +++ b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm @@ -45,6 +45,7 @@ #import <wtf/PassOwnPtr.h> #import <wtf/text/CString.h> #import <wtf/text/WTFString.h> +#import <WebKitSystemInterface.h> @interface NSApplication (WebNSApplicationDetails) - (NSCursor *)_cursorRectCursor; @@ -195,6 +196,15 @@ void PageClientImpl::didRelaunchProcess() [m_wkView _didRelaunchProcess]; } +void PageClientImpl::setFocus(bool focused) +{ + if (focused) + [[m_wkView window] makeFirstResponder:m_wkView]; + else + // takeFocus in this context means take focus away from the WKView. + takeFocus(true); +} + void PageClientImpl::takeFocus(bool direction) { [m_wkView _takeFocus:direction]; @@ -287,10 +297,11 @@ void PageClientImpl::interceptKeyEvent(const NativeWebKeyboardEvent& event, Vect [m_wkView _getTextInputState:selectionStart selectionEnd:selectionEnd underlines:underlines]; } -void PageClientImpl::setDragImage(const IntPoint& clientPosition, const IntSize& imageSize, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag) +void PageClientImpl::setDragImage(const IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag) { - OwnPtr<GraphicsContext> graphicsContext = dragImage->createGraphicsContext(); - RetainPtr<NSImage> dragNSImage(AdoptNS, [[NSImage alloc] initWithCGImage:CGBitmapContextCreateImage(graphicsContext->platformContext()) size:imageSize]); + RetainPtr<CGImageRef> dragCGImage = dragImage->makeCGImage(); + RetainPtr<NSImage> dragNSImage(AdoptNS, [[NSImage alloc] initWithCGImage:dragCGImage.get() size:dragImage->size()]); + [m_wkView _setDragImage:dragNSImage.get() at:clientPosition linkDrag:isLinkDrag]; } @@ -303,6 +314,14 @@ FloatRect PageClientImpl::convertToUserSpace(const FloatRect& rect) { return [m_wkView _convertToUserSpace:rect]; } + +IntRect PageClientImpl::windowToScreen(const IntRect& rect) +{ + NSRect tempRect = rect; + tempRect = [m_wkView convertRect:tempRect toView:nil]; + tempRect.origin = [[m_wkView window] convertBaseToScreen:tempRect.origin]; + return enclosingIntRect(tempRect); +} void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool wasEventHandled) { @@ -311,10 +330,8 @@ void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool return; if (wasEventHandled) [NSCursor setHiddenUntilMouseMoves:YES]; - else { - [m_wkView _setEventBeingResent:nativeEvent]; - [[NSApplication sharedApplication] sendEvent:nativeEvent]; - } + else + [m_wkView _resendKeyDownEvent:nativeEvent]; } PassRefPtr<WebPopupMenuProxy> PageClientImpl::createPopupMenuProxy(WebPageProxy* page) @@ -355,18 +372,6 @@ void PageClientImpl::setComplexTextInputEnabled(uint64_t pluginComplexTextInputI [m_wkView _setComplexTextInputEnabled:complexTextInputEnabled pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier]; } -void PageClientImpl::setAutodisplay(bool newState) -{ - if (!newState && [[m_wkView window] isAutodisplay]) - [m_wkView displayIfNeeded]; - - [[m_wkView window] setAutodisplay:newState]; - - // For some reason, painting doesn't happen for a long time without this call, <rdar://problem/8975229>. - if (newState) - [m_wkView displayIfNeeded]; -} - CGContextRef PageClientImpl::containingWindowGraphicsContext() { NSWindow *window = [m_wkView window]; @@ -419,9 +424,64 @@ void PageClientImpl::didPerformDictionaryLookup(const String& text, double scale NSPoint textBaselineOrigin = dictionaryPopupInfo.origin; textBaselineOrigin.y += [font ascender]; +#if !defined(BUILDING_ON_SNOW_LEOPARD) + // Convert to screen coordinates. + textBaselineOrigin = [m_wkView convertPoint:textBaselineOrigin toView:nil]; + textBaselineOrigin = [m_wkView.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin; + + WKShowWordDefinitionWindow(attributedString.get(), textBaselineOrigin, (NSDictionary *)dictionaryPopupInfo.options.get()); +#else // If the dictionary lookup is being triggered by a hot key, force the overlay style. NSDictionary *options = (dictionaryPopupInfo.type == DictionaryPopupInfo::HotKey) ? [NSDictionary dictionaryWithObject:NSDefinitionPresentationTypeOverlay forKey:NSDefinitionPresentationTypeKey] : 0; [m_wkView showDefinitionForAttributedString:attributedString.get() range:NSMakeRange(0, [attributedString.get() length]) options:options baselineOriginProvider:^(NSRange adjustedRange) { return (NSPoint)textBaselineOrigin; }]; +#endif +} + +void PageClientImpl::showCorrectionPanel(CorrectionPanelInfo::PanelType type, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) +{ +#if !defined(BUILDING_ON_SNOW_LEOPARD) + if (!isViewVisible() || !isViewInWindow()) + return; + m_correctionPanel.show(m_wkView, type, boundingBoxOfReplacedString, replacedString, replacementString, alternativeReplacementStrings); +#endif +} + +void PageClientImpl::dismissCorrectionPanel(ReasonForDismissingCorrectionPanel reason) +{ +#if !defined(BUILDING_ON_SNOW_LEOPARD) + m_correctionPanel.dismiss(reason); +#endif +} + +String PageClientImpl::dismissCorrectionPanelSoon(WebCore::ReasonForDismissingCorrectionPanel reason) +{ +#if !defined(BUILDING_ON_SNOW_LEOPARD) + return m_correctionPanel.dismissSoon(reason); +#else + return String(); +#endif +} + +void PageClientImpl::recordAutocorrectionResponse(EditorClient::AutocorrectionResponseType responseType, const String& replacedString, const String& replacementString) +{ +#if !defined(BUILDING_ON_SNOW_LEOPARD) + NSCorrectionResponse response = responseType == EditorClient::AutocorrectionReverted ? NSCorrectionResponseReverted : NSCorrectionResponseEdited; + CorrectionPanel::recordAutocorrectionResponse(m_wkView, response, replacedString, replacementString); +#endif +} + +float PageClientImpl::userSpaceScaleFactor() const +{ + NSWindow *window = [m_wkView window]; +#if !defined(BUILDING_ON_SNOW_LEOPARD) + if (window) + return [window backingScaleFactor]; + return [[NSScreen mainScreen] backingScaleFactor]; +#else + if (window) + return [window userSpaceScaleFactor]; + return [[NSScreen mainScreen] userSpaceScaleFactor]; +#endif } } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h b/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h index 3f7a692..87d81f4 100644 --- a/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h +++ b/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h @@ -35,6 +35,7 @@ namespace WebKit { @interface WKPrintingView : NSView { @public NSPrintOperation *_printOperation; // WKPrintingView is owned by the operation. + RetainPtr<NSView> _wkView; RefPtr<WebKit::WebFrameProxy> _webFrame; Vector<WebCore::IntRect> _printingPageRects; @@ -56,6 +57,6 @@ namespace WebKit { NSTimer *_autodisplayResumeTimer; } -- (id)initWithFrameProxy:(WebKit::WebFrameProxy*)frame; +- (id)initWithFrameProxy:(WebKit::WebFrameProxy*)frame view:(NSView *)wkView; @end diff --git a/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm b/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm index 28ba153..d5d9de7 100644 --- a/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm +++ b/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm @@ -43,13 +43,14 @@ static BOOL isForcingPreviewUpdate; @implementation WKPrintingView -- (id)initWithFrameProxy:(WebFrameProxy*)frame +- (id)initWithFrameProxy:(WebKit::WebFrameProxy*)frame view:(NSView *)wkView { self = [super init]; // No frame rect to pass to NSView. if (!self) return nil; _webFrame = frame; + _wkView = wkView; return self; } @@ -59,6 +60,19 @@ static BOOL isForcingPreviewUpdate; return YES; } +- (void)_setAutodisplay:(BOOL)newState +{ + if (!newState && [[_wkView.get() window] isAutodisplay]) + [_wkView.get() displayIfNeeded]; + + [[_wkView.get() window] setAutodisplay:newState]; + + // For some reason, painting doesn't happen for a long time without this call, <rdar://problem/8975229>. + if (newState) + [_wkView.get() displayIfNeeded]; +} + + - (void)_suspendAutodisplay { // A drawRect: call on WKView causes a switch to screen mode, which is slow due to relayout, and we want to avoid that. @@ -67,7 +81,7 @@ static BOOL isForcingPreviewUpdate; [_autodisplayResumeTimer invalidate]; _autodisplayResumeTimer = nil; } else - _webFrame->page()->setAutodisplay(false); + [self _setAutodisplay:NO]; } - (void)_delayedResumeAutodisplayTimerFired @@ -75,7 +89,7 @@ static BOOL isForcingPreviewUpdate; ASSERT(isMainThread()); _autodisplayResumeTimer = nil; - _webFrame->page()->setAutodisplay(true); + [self _setAutodisplay:YES]; } - (void)_delayedResumeAutodisplay @@ -200,11 +214,12 @@ static void pageDidDrawToPDF(WKDataRef dataRef, WKErrorRef, void* untypedContext pair<HashMap<WebCore::IntRect, Vector<uint8_t> >::iterator, bool> entry = view->_pagePreviews.add(iter->second, Vector<uint8_t>()); entry.first->second.append(data->bytes(), data->size()); } - bool receivedResponseToLatestRequest = view->_latestExpectedPreviewCallback == context->callbackID; - view->_latestExpectedPreviewCallback = 0; view->_expectedPreviewCallbacks.remove(context->callbackID); - if (receivedResponseToLatestRequest) + bool receivedResponseToLatestRequest = view->_latestExpectedPreviewCallback == context->callbackID; + if (receivedResponseToLatestRequest) { + view->_latestExpectedPreviewCallback = 0; [view _updatePreview]; + } } } } @@ -264,6 +279,12 @@ static void pageDidComputePageRects(const Vector<WebCore::IntRect>& pageRects, d view->_printingPageRects = pageRects; view->_totalScaleFactorForPrinting = totalScaleFactorForPrinting; + // Sanitize a response coming from the Web process. + if (view->_printingPageRects.isEmpty()) + view->_printingPageRects.append(IntRect(0, 0, 1, 1)); + if (view->_totalScaleFactorForPrinting <= 0) + view->_totalScaleFactorForPrinting = 1; + const IntRect& lastPrintingPageRect = view->_printingPageRects[view->_printingPageRects.size() - 1]; NSRect newFrameSize = NSMakeRect(0, 0, ceil(lastPrintingPageRect.maxX() * view->_totalScaleFactorForPrinting), @@ -330,6 +351,11 @@ static void prepareDataForPrintingOnSecondaryThread(void* untypedContext) if (!isMainThread()) _isPrintingFromSecondaryThread = YES; + if (!_webFrame->page()) { + *range = NSMakeRange(1, NSIntegerMax); + return YES; + } + [self _suspendAutodisplay]; [self _adjustPrintingMarginsForHeaderAndFooter]; @@ -524,11 +550,22 @@ static void prepareDataForPrintingOnSecondaryThread(void* untypedContext) ASSERT(_printOperation == [NSPrintOperation currentOperation]); if (![self _hasPageRects]) { LOG(View, "-[WKPrintingView %p rectForPage:%d] - data is not yet available", self, (int)page); + if (!_webFrame->page()) { + // We may have not told AppKit how many pages there are, so it will try to print until a null rect is returned. + return NSMakeRect(0, 0, 0, 0); + } // We must be still calculating the page range. ASSERT(_expectedComputedPagesCallback); return NSMakeRect(0, 0, 1, 1); } + // If Web process crashes while computing page rects, we never tell AppKit how many pages there are. + // Returning a null rect prevents selecting non-existent pages in preview dialog. + if (static_cast<unsigned>(page) > _printingPageRects.size()) { + ASSERT(!_webFrame->page()); + return NSMakeRect(0, 0, 0, 0); + } + IntRect rect = _printingPageRects[page - 1]; rect.scale(_totalScaleFactorForPrinting); LOG(View, "-[WKPrintingView %p rectForPage:%d] -> x %d, y %d, width %d, height %d", self, (int)page, rect.x(), rect.y(), rect.width(), rect.height()); diff --git a/Source/WebKit2/UIProcess/API/mac/WKView.mm b/Source/WebKit2/UIProcess/API/mac/WKView.mm index e432549..05693ef 100644 --- a/Source/WebKit2/UIProcess/API/mac/WKView.mm +++ b/Source/WebKit2/UIProcess/API/mac/WKView.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,6 +42,7 @@ #import "TextChecker.h" #import "TextCheckerState.h" #import "WKAPICast.h" +#import "WKFullScreenWindowController.h" #import "WKPrintingView.h" #import "WKStringCF.h" #import "WKTextInputWindowController.h" @@ -49,6 +50,7 @@ #import "WKViewPrivate.h" #import "WebContext.h" #import "WebEventFactory.h" +#import "WebFullScreenManagerProxy.h" #import "WebPage.h" #import "WebPageProxy.h" #import "WebProcessProxy.h" @@ -57,6 +59,7 @@ #import <WebCore/ColorMac.h> #import <WebCore/DragController.h> #import <WebCore/DragData.h> +#import <WebCore/LocalizedStrings.h> #import <WebCore/FloatRect.h> #import <WebCore/IntRect.h> #import <WebCore/KeyboardEvent.h> @@ -66,15 +69,14 @@ #import <wtf/RefPtr.h> #import <wtf/RetainPtr.h> -// FIXME (WebKit2) <rdar://problem/8728860> WebKit2 needs to be localized -#define UI_STRING(__str, __desc) [NSString stringWithUTF8String:__str] - -@interface NSApplication (Details) +@interface NSApplication (WebNSApplicationDetails) - (void)speakString:(NSString *)string; +- (void)_setCurrentEvent:(NSEvent *)event; @end -@interface NSWindow (Details) +@interface NSWindow (WebNSWindowDetails) - (NSRect)_growBoxRect; +- (id)_growBoxOwner; - (void)_setShowOpaqueGrowBoxForOwner:(id)owner; - (BOOL)_updateGrowBoxForWindowFrameChange; @end @@ -108,11 +110,6 @@ typedef HashMap<String, ValidationVector> ValidationMap; RetainPtr<NSView> _layerHostingView; - // FIXME: Remove _oldLayerHostingView. -#if USE(ACCELERATED_COMPOSITING) - NSView *_oldLayerHostingView; -#endif - RetainPtr<id> _remoteAccessibilityChild; // For asynchronous validation. @@ -124,7 +121,8 @@ typedef HashMap<String, ValidationVector> ValidationMap; // We keep here the event when resending it to // the application to distinguish the case of a new event from one // that has been already sent to WebCore. - NSEvent *_keyDownEventBeingResent; + RetainPtr<NSEvent> _keyDownEventBeingResent; + bool _isInInterpretKeyEvents; Vector<KeypressCommand> _commandsList; NSSize _resizeScrollOffset; @@ -145,6 +143,13 @@ typedef HashMap<String, ValidationVector> ValidationMap; #if ENABLE(GESTURE_EVENTS) id _endGestureMonitor; #endif + +#if ENABLE(FULLSCREEN_API) + RetainPtr<WKFullScreenWindowController> _fullScreenWindowController; +#endif + + BOOL _hasSpellCheckerDocumentTag; + NSInteger _spellCheckerDocumentTag; } @end @@ -158,12 +163,6 @@ typedef HashMap<String, ValidationVector> ValidationMap; @implementation WKView -// FIXME: Remove this once we no longer want to be able to go back to the old drawing area. -static bool useNewDrawingArea() -{ - return true; -} - - (id)initWithFrame:(NSRect)frame { return [self initWithFrame:frame contextRef:toAPI(WebContext::sharedProcessContext())]; @@ -223,6 +222,9 @@ static bool useNewDrawingArea() _data->_pageClient = PageClientImpl::create(self); _data->_page = toImpl(contextRef)->createWebPage(_data->_pageClient.get(), toImpl(pageGroupRef)); _data->_page->initializeWebPage(); +#if ENABLE(FULLSCREEN_API) + _data->_page->fullScreenManager()->setWebView(self); +#endif _data->_mouseDownEvent = nil; _data->_ignoringMouseDraggedEvents = NO; @@ -238,6 +240,7 @@ static bool useNewDrawingArea() _data->_page->close(); [_data release]; + _data = nil; WebContext::statistics().wkViewCount--; @@ -496,6 +499,8 @@ WEBCORE_COMMAND(yankAndSelect) #undef WEBCORE_COMMAND +// This method is needed to support Mac OS X services. + - (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pasteboard types:(NSArray *)types { Vector<String> pasteboardTypes; @@ -505,6 +510,8 @@ WEBCORE_COMMAND(yankAndSelect) return _data->_page->writeSelectionToPasteboard([pasteboard name], pasteboardTypes); } +// This method is needed to support Mac OS X services. + - (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType { BOOL isValidSendType = !sendType || ([PasteboardTypes::forSelection() containsObject:sendType] && !_data->_page->selectionState().isNone); @@ -520,6 +527,13 @@ WEBCORE_COMMAND(yankAndSelect) return [[self nextResponder] validRequestorForSendType:sendType returnType:returnType]; } +// This method is needed to support Mac OS X services. + +- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pasteboard +{ + return _data->_page->readSelectionFromPasteboard([pasteboard name]); +} + /* When possible, editing-related methods should be implemented in WebCore with the @@ -589,12 +603,8 @@ static void validateCommandCallback(WKStringRef commandName, bool isEnabled, int SEL action = [item action]; if (action == @selector(showGuessPanel:)) { - if (NSMenuItem *menuItem = ::menuItem(item)) { - BOOL panelShowing = [[[NSSpellChecker sharedSpellChecker] spellingPanel] isVisible]; - [menuItem setTitle:panelShowing - ? UI_STRING("Hide Spelling and Grammar", "menu item title") - : UI_STRING("Show Spelling and Grammar", "menu item title")]; - } + if (NSMenuItem *menuItem = ::menuItem(item)) + [menuItem setTitle:contextMenuItemTagShowSpellingPanel([[[NSSpellChecker sharedSpellChecker] spellingPanel] isVisible])]; return _data->_page->selectionState().isContentEditable; } @@ -621,12 +631,8 @@ static void validateCommandCallback(WKStringRef commandName, bool isEnabled, int } if (action == @selector(orderFrontSubstitutionsPanel:)) { - if (NSMenuItem *menuItem = ::menuItem(item)) { - BOOL panelShowing = [[[NSSpellChecker sharedSpellChecker] substitutionsPanel] isVisible]; - [menuItem setTitle:panelShowing - ? UI_STRING("Hide Substitutions", "menu item title") - : UI_STRING("Show Substitutions", "menu item title")]; - } + if (NSMenuItem *menuItem = ::menuItem(item)) + [menuItem setTitle:contextMenuItemTagShowSubstitutions([[[NSSpellChecker sharedSpellChecker] substitutionsPanel] isVisible])]; return _data->_page->selectionState().isContentEditable; } @@ -1010,6 +1016,12 @@ static const short kIOHIDEventTypeScroll = 6; - (void)doCommandBySelector:(SEL)selector { + LOG(TextInput, "doCommandBySelector:\"%s\"", sel_getName(selector)); + + if (!_data->_isInInterpretKeyEvents) { + [super doCommandBySelector:selector]; + return; + } if (selector != @selector(noop:)) _data->_commandsList.append(KeypressCommand(commandNameForSelector(selector))); } @@ -1034,9 +1046,13 @@ static const short kIOHIDEventTypeScroll = 6; isFromInputMethod = YES; } else text = string; - + String eventText = text; + // We'd need a different code path here if we wanted to be able to handle this + // outside of interpretKeyEvents. + ASSERT(_data->_isInInterpretKeyEvents); + if (!isFromInputMethod) _data->_commandsList.append(KeypressCommand("insertText", text)); else { @@ -1085,9 +1101,6 @@ static const short kIOHIDEventTypeScroll = 6; // But don't do it if we have already handled the event. // Pressing Esc results in a fake event being sent - don't pass it to WebCore. if (!eventWasSentToWebCore && event == [NSApp currentEvent] && self == [[self window] firstResponder]) { - [_data->_keyDownEventBeingResent release]; - _data->_keyDownEventBeingResent = nil; - _data->_page->handleKeyboardEvent(NativeWebKeyboardEvent(event, self)); return YES; } @@ -1102,6 +1115,11 @@ static const short kIOHIDEventTypeScroll = 6; - (void)keyDown:(NSEvent *)theEvent { + // There's a chance that responding to this event will run a nested event loop, and + // fetching a new event might release the old one. Retaining and then autoreleasing + // the current event prevents that from causing a problem inside WebKit or AppKit code. + [[theEvent retain] autorelease]; + if (_data->_pluginComplexTextInputIdentifier) { // Try feeding the keyboard event directly to the plug-in. NSString *string = nil; @@ -1120,8 +1138,6 @@ static const short kIOHIDEventTypeScroll = 6; // there is no range selection). // If this is the case we should ignore the key down. if (_data->_keyDownEventBeingResent == theEvent) { - [_data->_keyDownEventBeingResent release]; - _data->_keyDownEventBeingResent = nil; [super keyDown:theEvent]; return; } @@ -1129,7 +1145,7 @@ static const short kIOHIDEventTypeScroll = 6; } - (NSTextInputContext *)inputContext { - if (_data->_pluginComplexTextInputIdentifier) + if (_data->_pluginComplexTextInputIdentifier && !_data->_isInInterpretKeyEvents) return [[WKTextInputWindowController sharedTextInputWindowController] inputContext]; return [super inputContext]; @@ -1153,7 +1169,11 @@ static const short kIOHIDEventTypeScroll = 6; - (void)unmarkText { LOG(TextInput, "unmarkText"); - + + // We'd need a different code path here if we wanted to be able to handle this + // outside of interpretKeyEvents. + ASSERT(_data->_isInInterpretKeyEvents); + _data->_commandsList.append(KeypressCommand("unmarkText")); } @@ -1208,6 +1228,10 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde extractUnderlines(string, _data->_underlines); } + // We'd need a different code path here if we wanted to be able to handle this + // outside of interpretKeyEvents. + ASSERT(_data->_isInInterpretKeyEvents); + _data->_commandsList.append(KeypressCommand("setMarkedText", text)); _data->_selectionStart = newSelRange.location; _data->_selectionEnd = NSMaxRange(newSelRange); @@ -1418,10 +1442,15 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (void)viewWillMoveToWindow:(NSWindow *)window { - if (window != [self window]) { - [self removeWindowObservers]; - [self addWindowObserversForWindow:window]; - } + NSWindow *currentWindow = [self window]; + if (window == currentWindow) + return; + + [self removeWindowObservers]; + [self addWindowObserversForWindow:window]; + + if ([currentWindow _growBoxOwner] == self) + [currentWindow _setShowOpaqueGrowBoxForOwner:nil]; } - (void)viewDidMoveToWindow @@ -1438,7 +1467,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde // Initialize remote accessibility when the window connection has been established. #if !defined(BUILDING_ON_SNOW_LEOPARD) NSData *remoteElementToken = WKAXRemoteTokenForElement(self); - NSData *remoteWindowToken = WKAXRemoteTokenForElement([self window]); + NSData *remoteWindowToken = WKAXRemoteTokenForElement([self accessibilityAttributeValue:NSAccessibilityWindowAttribute]); CoreIPC::DataReference elementToken = CoreIPC::DataReference(reinterpret_cast<const uint8_t*>([remoteElementToken bytes]), [remoteElementToken length]); CoreIPC::DataReference windowToken = CoreIPC::DataReference(reinterpret_cast<const uint8_t*>([remoteWindowToken bytes]), [remoteWindowToken length]); _data->_page->registerUIProcessAccessibilityTokens(elementToken, windowToken); @@ -1454,6 +1483,9 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde _data->_endGestureMonitor = nil; } #endif +#if !defined(BUILDING_ON_SNOW_LEOPARD) + WKHideWordDefinitionWindow(); +#endif } } @@ -1510,37 +1542,25 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I { LOG(View, "drawRect: x:%g, y:%g, width:%g, height:%g", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); _data->_page->endPrinting(); - if (useNewDrawingArea()) { - CGContextRef context = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]); - - if (DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(_data->_page->drawingArea())) { - const NSRect *rectsBeingDrawn; - NSInteger numRectsBeingDrawn; - [self getRectsBeingDrawn:&rectsBeingDrawn count:&numRectsBeingDrawn]; - for (NSInteger i = 0; i < numRectsBeingDrawn; ++i) { - Region unpaintedRegion; - IntRect rect = enclosingIntRect(rectsBeingDrawn[i]); - drawingArea->paint(context, rect, unpaintedRegion); - - Vector<IntRect> unpaintedRects = unpaintedRegion.rects(); - for (size_t i = 0; i < unpaintedRects.size(); ++i) - drawPageBackground(context, _data->_page.get(), unpaintedRects[i]); - } - } else - drawPageBackground(context, _data->_page.get(), enclosingIntRect(rect)); - - _data->_page->didDraw(); - return; - } + CGContextRef context = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]); + + if (DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(_data->_page->drawingArea())) { + const NSRect *rectsBeingDrawn; + NSInteger numRectsBeingDrawn; + [self getRectsBeingDrawn:&rectsBeingDrawn count:&numRectsBeingDrawn]; + for (NSInteger i = 0; i < numRectsBeingDrawn; ++i) { + Region unpaintedRegion; + IntRect rect = enclosingIntRect(rectsBeingDrawn[i]); + drawingArea->paint(context, rect, unpaintedRegion); + + Vector<IntRect> unpaintedRects = unpaintedRegion.rects(); + for (size_t i = 0; i < unpaintedRects.size(); ++i) + drawPageBackground(context, _data->_page.get(), unpaintedRects[i]); + } + } else + drawPageBackground(context, _data->_page.get(), enclosingIntRect(rect)); - if (_data->_page->isValid() && _data->_page->drawingArea()) { - CGContextRef context = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]); - _data->_page->drawingArea()->paint(IntRect(rect), context); - _data->_page->didDraw(); - } else if (_data->_page->drawsBackground()) { - [_data->_page->drawsTransparentBackground() ? [NSColor clearColor] : [NSColor whiteColor] set]; - NSRectFill(rect); - } + _data->_page->didDraw(); } - (BOOL)isOpaque @@ -1567,6 +1587,9 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I - (id)accessibilityFocusedUIElement { + if (_data->_pdfViewController) + return NSAccessibilityUnignoredDescendant(_data->_pdfViewController->pdfView()); + return _data->_remoteAccessibilityChild.get(); } @@ -1577,15 +1600,25 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I - (id)accessibilityHitTest:(NSPoint)point { + if (_data->_pdfViewController) + return [_data->_pdfViewController->pdfView() accessibilityHitTest:point]; + return _data->_remoteAccessibilityChild.get(); } - (id)accessibilityAttributeValue:(NSString*)attribute { if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) { - if (!_data->_remoteAccessibilityChild) + + id child = nil; + if (_data->_pdfViewController) + child = NSAccessibilityUnignoredDescendant(_data->_pdfViewController->pdfView()); + else if (_data->_remoteAccessibilityChild) + child = _data->_remoteAccessibilityChild.get(); + + if (!child) return nil; - return [NSArray arrayWithObject:_data->_remoteAccessibilityChild.get()]; + return [NSArray arrayWithObject:child]; } if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) return NSAccessibilityGroupRole; @@ -1605,10 +1638,6 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I if (hitView && _data && hitView == _data->_layerHostingView) hitView = self; -#if USE(ACCELERATED_COMPOSITING) - if (hitView && _data && hitView == _data->_oldLayerHostingView) - hitView = self; -#endif return hitView; } @@ -1634,7 +1663,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I return 0; return _data->_pdfViewController->makePrintOperation(printInfo); } else { - RetainPtr<WKPrintingView> printingView(AdoptNS, [[WKPrintingView alloc] initWithFrameProxy:toImpl(frameRef)]); + RetainPtr<WKPrintingView> printingView(AdoptNS, [[WKPrintingView alloc] initWithFrameProxy:toImpl(frameRef) view:self]); // NSPrintOperation takes ownership of the view. NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView:printingView.get()]; [printOperation setCanSpawnSeparateThread:YES]; @@ -1649,10 +1678,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I - (PassOwnPtr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy { - if (useNewDrawingArea()) - return DrawingAreaProxyImpl::create(_data->_page.get()); - - return ChunkedUpdateDrawingAreaProxy::create(self, _data->_page.get()); + return DrawingAreaProxyImpl::create(_data->_page.get()); } - (BOOL)_isFocused @@ -1708,21 +1734,33 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I } } -- (void)_setEventBeingResent:(NSEvent *)event +- (void)_resendKeyDownEvent:(NSEvent *)event { - _data->_keyDownEventBeingResent = [event retain]; + ASSERT(!_data->_keyDownEventBeingResent); + _data->_keyDownEventBeingResent = event; + [NSApp _setCurrentEvent:event]; + [NSApp sendEvent:event]; + + _data->_keyDownEventBeingResent = nullptr; } - (Vector<KeypressCommand>&)_interceptKeyEvent:(NSEvent *)theEvent { + ASSERT(!_data->_isInInterpretKeyEvents); + + _data->_isInInterpretKeyEvents = true; _data->_commandsList.clear(); - // interpretKeyEvents will trigger one or more calls to doCommandBySelector or setText + + // Calling interpretKeyEvents will trigger one or more calls to doCommandBySelector and insertText // that will populate the commandsList vector. [self interpretKeyEvents:[NSArray arrayWithObject:theEvent]]; + + _data->_isInInterpretKeyEvents = false; + return _data->_commandsList; } -- (void)_getTextInputState:(unsigned)start selectionEnd:(unsigned)end underlines:(Vector<WebCore::CompositionUnderline>&)lines +- (void)_getTextInputState:(unsigned)start selectionEnd:(unsigned)end underlines:(Vector<CompositionUnderline>&)lines { start = _data->_selectionStart; end = _data->_selectionEnd; @@ -1771,20 +1809,23 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I - (void)removeTrackingRect:(NSTrackingRectTag)tag { + if (!_data) + return; + if (tag == 0) return; - if (_data && (tag == TRACKING_RECT_TAG)) { + if (tag == TRACKING_RECT_TAG) { _data->_trackingRectOwner = nil; return; } - if (_data && (tag == _data->_lastToolTipTag)) { + if (tag == _data->_lastToolTipTag) { [super removeTrackingRect:tag]; _data->_lastToolTipTag = 0; return; } - + // If any other tracking rect is being removed, we don't know how it was created // and it's possible there's a leak involved (see 3500217) ASSERT_NOT_REACHED(); @@ -2001,6 +2042,17 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I [self _updateGrowBoxForWindowFrameChange]; } +#if ENABLE(FULLSCREEN_API) +- (WKFullScreenWindowController*)fullScreenWindowController +{ + if (!_data->_fullScreenWindowController) { + _data->_fullScreenWindowController.adoptNS([[WKFullScreenWindowController alloc] init]); + [_data->_fullScreenWindowController.get() setWebView:self]; + } + return _data->_fullScreenWindowController.get(); +} +#endif + @end @implementation WKView (Private) @@ -2033,5 +2085,19 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I _data->_page->performDictionaryLookupAtLocation(FloatPoint(thePoint.x, thePoint.y)); } +- (NSInteger)spellCheckerDocumentTag +{ + if (!_data->_hasSpellCheckerDocumentTag) { + _data->_spellCheckerDocumentTag = [NSSpellChecker uniqueSpellDocumentTag]; + _data->_hasSpellCheckerDocumentTag = YES; + } + return _data->_spellCheckerDocumentTag; +} + +- (void)handleCorrectionPanelResult:(NSString*)result +{ + _data->_page->handleCorrectionPanelResult(result); +} + @end diff --git a/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h b/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h index 4147658..e4a40f7 100644 --- a/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h +++ b/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h @@ -27,11 +27,20 @@ #import <WebCore/Editor.h> #import <WebCore/KeyboardEvent.h> +namespace CoreIPC { + class DataReference; +} + namespace WebKit { class DrawingAreaProxy; class FindIndicator; + class LayerTreeContext; } +#if ENABLE(FULLSCREEN_API) +@class WKFullScreenWindowController; +#endif + @interface WKView (Internal) - (PassOwnPtr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy; - (BOOL)_isFocused; @@ -44,7 +53,7 @@ namespace WebKit { - (void)_setUserInterfaceItemState:(NSString *)commandName enabled:(BOOL)isEnabled state:(int)newState; - (Vector<WebCore::KeypressCommand>&)_interceptKeyEvent:(NSEvent *)theEvent; - (void)_getTextInputState:(unsigned)start selectionEnd:(unsigned)end underlines:(Vector<WebCore::CompositionUnderline>&)lines; -- (void)_setEventBeingResent:(NSEvent *)event; +- (void)_resendKeyDownEvent:(NSEvent *)event; - (NSRect)_convertToDeviceSpace:(NSRect)rect; - (NSRect)_convertToUserSpace:(NSRect)rect; - (void)_setFindIndicator:(PassRefPtr<WebKit::FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut; @@ -64,4 +73,8 @@ namespace WebKit { - (void)_setDrawingAreaSize:(NSSize)size; - (void)_didChangeScrollbarsForMainFrame; + +#if ENABLE(FULLSCREEN_API) +- (WKFullScreenWindowController*)fullScreenWindowController; +#endif @end diff --git a/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h b/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h index cece1c7..37c2d8d 100644 --- a/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h +++ b/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h @@ -35,4 +35,6 @@ - (void)performDictionaryLookupAtCurrentMouseLocation; +- (NSInteger)spellCheckerDocumentTag; +- (void)handleCorrectionPanelResult:(NSString*)result; @end diff --git a/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp b/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp index 05c7b8b..a162918 100644 --- a/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp +++ b/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp @@ -194,9 +194,9 @@ void QWKPagePrivate::exitAcceleratedCompositingMode() // FIXME: Implement. } -void QWKPagePrivate::pageDidRequestScroll(const IntSize& delta) +void QWKPagePrivate::pageDidRequestScroll(const IntPoint& point) { - emit q->scrollRequested(delta.width(), delta.height()); + emit q->scrollRequested(point.x(), point.y()); } void QWKPagePrivate::didChangeContentsSize(const IntSize& newSize) @@ -222,6 +222,11 @@ FloatRect QWKPagePrivate::convertToDeviceSpace(const FloatRect& rect) return rect; } +IntRect QWKPagePrivate::windowToScreen(const IntRect& rect) +{ + return rect; +} + FloatRect QWKPagePrivate::convertToUserSpace(const FloatRect& rect) { return rect; @@ -482,7 +487,8 @@ QWKPage::QWKPage(QWKContext* context) 0, /* drawFooter */ 0, /* printFrame */ 0, /* runModal */ - 0 /* didCompleteRubberBandForMainFrame */ + 0, /* didCompleteRubberBandForMainFrame */ + 0 /* saveDataToFileInDownloadsFolder */ }; WKPageSetPageUIClient(pageRef(), &uiClient); } @@ -561,7 +567,7 @@ QWKPage::ViewportAttributes QWKPage::viewportAttributesForSize(const QSize& avai result.m_minimumScaleFactor = conf.minimumScale; result.m_maximumScaleFactor = conf.maximumScale; result.m_devicePixelRatio = conf.devicePixelRatio; - result.m_isUserScalable = conf.userScalable; + result.m_isUserScalable = static_cast<bool>(conf.userScalable); return result; } diff --git a/Source/WebKit2/UIProcess/API/qt/qwkpage_p.h b/Source/WebKit2/UIProcess/API/qt/qwkpage_p.h index 1a626a1..ee1fb0e 100644 --- a/Source/WebKit2/UIProcess/API/qt/qwkpage_p.h +++ b/Source/WebKit2/UIProcess/API/qt/qwkpage_p.h @@ -63,7 +63,7 @@ public: virtual void enterAcceleratedCompositingMode(const LayerTreeContext&); virtual void exitAcceleratedCompositingMode(); #endif // USE(ACCELERATED_COMPOSITING) - virtual void pageDidRequestScroll(const WebCore::IntSize&); + virtual void pageDidRequestScroll(const WebCore::IntPoint&); virtual void processDidCrash(); virtual void pageClosed() { } virtual void didRelaunchProcess(); @@ -72,11 +72,14 @@ public: virtual void setCursor(const WebCore::Cursor&); virtual void setViewportArguments(const WebCore::ViewportArguments&); virtual void takeFocus(bool direction); + virtual void setFocus(bool focused) { } virtual void toolTipChanged(const WTF::String&, const WTF::String&); virtual void registerEditCommand(PassRefPtr<WebKit::WebEditCommandProxy>, WebKit::WebPageProxy::UndoOrRedo); virtual void clearAllEditCommands(); virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&); virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&); + virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&); + virtual void doneWithKeyEvent(const WebKit::NativeWebKeyboardEvent&, bool wasEventHandled); virtual void selectionChanged(bool, bool, bool, bool); virtual PassRefPtr<WebKit::WebPopupMenuProxy> createPopupMenuProxy(WebKit::WebPageProxy*); @@ -92,6 +95,8 @@ public: virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects); + virtual float userSpaceScaleFactor() const { return 1; } + void paint(QPainter* painter, QRect); void keyPressEvent(QKeyEvent*); diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp index f26c69d..8cb7263 100644 --- a/Source/WebKit2/UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp +++ b/Source/WebKit2/UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp @@ -35,6 +35,7 @@ private slots: void init(); void cleanup(); + void loadEmptyUrl(); void loadEmptyPage(); private: @@ -83,10 +84,21 @@ void tst_QGraphicsWKView::loadEmptyPage() { m_view->show(); - m_view->m_webView-> load(QUrl::fromLocalFile(TESTDIR "/html/basic_page.html")); + m_view->m_webView-> load(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/basic_page.html"))); QVERIFY(waitForSignal(m_view->m_webView, SIGNAL(loadFinished(bool)))); } +void tst_QGraphicsWKView::loadEmptyUrl() +{ + // That should not crash. + m_view->show(); + m_view->m_webView->load(QUrl()); + QVERIFY(!waitForSignal(m_view->m_webView->page(), SIGNAL(engineConnectionChanged(bool)), 50)); + + m_view->m_webView->load(QUrl(QLatin1String(""))); + QVERIFY(!waitForSignal(m_view->m_webView->page(), SIGNAL(engineConnectionChanged(bool)), 50)); +} + QTEST_MAIN(tst_QGraphicsWKView) #include "tst_qgraphicswkview.moc" diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/qwkpage.pro b/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/qwkpage.pro new file mode 100644 index 0000000..e99c7f4 --- /dev/null +++ b/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/qwkpage.pro @@ -0,0 +1 @@ +include(../tests.pri) diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp new file mode 100644 index 0000000..39fcac2 --- /dev/null +++ b/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp @@ -0,0 +1,59 @@ +/* + Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <QScopedPointer> +#include <QtTest/QtTest> +#include <qwkcontext.h> +#include <qwkpage.h> + +class tst_QWKPage : public QObject { + Q_OBJECT + +private slots: + void init(); + void cleanup(); + + void loadEmptyUrl(); + +private: + QScopedPointer<QWKContext> m_context; + QScopedPointer<QWKPage> m_page; +}; + +void tst_QWKPage::init() +{ + m_context.reset(new QWKContext); + m_page.reset(new QWKPage(m_context.data())); +} + +void tst_QWKPage::cleanup() +{ + m_page.reset(); + m_context.reset(); +} + +void tst_QWKPage::loadEmptyUrl() +{ + m_page->load(QUrl()); + m_page->load(QUrl(QLatin1String(""))); +} + +QTEST_MAIN(tst_QWKPage) + +#include "tst_qwkpage.moc" diff --git a/Source/WebKit2/UIProcess/API/qt/tests/tests.pri b/Source/WebKit2/UIProcess/API/qt/tests/tests.pri index 3a2aac1..032acc3 100644 --- a/Source/WebKit2/UIProcess/API/qt/tests/tests.pri +++ b/Source/WebKit2/UIProcess/API/qt/tests/tests.pri @@ -13,4 +13,4 @@ include(../../../../../WebKit.pri) QT += testlib QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR -DEFINES += TESTDIR=\\\"$$PWD\\\" +!symbian: DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD\\\" diff --git a/Source/WebKit2/UIProcess/API/qt/tests/tests.pro b/Source/WebKit2/UIProcess/API/qt/tests/tests.pro index eb85021..f8db5a4 100644 --- a/Source/WebKit2/UIProcess/API/qt/tests/tests.pro +++ b/Source/WebKit2/UIProcess/API/qt/tests/tests.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -SUBDIRS = qgraphicswkview +SUBDIRS = qgraphicswkview qwkpage diff --git a/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp b/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp index ffe8bac..ecff862 100644 --- a/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp +++ b/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp @@ -36,10 +36,10 @@ namespace WebKit { -AuthenticationChallengeProxy::AuthenticationChallengeProxy(const WebCore::AuthenticationChallenge& authenticationChallenge, uint64_t challengeID, WebPageProxy* page) +AuthenticationChallengeProxy::AuthenticationChallengeProxy(const WebCore::AuthenticationChallenge& authenticationChallenge, uint64_t challengeID, WebProcessProxy* process) : m_coreAuthenticationChallenge(authenticationChallenge) , m_challengeID(challengeID) - , m_page(page) + , m_process(process) { ASSERT(m_challengeID); m_listener = AuthenticationDecisionListener::create(this); @@ -49,8 +49,8 @@ AuthenticationChallengeProxy::~AuthenticationChallengeProxy() { // If an outstanding AuthenticationChallengeProxy is being destroyed even though it hasn't been responded to yet, // we cancel it here so the WebProcess isn't waiting for an answer forever. - if (m_challengeID && m_page->process()) - m_page->process()->send(Messages::AuthenticationManager::CancelChallenge(m_challengeID), m_page->pageID()); + if (m_challengeID) + m_process->send(Messages::AuthenticationManager::CancelChallenge(m_challengeID), 0); if (m_listener) m_listener->detachChallenge(); @@ -62,9 +62,9 @@ void AuthenticationChallengeProxy::useCredential(WebCredential* credential) return; if (!credential) - m_page->process()->send(Messages::AuthenticationManager::ContinueWithoutCredentialForChallenge(m_challengeID), m_page->pageID()); + m_process->send(Messages::AuthenticationManager::ContinueWithoutCredentialForChallenge(m_challengeID), 0); else - m_page->process()->send(Messages::AuthenticationManager::UseCredentialForChallenge(m_challengeID, credential->core()), m_page->pageID()); + m_process->send(Messages::AuthenticationManager::UseCredentialForChallenge(m_challengeID, credential->core()), 0); m_challengeID = 0; } @@ -74,7 +74,7 @@ void AuthenticationChallengeProxy::cancel() if (!m_challengeID) return; - m_page->process()->send(Messages::AuthenticationManager::CancelChallenge(m_challengeID), m_page->pageID()); + m_process->send(Messages::AuthenticationManager::CancelChallenge(m_challengeID), 0); m_challengeID = 0; } diff --git a/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h b/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h index d4e76dd..a429ac5 100644 --- a/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h +++ b/Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h @@ -40,16 +40,16 @@ namespace WebKit { class AuthenticationDecisionListener; class WebCredential; -class WebPageProxy; +class WebProcessProxy; class WebProtectionSpace; class AuthenticationChallengeProxy : public APIObject { public: static const Type APIType = TypeAuthenticationChallenge; - static PassRefPtr<AuthenticationChallengeProxy> create(const WebCore::AuthenticationChallenge& authenticationChallenge, uint64_t challengeID, WebPageProxy* page) + static PassRefPtr<AuthenticationChallengeProxy> create(const WebCore::AuthenticationChallenge& authenticationChallenge, uint64_t challengeID, WebProcessProxy* process) { - return adoptRef(new AuthenticationChallengeProxy(authenticationChallenge, challengeID, page)); + return adoptRef(new AuthenticationChallengeProxy(authenticationChallenge, challengeID, process)); } ~AuthenticationChallengeProxy(); @@ -63,13 +63,13 @@ public: int previousFailureCount() const { return m_coreAuthenticationChallenge.previousFailureCount(); } private: - AuthenticationChallengeProxy(const WebCore::AuthenticationChallenge&, uint64_t challengeID, WebPageProxy* page); + AuthenticationChallengeProxy(const WebCore::AuthenticationChallenge&, uint64_t challengeID, WebProcessProxy*); virtual Type type() const { return APIType; } WebCore::AuthenticationChallenge m_coreAuthenticationChallenge; uint64_t m_challengeID; - RefPtr<WebPageProxy> m_page; + RefPtr<WebProcessProxy> m_process; RefPtr<AuthenticationDecisionListener> m_listener; mutable RefPtr<WebCredential> m_webCredential; mutable RefPtr<WebProtectionSpace> m_webProtectionSpace; diff --git a/Source/WebKit2/UIProcess/BackingStore.cpp b/Source/WebKit2/UIProcess/BackingStore.cpp index f9a2672..5f024e6 100644 --- a/Source/WebKit2/UIProcess/BackingStore.cpp +++ b/Source/WebKit2/UIProcess/BackingStore.cpp @@ -57,9 +57,10 @@ void BackingStore::incorporateUpdate(const UpdateInfo& updateInfo) { // ASSERT(m_size == updateInfo.viewSize); - RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(updateInfo.updateRectBounds.size(), updateInfo.bitmapHandle); + RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(updateInfo.bitmapHandle); if (!bitmap) return; + ASSERT(bitmap->size() == updateInfo.updateRectBounds.size()); incorporateUpdate(bitmap.get(), updateInfo); } diff --git a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp index 55168bc..ad61d33 100644 --- a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp +++ b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "DownloadProxy.h" +#include "AuthenticationChallengeProxy.h" #include "DataReference.h" #include "WebContext.h" #include "WebData.h" @@ -91,6 +92,15 @@ void DownloadProxy::didStart(const ResourceRequest& request) m_webContext->downloadClient().didStart(m_webContext, this); } +void DownloadProxy::didReceiveAuthenticationChallenge(const AuthenticationChallenge& authenticationChallenge, uint64_t challengeID) +{ + if (!m_webContext) + return; + + RefPtr<AuthenticationChallengeProxy> authenticationChallengeProxy = AuthenticationChallengeProxy::create(authenticationChallenge, challengeID, m_webContext->process()); + m_webContext->downloadClient().didReceiveAuthenticationChallenge(m_webContext, this, authenticationChallengeProxy.get()); +} + void DownloadProxy::didReceiveResponse(const ResourceResponse& response) { if (!m_webContext) diff --git a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h index a155d72..2643173 100644 --- a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h +++ b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h @@ -34,6 +34,7 @@ #include <wtf/PassRefPtr.h> namespace WebCore { + class AuthenticationChallenge; class ResourceError; class ResourceResponse; } @@ -69,6 +70,7 @@ private: // Message handlers. void didStart(const WebCore::ResourceRequest&); + void didReceiveAuthenticationChallenge(const WebCore::AuthenticationChallenge&, uint64_t challengeID); void didReceiveResponse(const WebCore::ResourceResponse&); void didReceiveData(uint64_t length); void shouldDecodeSourceDataOfMIMEType(const String& mimeType, bool& result); diff --git a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in index 999080b..d725599 100644 --- a/Source/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in +++ b/Source/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in @@ -22,6 +22,8 @@ messages -> DownloadProxy { DidStart(WebCore::ResourceRequest request) + DidReceiveAuthenticationChallenge(WebCore::AuthenticationChallenge challenge, uint64_t challengeID) + DidReceiveResponse(WebCore::ResourceResponse response) DidReceiveData(uint64_t length) ShouldDecodeSourceDataOfMIMEType(String mimeType) -> (bool result) diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.h b/Source/WebKit2/UIProcess/DrawingAreaProxy.h index 4222c3b..c72cf03 100644 --- a/Source/WebKit2/UIProcess/DrawingAreaProxy.h +++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.h @@ -28,6 +28,7 @@ #define DrawingAreaProxy_h #include "DrawingAreaInfo.h" +#include <stdint.h> #include <WebCore/IntSize.h> #include <wtf/Noncopyable.h> diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in b/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in index 217feaf..78d5724 100644 --- a/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in +++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in @@ -22,9 +22,8 @@ messages -> DrawingAreaProxy { Update(uint64_t stateID, WebKit::UpdateInfo updateInfo) - DidUpdateBackingStoreState(uint64_t backingStoreStateID, WebKit::UpdateInfo updateInfo, WebKit::LayerTreeContext context) - #if USE(ACCELERATED_COMPOSITING) + DidUpdateBackingStoreState(uint64_t backingStoreStateID, WebKit::UpdateInfo updateInfo, WebKit::LayerTreeContext context) EnterAcceleratedCompositingMode(uint64_t backingStoreStateID, WebKit::LayerTreeContext context) ExitAcceleratedCompositingMode(uint64_t backingStoreStateID, WebKit::UpdateInfo updateInfo) #endif diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp index 4cf4d2e..0ee42f4 100644 --- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp +++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp @@ -58,9 +58,11 @@ DrawingAreaProxyImpl::DrawingAreaProxyImpl(WebPageProxy* webPageProxy) DrawingAreaProxyImpl::~DrawingAreaProxyImpl() { +#if USE(ACCELERATED_COMPOSITING) // Make sure to exit accelerated compositing mode. if (isInAcceleratedCompositingMode()) exitAcceleratedCompositingMode(); +#endif } void DrawingAreaProxyImpl::paint(BackingStore::PlatformGraphicsContext context, const IntRect& rect, Region& unpaintedRegion) @@ -162,6 +164,7 @@ void DrawingAreaProxyImpl::didUpdateBackingStoreState(uint64_t backingStoreState if (m_nextBackingStoreStateID != m_currentBackingStoreStateID) sendUpdateBackingStoreState(RespondImmediately); +#if USE(ACCELERATED_COMPOSITING) if (layerTreeContext != m_layerTreeContext) { if (!m_layerTreeContext.isEmpty()) { exitAcceleratedCompositingMode(); @@ -178,6 +181,7 @@ void DrawingAreaProxyImpl::didUpdateBackingStoreState(uint64_t backingStoreState ASSERT(!m_backingStore); return; } +#endif // FIXME: We could just reuse our existing backing store if it's the same size as // updateInfo.viewSize. @@ -191,7 +195,9 @@ void DrawingAreaProxyImpl::enterAcceleratedCompositingMode(uint64_t backingStore if (backingStoreStateID < m_currentBackingStoreStateID) return; +#if USE(ACCELERATED_COMPOSITING) enterAcceleratedCompositingMode(layerTreeContext); +#endif } void DrawingAreaProxyImpl::exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo& updateInfo) @@ -200,7 +206,9 @@ void DrawingAreaProxyImpl::exitAcceleratedCompositingMode(uint64_t backingStoreS if (backingStoreStateID < m_currentBackingStoreStateID) return; +#if USE(ACCELERATED_COMPOSITING) exitAcceleratedCompositingMode(); +#endif incorporateUpdate(updateInfo); } @@ -252,11 +260,13 @@ void DrawingAreaProxyImpl::sendUpdateBackingStoreState(RespondImmediatelyOrNot r m_webPageProxy->process()->send(Messages::DrawingArea::UpdateBackingStoreState(m_nextBackingStoreStateID, respondImmediatelyOrNot == RespondImmediately, m_size, m_scrollOffset), m_webPageProxy->pageID()); m_scrollOffset = IntSize(); +#if USE(ACCELERATED_COMPOSITING) if (m_isWaitingForDidUpdateBackingStoreState && !m_layerTreeContext.isEmpty()) { // Wait for the DidUpdateBackingStoreState message. Normally we don this in DrawingAreaProxyImpl::paint, but that // function is never called when in accelerated compositing mode. waitForAndDispatchDidUpdateBackingStoreState(); } +#endif } void DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState() @@ -268,6 +278,7 @@ void DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState() if (m_webPageProxy->process()->isLaunching()) return; +#if USE(ACCELERATED_COMPOSITING) // FIXME: waitForAndDispatchImmediately will always return the oldest DidUpdateBackingStoreState message that // hasn't yet been processed. But it might be better to skip ahead to some other DidUpdateBackingStoreState // message, if multiple DidUpdateBackingStoreState messages are waiting to be processed. For instance, we could @@ -276,8 +287,10 @@ void DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState() // The timeout, in seconds, we use when waiting for a DidUpdateBackingStoreState message when we're asked to paint. static const double didUpdateBackingStoreStateTimeout = 0.5; m_webPageProxy->process()->connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::DidUpdateBackingStoreState>(m_webPageProxy->pageID(), didUpdateBackingStoreStateTimeout); +#endif } +#if USE(ACCELERATED_COMPOSITING) void DrawingAreaProxyImpl::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext) { ASSERT(!isInAcceleratedCompositingMode()); @@ -294,6 +307,7 @@ void DrawingAreaProxyImpl::exitAcceleratedCompositingMode() m_layerTreeContext = LayerTreeContext(); m_webPageProxy->exitAcceleratedCompositingMode(); } +#endif void DrawingAreaProxyImpl::discardBackingStoreSoon() { diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h index 17c7512..11e430c 100644 --- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h +++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h @@ -68,10 +68,14 @@ private: void sendUpdateBackingStoreState(RespondImmediatelyOrNot); void waitForAndDispatchDidUpdateBackingStoreState(); +#if USE(ACCELERATED_COMPOSITING) void enterAcceleratedCompositingMode(const LayerTreeContext&); void exitAcceleratedCompositingMode(); bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); } +#else + bool isInAcceleratedCompositingMode() const { return false; } +#endif void discardBackingStoreSoon(); void discardBackingStore(); @@ -85,9 +89,11 @@ private: // whenever our state changes in a way that will require a new backing store to be allocated. uint64_t m_nextBackingStoreStateID; +#if USE(ACCELERATED_COMPOSITING) // The current layer tree context. LayerTreeContext m_layerTreeContext; - +#endif + // Whether we've sent a UpdateBackingStoreState message and are now waiting for a DidUpdateBackingStoreState message. // Used to throttle UpdateBackingStoreState messages so we don't send them faster than the Web process can handle. bool m_isWaitingForDidUpdateBackingStoreState; diff --git a/Source/WebKit2/UIProcess/FindIndicator.cpp b/Source/WebKit2/UIProcess/FindIndicator.cpp index d6ac461..d30fb8d 100644 --- a/Source/WebKit2/UIProcess/FindIndicator.cpp +++ b/Source/WebKit2/UIProcess/FindIndicator.cpp @@ -77,11 +77,12 @@ static const int gradientLightAlpha = 255; namespace WebKit { -PassRefPtr<FindIndicator> FindIndicator::create(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, const SharedMemory::Handle& contentImageHandle) +PassRefPtr<FindIndicator> FindIndicator::create(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, const ShareableBitmap::Handle& contentImageHandle) { - RefPtr<ShareableBitmap> contentImage = ShareableBitmap::create(enclosingIntRect(selectionRectInWindowCoordinates).size(), contentImageHandle); + RefPtr<ShareableBitmap> contentImage = ShareableBitmap::create(contentImageHandle); if (!contentImage) return 0; + ASSERT(contentImage->size() == enclosingIntRect(selectionRectInWindowCoordinates).size()); return adoptRef(new FindIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImage.release())); } diff --git a/Source/WebKit2/UIProcess/FindIndicator.h b/Source/WebKit2/UIProcess/FindIndicator.h index 69088ce..49d07da 100644 --- a/Source/WebKit2/UIProcess/FindIndicator.h +++ b/Source/WebKit2/UIProcess/FindIndicator.h @@ -26,7 +26,7 @@ #ifndef FindIndicator_h #define FindIndicator_h -#include "SharedMemory.h" +#include "ShareableBitmap.h" #include <WebCore/FloatRect.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> @@ -38,11 +38,9 @@ namespace WebCore { namespace WebKit { -class ShareableBitmap; - class FindIndicator : public RefCounted<FindIndicator> { public: - static PassRefPtr<FindIndicator> create(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, const SharedMemory::Handle& contentImageHandle); + static PassRefPtr<FindIndicator> create(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, const ShareableBitmap::Handle& contentImageHandle); ~FindIndicator(); WebCore::FloatRect selectionRectInWindowCoordinates() const { return m_selectionRectInWindowCoordinates; } diff --git a/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h b/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h index 8a1cd01..8dbfb11 100644 --- a/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h +++ b/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h @@ -37,7 +37,7 @@ class QLocalSocket; namespace WebKit { -class ProcessLauncher : public ThreadSafeShared<ProcessLauncher> { +class ProcessLauncher : public ThreadSafeRefCounted<ProcessLauncher> { public: class Client { public: diff --git a/Source/WebKit2/UIProcess/Launcher/ThreadLauncher.h b/Source/WebKit2/UIProcess/Launcher/ThreadLauncher.h index 9c90fbd..f3a5312 100644 --- a/Source/WebKit2/UIProcess/Launcher/ThreadLauncher.h +++ b/Source/WebKit2/UIProcess/Launcher/ThreadLauncher.h @@ -37,7 +37,7 @@ class QLocalSocket; namespace WebKit { -class ThreadLauncher : public ThreadSafeShared<ThreadLauncher> { +class ThreadLauncher : public ThreadSafeRefCounted<ThreadLauncher> { public: class Client { public: diff --git a/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm b/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm index af758d9..a1e8f5c 100644 --- a/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm +++ b/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm @@ -200,8 +200,13 @@ void ProcessLauncher::launchProcess() NSString *frameworksPath = [[webKit2Bundle bundlePath] stringByDeletingLastPathComponent]; const char* frameworkExecutablePath = [[webKit2Bundle executablePath] fileSystemRepresentation]; - NSString *webProcessAppPath = [webKit2Bundle pathForAuxiliaryExecutable:@"WebProcess.app"]; - NSString *webProcessAppExecutablePath = [[NSBundle bundleWithPath:webProcessAppPath] executablePath]; + NSString *processPath; + if (m_launchOptions.processType == ProcessLauncher::PluginProcess) + processPath = [webKit2Bundle pathForAuxiliaryExecutable:@"PluginProcess.app"]; + else + processPath = [webKit2Bundle pathForAuxiliaryExecutable:@"WebProcess.app"]; + + NSString *processAppExecutablePath = [[NSBundle bundleWithPath:processPath] executablePath]; RetainPtr<CFStringRef> cfLocalization(AdoptCF, WKCopyCFLocalizationPreferredName(NULL)); CString localization = String(cfLocalization.get()).utf8(); @@ -209,7 +214,7 @@ void ProcessLauncher::launchProcess() // Make a unique, per pid, per process launcher web process service name. CString serviceName = String::format("com.apple.WebKit.WebProcess-%d-%p", getpid(), this).utf8(); - const char* args[] = { [webProcessAppExecutablePath fileSystemRepresentation], frameworkExecutablePath, "-type", processTypeAsString(m_launchOptions.processType), "-servicename", serviceName.data(), "-localization", localization.data(), 0 }; + const char* args[] = { [processAppExecutablePath fileSystemRepresentation], frameworkExecutablePath, "-type", processTypeAsString(m_launchOptions.processType), "-servicename", serviceName.data(), "-localization", localization.data(), 0 }; // Register ourselves. kern_return_t kr = bootstrap_register2(bootstrap_port, const_cast<char*>(serviceName.data()), listeningPort, 0); @@ -259,7 +264,7 @@ void ProcessLauncher::launchProcess() if (m_launchOptions.processType == ProcessLauncher::PluginProcess) { // We need to insert the plug-in process shim. - NSString *pluginProcessShimPathNSString = [[webProcessAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"PluginProcessShim.dylib"]; + NSString *pluginProcessShimPathNSString = [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"PluginProcessShim.dylib"]; const char* pluginProcessShimPath = [pluginProcessShimPathNSString fileSystemRepresentation]; // Make sure that the file exists. diff --git a/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp b/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp index 1e7e14a..cae5bdf 100644 --- a/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp +++ b/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp @@ -75,18 +75,22 @@ protected: void QtWebProcess::setupChildProcess() { #if defined Q_OS_LINUX +#ifndef NDEBUG + if (getenv("QT_WEBKIT_KEEP_ALIVE_WEB_PROCESS")) + return; +#endif prctl(PR_SET_PDEATHSIG, SIGKILL); #endif } void ProcessLauncher::launchProcess() { - QString applicationPath = "%1 %2"; + QString applicationPath = QLatin1String("%1 %2"); - if (QFile::exists(QCoreApplication::applicationDirPath() + "/QtWebProcess")) { - applicationPath = applicationPath.arg(QCoreApplication::applicationDirPath() + "/QtWebProcess"); + if (QFile::exists(QCoreApplication::applicationDirPath() + QLatin1String("/QtWebProcess"))) { + applicationPath = applicationPath.arg(QCoreApplication::applicationDirPath() + QLatin1String("/QtWebProcess")); } else { - applicationPath = applicationPath.arg("QtWebProcess"); + applicationPath = applicationPath.arg(QLatin1String("QtWebProcess")); } int sockets[2]; diff --git a/Source/WebKit2/UIProcess/PageClient.h b/Source/WebKit2/UIProcess/PageClient.h index 59e02ca..83ce502 100644 --- a/Source/WebKit2/UIProcess/PageClient.h +++ b/Source/WebKit2/UIProcess/PageClient.h @@ -81,11 +81,12 @@ public: virtual void didRelaunchProcess() = 0; virtual void pageClosed() = 0; + virtual void setFocus(bool focused) = 0; virtual void takeFocus(bool direction) = 0; virtual void toolTipChanged(const String&, const String&) = 0; #if ENABLE(TILED_BACKING_STORE) - virtual void pageDidRequestScroll(const WebCore::IntSize&) = 0; + virtual void pageDidRequestScroll(const WebCore::IntPoint&) = 0; #endif #if PLATFORM(QT) virtual void didChangeContentsSize(const WebCore::IntSize&) = 0; @@ -100,14 +101,15 @@ public: #if PLATFORM(MAC) virtual void accessibilityWebProcessTokenReceived(const CoreIPC::DataReference&) = 0; virtual void interceptKeyEvent(const NativeWebKeyboardEvent&, Vector<WebCore::KeypressCommand>& commandName, uint32_t selectionStart, uint32_t selectionEnd, Vector<WebCore::CompositionUnderline>& underlines) = 0; - virtual void setDragImage(const WebCore::IntPoint& clientPosition, const WebCore::IntSize& imageSize, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag) = 0; + virtual void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag) = 0; #endif #if PLATFORM(WIN) virtual void compositionSelectionChanged(bool) = 0; #endif virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) = 0; virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) = 0; - + virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) = 0; + virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) = 0; virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) = 0; @@ -126,9 +128,12 @@ public: #if PLATFORM(MAC) virtual void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled) = 0; - virtual void setAutodisplay(bool) = 0; virtual CGContextRef containingWindowGraphicsContext() = 0; virtual void didPerformDictionaryLookup(const String&, double scaleFactor, const DictionaryPopupInfo&) = 0; + virtual void showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) = 0; + virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel) = 0; + virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingCorrectionPanel) = 0; + virtual void recordAutocorrectionResponse(WebCore::EditorClient::AutocorrectionResponseType, const String& replacedString, const String& replacementString) = 0; #endif virtual void didChangeScrollbarsForMainFrame() const = 0; @@ -140,6 +145,8 @@ public: virtual void setCustomRepresentationZoomFactor(double) = 0; virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects) = 0; + + virtual float userSpaceScaleFactor() const = 0; }; } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp index c63d500..f167747 100644 --- a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp +++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp @@ -38,16 +38,6 @@ #include "WebProcessProxy.h" namespace WebKit { - -#if PLATFORM(MAC) -static bool pluginNeedsExecutableHeap(const PluginInfoStore::Plugin& pluginInfo) -{ - if (pluginInfo.bundleIdentifier == "com.apple.QuickTime Plugin.plugin") - return false; - - return true; -} -#endif PassOwnPtr<PluginProcessProxy> PluginProcessProxy::create(PluginProcessManager* PluginProcessManager, const PluginInfoStore::Plugin& pluginInfo) { @@ -58,12 +48,16 @@ PluginProcessProxy::PluginProcessProxy(PluginProcessManager* PluginProcessManage : m_pluginProcessManager(PluginProcessManager) , m_pluginInfo(pluginInfo) , m_numPendingConnectionRequests(0) +#if PLATFORM(MAC) + , m_modalWindowIsShowing(false) + , m_fullscreenWindowIsShowing(false) +#endif { ProcessLauncher::LaunchOptions launchOptions; launchOptions.processType = ProcessLauncher::PluginProcess; #if PLATFORM(MAC) launchOptions.architecture = pluginInfo.pluginArchitecture; - launchOptions.executableHeap = pluginNeedsExecutableHeap(pluginInfo); + launchOptions.executableHeap = PluginProcessProxy::pluginNeedsExecutableHeap(pluginInfo); #endif m_processLauncher = ProcessLauncher::create(this, launchOptions); @@ -153,6 +147,14 @@ void PluginProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, Core void PluginProcessProxy::didClose(CoreIPC::Connection*) { +#if PLATFORM(MAC) + if (m_modalWindowIsShowing) + endModal(); + + if (m_fullscreenWindowIsShowing) + exitFullscreen(); +#endif + pluginProcessCrashedOrFailedToLaunch(); } diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h index 2ea2573..e285d64 100644 --- a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h +++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h @@ -33,6 +33,12 @@ #include "ProcessLauncher.h" #include <wtf/Deque.h> +#if PLATFORM(MAC) +#include <wtf/RetainPtr.h> +OBJC_CLASS NSObject; +OBJC_CLASS WKPlaceholderModalWindow; +#endif + // FIXME: This is platform specific. namespace CoreIPC { class MachPort; @@ -47,6 +53,9 @@ struct PluginProcessCreationParameters; class PluginProcessProxy : CoreIPC::Connection::Client, ProcessLauncher::Client { public: +#if PLATFORM(MAC) + static bool pluginNeedsExecutableHeap(const PluginInfoStore::Plugin&); +#endif static PassOwnPtr<PluginProcessProxy> create(PluginProcessManager*, const PluginInfoStore::Plugin&); ~PluginProcessProxy(); @@ -81,6 +90,22 @@ private: void didGetSitesWithData(const Vector<String>& sites, uint64_t callbackID); void didClearSiteData(uint64_t callbackID); +#if PLATFORM(MAC) + bool getPluginProcessSerialNumber(ProcessSerialNumber&); + void makePluginProcessTheFrontProcess(); + void makeUIProcessTheFrontProcess(); + + void setFullscreenWindowIsShowing(bool); + void enterFullscreen(); + void exitFullscreen(); + + void setModalWindowIsShowing(bool); + void beginModal(); + void endModal(); + + void applicationDidBecomeActive(); +#endif + void platformInitializePluginProcess(PluginProcessCreationParameters& parameters); // The plug-in host process manager. @@ -112,6 +137,13 @@ private: // If createPluginConnection is called while the process is still launching we'll keep count of it and send a bunch of requests // when the process finishes launching. unsigned m_numPendingConnectionRequests; + +#if PLATFORM(MAC) + RetainPtr<NSObject> m_activationObserver; + RetainPtr<WKPlaceholderModalWindow *> m_placeholderWindow; + bool m_modalWindowIsShowing; + bool m_fullscreenWindowIsShowing; +#endif }; } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.messages.in b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.messages.in index a504f9a..5fcbe71 100644 --- a/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.messages.in +++ b/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.messages.in @@ -28,6 +28,11 @@ messages -> PluginProcessProxy { DidGetSitesWithData(Vector<WTF::String> sites, uint64_t callbackID) DidClearSiteData(uint64_t callbackID) + +#if PLATFORM(MAC) + SetModalWindowIsShowing(bool modalWindowIsShowing) + SetFullscreenWindowIsShowing(bool fullscreenWindowIsShowing) +#endif } #endif diff --git a/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp b/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp index dfa0806..5f56d0b 100644 --- a/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp +++ b/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp @@ -163,11 +163,7 @@ void WebPluginSiteDataManager::getSitesWithData(PassRefPtr<ArrayCallback> prpCal m_pendingGetSitesWithData.set(callbackID, state); state->getSitesWithDataForNextPlugin(); #else - if (!m_webContext->hasValidProcess()) { - RefPtr<ArrayCallback> callback = m_arrayCallbacks.take(callbackID); - callback->invalidate(); - return; - } + m_webContext->relaunchProcessIfNecessary(); Vector<String> pluginPaths; m_webContext->pluginInfoStore()->getPluginPaths(pluginPaths); @@ -227,11 +223,7 @@ void WebPluginSiteDataManager::clearSiteData(ImmutableArray* sites, uint64_t fla state->clearSiteDataForNextPlugin(); #else - if (!m_webContext->hasValidProcess()) { - RefPtr<VoidCallback> callback = m_voidCallbacks.take(callbackID); - callback->invalidate(); - return; - } + m_webContext->relaunchProcessIfNecessary(); Vector<String> pluginPaths; m_webContext->pluginInfoStore()->getPluginPaths(pluginPaths); m_webContext->ensureWebProcess(); diff --git a/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm b/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm index 2adc473..8375fd2 100644 --- a/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm +++ b/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm @@ -31,7 +31,33 @@ #import "PluginProcessCreationParameters.h" #import "WebKitSystemInterface.h" +@interface WKPlaceholderModalWindow : NSWindow +@end + +@implementation WKPlaceholderModalWindow + +// Prevent NSApp from calling requestUserAttention: when the window is shown +// modally, even if the app is inactive. See 6823049. +- (BOOL)_wantsUserAttention +{ + return NO; +} + +@end + namespace WebKit { + +bool PluginProcessProxy::pluginNeedsExecutableHeap(const PluginInfoStore::Plugin& pluginInfo) +{ + static bool forceNonexecutableHeapForPlugins = [[NSUserDefaults standardUserDefaults] boolForKey:@"ForceNonexecutableHeapForPlugins"]; + if (forceNonexecutableHeapForPlugins) + return false; + + if (pluginInfo.bundleIdentifier == "com.apple.QuickTime Plugin.plugin") + return false; + + return true; +} void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationParameters& parameters) { @@ -41,7 +67,117 @@ void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationPa if (renderServerPort != MACH_PORT_NULL) parameters.acceleratedCompositingPort = CoreIPC::MachPort(renderServerPort, MACH_MSG_TYPE_COPY_SEND); #endif -} +} + +bool PluginProcessProxy::getPluginProcessSerialNumber(ProcessSerialNumber& pluginProcessSerialNumber) +{ + pid_t pluginProcessPID = m_processLauncher->processIdentifier(); + return GetProcessForPID(pluginProcessPID, &pluginProcessSerialNumber) == noErr; +} + +void PluginProcessProxy::makePluginProcessTheFrontProcess() +{ + ProcessSerialNumber pluginProcessSerialNumber; + if (!getPluginProcessSerialNumber(pluginProcessSerialNumber)) + return; + + SetFrontProcess(&pluginProcessSerialNumber); +} + +void PluginProcessProxy::makeUIProcessTheFrontProcess() +{ + ProcessSerialNumber processSerialNumber; + GetCurrentProcess(&processSerialNumber); + SetFrontProcess(&processSerialNumber); +} + +void PluginProcessProxy::setFullscreenWindowIsShowing(bool fullscreenWindowIsShowing) +{ + if (m_fullscreenWindowIsShowing == fullscreenWindowIsShowing) + return; + + m_fullscreenWindowIsShowing = fullscreenWindowIsShowing; + if (m_fullscreenWindowIsShowing) + enterFullscreen(); + else + exitFullscreen(); +} + +void PluginProcessProxy::enterFullscreen() +{ + [NSMenu setMenuBarVisible:NO]; + + makePluginProcessTheFrontProcess(); +} + +void PluginProcessProxy::exitFullscreen() +{ + [NSMenu setMenuBarVisible:YES]; + + // If the plug-in host is the current application then we should bring ourselves to the front when it exits full-screen mode. + + ProcessSerialNumber frontProcessSerialNumber; + GetFrontProcess(&frontProcessSerialNumber); + Boolean isSameProcess = 0; + + ProcessSerialNumber pluginProcessSerialNumber; + if (!getPluginProcessSerialNumber(pluginProcessSerialNumber)) + return; + + SameProcess(&frontProcessSerialNumber, &pluginProcessSerialNumber, &isSameProcess); + if (!isSameProcess) + return; + + makeUIProcessTheFrontProcess(); +} + +void PluginProcessProxy::setModalWindowIsShowing(bool modalWindowIsShowing) +{ + if (modalWindowIsShowing == m_modalWindowIsShowing) + return; + + m_modalWindowIsShowing = modalWindowIsShowing; + + if (m_modalWindowIsShowing) + beginModal(); + else + endModal(); +} + +void PluginProcessProxy::beginModal() +{ + ASSERT(!m_placeholderWindow); + ASSERT(!m_activationObserver); + + m_placeholderWindow.adoptNS([[WKPlaceholderModalWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]); + + m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationWillBecomeActiveNotification object:NSApp queue:nil + usingBlock:^(NSNotification *){ applicationDidBecomeActive(); }]; + + [NSApp runModalForWindow:m_placeholderWindow.get()]; + + [m_placeholderWindow.get() orderOut:nil]; + m_placeholderWindow = nullptr; +} + +void PluginProcessProxy::endModal() +{ + ASSERT(m_placeholderWindow); + ASSERT(m_activationObserver); + + [[NSNotificationCenter defaultCenter] removeObserver:m_activationObserver.get()]; + m_activationObserver = nullptr; + + [NSApp stopModal]; + + makeUIProcessTheFrontProcess(); +} + +void PluginProcessProxy::applicationDidBecomeActive() +{ + makePluginProcessTheFrontProcess(); +} + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp b/Source/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp index 2138131..f695969 100644 --- a/Source/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp +++ b/Source/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp @@ -27,6 +27,7 @@ #include "PluginInfoStore.h" #include "NetscapePluginModule.h" +#include <WebCore/PathWalker.h> #include <shlwapi.h> using namespace WebCore; @@ -254,37 +255,11 @@ Vector<String> PluginInfoStore::pluginsDirectories() return directories; } -class PathWalker { - WTF_MAKE_NONCOPYABLE(PathWalker); -public: - PathWalker(const String& directory) - { - String pattern = directory + "\\*"; - m_handle = ::FindFirstFileW(pattern.charactersWithNullTermination(), &m_data); - } - - ~PathWalker() - { - if (!isValid()) - return; - ::FindClose(m_handle); - } - - bool isValid() const { return m_handle != INVALID_HANDLE_VALUE; } - const WIN32_FIND_DATAW& data() const { return m_data; } - - bool step() { return ::FindNextFileW(m_handle, &m_data); } - -private: - HANDLE m_handle; - WIN32_FIND_DATAW m_data; -}; - Vector<String> PluginInfoStore::pluginPathsInDirectory(const String& directory) { Vector<String> paths; - PathWalker walker(directory); + PathWalker walker(directory, "*"); if (!walker.isValid()) return paths; @@ -385,6 +360,11 @@ bool PluginInfoStore::shouldUsePlugin(const Plugin& plugin) return false; } + if (equalIgnoringCase(plugin.info.file, "npwpf.dll")) { + // Bug 57119: Microsoft Windows Presentation Foundation (WPF) plug-in complains about missing xpcom.dll + return false; + } + if (plugin.info.name == "Yahoo Application State Plugin") { // https://bugs.webkit.org/show_bug.cgi?id=26860 // Bug in Yahoo Application State plug-in earlier than 1.0.0.6 leads to heap corruption. diff --git a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp index 1cf4921..6b24940 100644 --- a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp +++ b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp @@ -52,6 +52,11 @@ void WebApplicationCacheManagerProxy::invalidate() invalidateCallbackMap(m_arrayCallbacks); } +bool WebApplicationCacheManagerProxy::shouldTerminate(WebProcessProxy*) const +{ + return m_arrayCallbacks.isEmpty(); +} + void WebApplicationCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) { didReceiveWebApplicationCacheManagerProxyMessage(connection, messageID, arguments); @@ -60,10 +65,7 @@ void WebApplicationCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* con void WebApplicationCacheManagerProxy::getApplicationCacheOrigins(PassRefPtr<ArrayCallback> prpCallback) { RefPtr<ArrayCallback> callback = prpCallback; - if (!m_webContext->hasValidProcess()) { - callback->invalidate(); - return; - } + m_webContext->relaunchProcessIfNecessary(); uint64_t callbackID = callback->callbackID(); m_arrayCallbacks.set(callbackID, callback.release()); @@ -78,8 +80,7 @@ void WebApplicationCacheManagerProxy::didGetApplicationCacheOrigins(const Vector void WebApplicationCacheManagerProxy::deleteEntriesForOrigin(WebSecurityOrigin* origin) { - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); SecurityOriginData securityOriginData; securityOriginData.protocol = origin->protocol(); @@ -91,8 +92,7 @@ void WebApplicationCacheManagerProxy::deleteEntriesForOrigin(WebSecurityOrigin* void WebApplicationCacheManagerProxy::deleteAllEntries() { - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); m_webContext->process()->send(Messages::WebApplicationCacheManager::DeleteAllEntries(), 0); } diff --git a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h index 81637e0..b3dca15 100644 --- a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h +++ b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h @@ -44,6 +44,7 @@ namespace WebKit { struct SecurityOriginData; class WebContext; +class WebProcessProxy; class WebSecurityOrigin; typedef GenericCallback<WKArrayRef> ArrayCallback; @@ -64,6 +65,8 @@ public: void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + bool shouldTerminate(WebProcessProxy*) const; + private: WebApplicationCacheManagerProxy(WebContext*); diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp index 01b1e0c..0609d68 100644 --- a/Source/WebKit2/UIProcess/WebContext.cpp +++ b/Source/WebKit2/UIProcess/WebContext.cpp @@ -29,6 +29,7 @@ #include "DownloadProxy.h" #include "ImmutableArray.h" #include "InjectedBundleMessageKinds.h" +#include "Logging.h" #include "RunLoop.h" #include "SandboxExtension.h" #include "TextChecker.h" @@ -40,7 +41,9 @@ #include "WebCoreArgumentCoders.h" #include "WebDatabaseManagerProxy.h" #include "WebGeolocationManagerProxy.h" +#include "WebIconDatabase.h" #include "WebKeyValueStorageManagerProxy.h" +#include "WebMediaCacheManagerProxy.h" #include "WebPluginSiteDataManager.h" #include "WebPageGroup.h" #include "WebMemorySampler.h" @@ -116,13 +119,20 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa , m_cookieManagerProxy(WebCookieManagerProxy::create(this)) , m_databaseManagerProxy(WebDatabaseManagerProxy::create(this)) , m_geolocationManagerProxy(WebGeolocationManagerProxy::create(this)) + , m_iconDatabase(WebIconDatabase::create(this)) , m_keyValueStorageManagerProxy(WebKeyValueStorageManagerProxy::create(this)) + , m_mediaCacheManagerProxy(WebMediaCacheManagerProxy::create(this)) , m_pluginSiteDataManager(WebPluginSiteDataManager::create(this)) , m_resourceCacheManagerProxy(WebResourceCacheManagerProxy::create(this)) #if PLATFORM(WIN) , m_shouldPaintNativeControls(true) + , m_initialHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyAlways) #endif { +#ifndef NDEBUG + WebKit::initializeLogChannelsIfNecessary(); +#endif + contexts().append(this); addLanguageChangeObserver(this, languageChanged); @@ -147,21 +157,29 @@ WebContext::~WebContext() m_cookieManagerProxy->invalidate(); m_cookieManagerProxy->clearContext(); + m_databaseManagerProxy->invalidate(); + m_databaseManagerProxy->clearContext(); + m_geolocationManagerProxy->invalidate(); m_geolocationManagerProxy->clearContext(); - m_databaseManagerProxy->invalidate(); - m_databaseManagerProxy->clearContext(); + m_iconDatabase->invalidate(); + m_iconDatabase->clearContext(); m_keyValueStorageManagerProxy->invalidate(); m_keyValueStorageManagerProxy->clearContext(); + m_mediaCacheManagerProxy->invalidate(); + m_mediaCacheManagerProxy->clearContext(); + m_pluginSiteDataManager->invalidate(); m_pluginSiteDataManager->clearContext(); m_resourceCacheManagerProxy->invalidate(); m_resourceCacheManagerProxy->clearContext(); + platformInvalidateContext(); + #ifndef NDEBUG webContextCounter.decrement(); #endif @@ -222,6 +240,7 @@ void WebContext::ensureWebProcess() parameters.languageCode = defaultLanguage(); parameters.applicationCacheDirectory = applicationCacheDirectory(); parameters.databaseDirectory = databaseDirectory(); + parameters.localStorageDirectory = localStorageDirectory(); parameters.clearResourceCaches = m_clearResourceCachesForNewWebProcess; parameters.clearApplicationCache = m_clearApplicationCacheForNewWebProcess; #if PLATFORM(MAC) @@ -236,6 +255,8 @@ void WebContext::ensureWebProcess() copyToVector(m_schemesToSetDomainRelaxationForbiddenFor, parameters.urlSchemesForWhichDomainRelaxationIsForbidden); parameters.shouldAlwaysUseComplexTextCodePath = m_alwaysUsesComplexTextCodePath; + + parameters.iconDatabaseEnabled = !iconDatabasePath().isEmpty(); parameters.textCheckerState = TextChecker::state(); @@ -261,8 +282,20 @@ bool WebContext::shouldTerminate(WebProcessProxy* process) if (!m_downloads.isEmpty()) return false; + if (!m_applicationCacheManagerProxy->shouldTerminate(process)) + return false; + if (!m_cookieManagerProxy->shouldTerminate(process)) + return false; + if (!m_databaseManagerProxy->shouldTerminate(process)) + return false; + if (!m_keyValueStorageManagerProxy->shouldTerminate(process)) + return false; + if (!m_mediaCacheManagerProxy->shouldTerminate(process)) + return false; if (!m_pluginSiteDataManager->shouldTerminate(process)) return false; + if (!m_resourceCacheManagerProxy->shouldTerminate(process)) + return false; return true; } @@ -306,6 +339,7 @@ void WebContext::disconnectProcess(WebProcessProxy* process) m_databaseManagerProxy->invalidate(); m_geolocationManagerProxy->invalidate(); m_keyValueStorageManagerProxy->invalidate(); + m_mediaCacheManagerProxy->invalidate(); m_resourceCacheManagerProxy->invalidate(); // When out of process plug-ins are enabled, we don't want to invalidate the plug-in site data @@ -590,12 +624,22 @@ void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes m_geolocationManagerProxy->didReceiveMessage(connection, messageID, arguments); return; } + + if (messageID.is<CoreIPC::MessageClassWebIconDatabase>()) { + m_iconDatabase->didReceiveMessage(connection, messageID, arguments); + return; + } if (messageID.is<CoreIPC::MessageClassWebKeyValueStorageManagerProxy>()) { m_keyValueStorageManagerProxy->didReceiveMessage(connection, messageID, arguments); return; } + if (messageID.is<CoreIPC::MessageClassWebMediaCacheManagerProxy>()) { + m_mediaCacheManagerProxy->didReceiveMessage(connection, messageID, arguments); + return; + } + if (messageID.is<CoreIPC::MessageClassWebResourceCacheManagerProxy>()) { m_resourceCacheManagerProxy->didReceiveWebResourceCacheManagerProxyMessage(connection, messageID, arguments); return; @@ -631,6 +675,9 @@ CoreIPC::SyncReplyMode WebContext::didReceiveSyncMessage(CoreIPC::Connection* co return CoreIPC::AutomaticReply; } + if (messageID.is<CoreIPC::MessageClassWebIconDatabase>()) + return m_iconDatabase->didReceiveSyncMessage(connection, messageID, arguments, reply); + switch (messageID.get<WebContextLegacyMessage::Kind>()) { case WebContextLegacyMessage::PostSynchronousMessage: { // FIXME: We should probably encode something in the case that the arguments do not decode correctly. @@ -653,17 +700,20 @@ CoreIPC::SyncReplyMode WebContext::didReceiveSyncMessage(CoreIPC::Connection* co return CoreIPC::AutomaticReply; } -void WebContext::clearResourceCaches() +void WebContext::clearResourceCaches(ResourceCachesToClear cachesToClear) { - if (!hasValidProcess()) { - // FIXME <rdar://problem/8727879>: Setting this flag ensures that the next time a WebProcess is created, this request to - // clear the resource cache will be respected. But if the user quits the application before another WebProcess is created, - // their request will be ignored. - m_clearResourceCachesForNewWebProcess = true; + if (hasValidProcess()) { + m_process->send(Messages::WebProcess::ClearResourceCaches(cachesToClear), 0); return; } - m_process->send(Messages::WebProcess::ClearResourceCaches(), 0); + if (cachesToClear == InMemoryResourceCachesOnly) + return; + + // FIXME <rdar://problem/8727879>: Setting this flag ensures that the next time a WebProcess is created, this request to + // clear the resource cache will be respected. But if the user quits the application before another WebProcess is created, + // their request will be ignored. + m_clearResourceCachesForNewWebProcess = true; } void WebContext::clearApplicationCache() @@ -678,6 +728,14 @@ void WebContext::clearApplicationCache() m_process->send(Messages::WebProcess::ClearApplicationCache(), 0); } + +void WebContext::setEnhancedAccessibility(bool flag) +{ + if (!hasValidProcess()) + return; + + m_process->send(Messages::WebProcess::SetEnhancedAccessibility(flag), 0); +} void WebContext::startMemorySampler(const double interval) { @@ -726,4 +784,26 @@ String WebContext::databaseDirectory() const return platformDefaultDatabaseDirectory(); } +void WebContext::setIconDatabasePath(const String& path) +{ + m_overrideIconDatabasePath = path; + m_iconDatabase->setDatabasePath(path); +} + +String WebContext::iconDatabasePath() const +{ + if (!m_overrideIconDatabasePath.isEmpty()) + return m_overrideIconDatabasePath; + + return platformDefaultIconDatabasePath(); +} + +String WebContext::localStorageDirectory() const +{ + if (!m_overrideLocalStorageDirectory.isEmpty()) + return m_overrideLocalStorageDirectory; + + return platformDefaultLocalStorageDirectory(); +} + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/WebContext.h b/Source/WebKit2/UIProcess/WebContext.h index 72cd5dc..a9ba22f 100644 --- a/Source/WebKit2/UIProcess/WebContext.h +++ b/Source/WebKit2/UIProcess/WebContext.h @@ -49,7 +49,9 @@ class WebApplicationCacheManagerProxy; class WebCookieManagerProxy; class WebDatabaseManagerProxy; class WebGeolocationManagerProxy; +class WebIconDatabase; class WebKeyValueStorageManagerProxy; +class WebMediaCacheManagerProxy; class WebPageGroup; class WebPageProxy; class WebResourceCacheManagerProxy; @@ -118,7 +120,7 @@ public: void setCacheModel(CacheModel); CacheModel cacheModel() const { return m_cacheModel; } - void clearResourceCaches(); + void clearResourceCaches(ResourceCachesToClear); void clearApplicationCache(); void setDefaultRequestTimeoutInterval(double); @@ -128,8 +130,12 @@ public: #if PLATFORM(WIN) void setShouldPaintNativeControls(bool); + + void setInitialHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy) { m_initialHTTPCookieAcceptPolicy = policy; } #endif + void setEnhancedAccessibility(bool); + // Downloads. uint64_t createDownloadProxy(); WebDownloadClient& downloadClient() { return m_downloadClient; } @@ -141,7 +147,9 @@ public: WebCookieManagerProxy* cookieManagerProxy() const { return m_cookieManagerProxy.get(); } WebDatabaseManagerProxy* databaseManagerProxy() const { return m_databaseManagerProxy.get(); } WebGeolocationManagerProxy* geolocationManagerProxy() const { return m_geolocationManagerProxy.get(); } + WebIconDatabase* iconDatabase() const { return m_iconDatabase.get(); } WebKeyValueStorageManagerProxy* keyValueStorageManagerProxy() const { return m_keyValueStorageManagerProxy.get(); } + WebMediaCacheManagerProxy* mediaCacheManagerProxy() const { return m_mediaCacheManagerProxy.get(); } WebPluginSiteDataManager* pluginSiteDataManager() const { return m_pluginSiteDataManager.get(); } WebResourceCacheManagerProxy* resourceCacheManagerProxy() const { return m_resourceCacheManagerProxy.get(); } @@ -150,9 +158,11 @@ public: unsigned wkPageCount; unsigned wkFrameCount; }; - static Statistics& statistics(); + static Statistics& statistics(); void setDatabaseDirectory(const String& dir) { m_overrideDatabaseDirectory = dir; } + void setIconDatabasePath(const String&); + void setLocalStorageDirectory(const String& dir) { m_overrideLocalStorageDirectory = dir; } void ensureWebProcess(); @@ -164,7 +174,8 @@ private: virtual Type type() const { return APIType; } void platformInitializeWebProcess(WebProcessCreationParameters&); - + void platformInvalidateContext(); + // History client void didNavigateWithNavigationData(uint64_t pageID, const WebNavigationDataStore& store, uint64_t frameID); void didPerformClientRedirect(uint64_t pageID, const String& sourceURLString, const String& destinationURLString, uint64_t frameID); @@ -189,6 +200,12 @@ private: String databaseDirectory() const; String platformDefaultDatabaseDirectory() const; + String iconDatabasePath() const; + String platformDefaultIconDatabasePath() const; + + String localStorageDirectory() const; + String platformDefaultLocalStorageDirectory() const; + ProcessModel m_processModel; // FIXME: In the future, this should be one or more WebProcessProxies. @@ -228,15 +245,24 @@ private: RefPtr<WebCookieManagerProxy> m_cookieManagerProxy; RefPtr<WebDatabaseManagerProxy> m_databaseManagerProxy; RefPtr<WebGeolocationManagerProxy> m_geolocationManagerProxy; + RefPtr<WebIconDatabase> m_iconDatabase; RefPtr<WebKeyValueStorageManagerProxy> m_keyValueStorageManagerProxy; + RefPtr<WebMediaCacheManagerProxy> m_mediaCacheManagerProxy; RefPtr<WebPluginSiteDataManager> m_pluginSiteDataManager; RefPtr<WebResourceCacheManagerProxy> m_resourceCacheManagerProxy; #if PLATFORM(WIN) bool m_shouldPaintNativeControls; + HTTPCookieAcceptPolicy m_initialHTTPCookieAcceptPolicy; #endif +#if PLATFORM(MAC) + RetainPtr<CFTypeRef> m_enhancedAccessibilityObserver; +#endif + String m_overrideDatabaseDirectory; + String m_overrideIconDatabasePath; + String m_overrideLocalStorageDirectory; }; } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp b/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp index c56374c..a30ab41 100644 --- a/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp +++ b/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp @@ -50,6 +50,12 @@ WebCookieManagerProxy::~WebCookieManagerProxy() void WebCookieManagerProxy::invalidate() { invalidateCallbackMap(m_arrayCallbacks); + invalidateCallbackMap(m_httpCookieAcceptPolicyCallbacks); +} + +bool WebCookieManagerProxy::shouldTerminate(WebProcessProxy*) const +{ + return m_arrayCallbacks.isEmpty() && m_httpCookieAcceptPolicyCallbacks.isEmpty(); } void WebCookieManagerProxy::initializeClient(const WKCookieManagerClient* client) @@ -67,10 +73,7 @@ void WebCookieManagerProxy::getHostnamesWithCookies(PassRefPtr<ArrayCallback> pr ASSERT(m_webContext); RefPtr<ArrayCallback> callback = prpCallback; - if (!m_webContext->hasValidProcess()) { - callback->invalidate(); - return; - } + m_webContext->relaunchProcessIfNecessary(); uint64_t callbackID = callback->callbackID(); m_arrayCallbacks.set(callbackID, callback.release()); @@ -97,24 +100,21 @@ void WebCookieManagerProxy::didGetHostnamesWithCookies(const Vector<String>& hos void WebCookieManagerProxy::deleteCookiesForHostname(const String& hostname) { ASSERT(m_webContext); - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); m_webContext->process()->send(Messages::WebCookieManager::DeleteCookiesForHostname(hostname), 0); } void WebCookieManagerProxy::deleteAllCookies() { ASSERT(m_webContext); - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); m_webContext->process()->send(Messages::WebCookieManager::DeleteAllCookies(), 0); } void WebCookieManagerProxy::startObservingCookieChanges() { ASSERT(m_webContext); - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); m_webContext->process()->send(Messages::WebCookieManager::StartObservingCookieChanges(), 0); } @@ -131,4 +131,37 @@ void WebCookieManagerProxy::cookiesDidChange() m_client.cookiesDidChange(this); } +void WebCookieManagerProxy::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy) +{ + ASSERT(m_webContext); + m_webContext->relaunchProcessIfNecessary(); +#if PLATFORM(MAC) + persistHTTPCookieAcceptPolicy(policy); +#endif + m_webContext->process()->send(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy), 0); +} + +void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(PassRefPtr<HTTPCookieAcceptPolicyCallback> prpCallback) +{ + ASSERT(m_webContext); + + RefPtr<HTTPCookieAcceptPolicyCallback> callback = prpCallback; + m_webContext->relaunchProcessIfNecessary(); + + uint64_t callbackID = callback->callbackID(); + m_httpCookieAcceptPolicyCallbacks.set(callbackID, callback.release()); + m_webContext->process()->send(Messages::WebCookieManager::GetHTTPCookieAcceptPolicy(callbackID), 0); +} + +void WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy(uint32_t policy, uint64_t callbackID) +{ + RefPtr<HTTPCookieAcceptPolicyCallback> callback = m_httpCookieAcceptPolicyCallbacks.take(callbackID); + if (!callback) { + // FIXME: Log error or assert. + return; + } + + callback->performCallbackWithReturnValue(policy); +} + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/WebCookieManagerProxy.h b/Source/WebKit2/UIProcess/WebCookieManagerProxy.h index 9d63265..7dc20d5 100644 --- a/Source/WebKit2/UIProcess/WebCookieManagerProxy.h +++ b/Source/WebKit2/UIProcess/WebCookieManagerProxy.h @@ -43,8 +43,10 @@ namespace CoreIPC { namespace WebKit { class WebContext; +class WebProcessProxy; typedef GenericCallback<WKArrayRef> ArrayCallback; +typedef GenericCallback<WKHTTPCookieAcceptPolicy, HTTPCookieAcceptPolicy> HTTPCookieAcceptPolicyCallback; class WebCookieManagerProxy : public APIObject { public: @@ -62,24 +64,35 @@ public: void deleteCookiesForHostname(const String& hostname); void deleteAllCookies(); + void setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy); + void getHTTPCookieAcceptPolicy(PassRefPtr<HTTPCookieAcceptPolicyCallback>); + void startObservingCookieChanges(); void stopObservingCookieChanges(); void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + bool shouldTerminate(WebProcessProxy*) const; + private: WebCookieManagerProxy(WebContext*); virtual Type type() const { return APIType; } void didGetHostnamesWithCookies(const Vector<String>&, uint64_t callbackID); + void didGetHTTPCookieAcceptPolicy(uint32_t policy, uint64_t callbackID); void cookiesDidChange(); void didReceiveWebCookieManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); +#if PLATFORM(MAC) + void persistHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy); +#endif + WebContext* m_webContext; HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks; + HashMap<uint64_t, RefPtr<HTTPCookieAcceptPolicyCallback> > m_httpCookieAcceptPolicyCallbacks; WebCookieManagerProxyClient m_client; }; diff --git a/Source/WebKit2/UIProcess/WebCookieManagerProxy.messages.in b/Source/WebKit2/UIProcess/WebCookieManagerProxy.messages.in index 808b4c7..2ae0545 100644 --- a/Source/WebKit2/UIProcess/WebCookieManagerProxy.messages.in +++ b/Source/WebKit2/UIProcess/WebCookieManagerProxy.messages.in @@ -22,6 +22,7 @@ messages -> WebCookieManagerProxy { DidGetHostnamesWithCookies(Vector<WTF::String> hostnames, uint64_t callbackID); + DidGetHTTPCookieAcceptPolicy(uint32_t policy, uint64_t callbackID); CookiesDidChange() } diff --git a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp index 96488fb..67323cd 100644 --- a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp +++ b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp @@ -103,6 +103,11 @@ void WebDatabaseManagerProxy::invalidate() invalidateCallbackMap(m_arrayCallbacks); } +bool WebDatabaseManagerProxy::shouldTerminate(WebProcessProxy*) const +{ + return m_arrayCallbacks.isEmpty(); +} + void WebDatabaseManagerProxy::initializeClient(const WKDatabaseManagerClient* client) { m_client.initialize(client); @@ -111,10 +116,7 @@ void WebDatabaseManagerProxy::initializeClient(const WKDatabaseManagerClient* cl void WebDatabaseManagerProxy::getDatabasesByOrigin(PassRefPtr<ArrayCallback> prpCallback) { RefPtr<ArrayCallback> callback = prpCallback; - if (!m_webContext->hasValidProcess()) { - callback->invalidate(); - return; - } + m_webContext->relaunchProcessIfNecessary(); uint64_t callbackID = callback->callbackID(); m_arrayCallbacks.set(callbackID, callback.release()); m_webContext->process()->send(Messages::WebDatabaseManager::GetDatabasesByOrigin(callbackID), 0); @@ -167,10 +169,7 @@ void WebDatabaseManagerProxy::didGetDatabasesByOrigin(const Vector<OriginAndData void WebDatabaseManagerProxy::getDatabaseOrigins(PassRefPtr<ArrayCallback> prpCallback) { RefPtr<ArrayCallback> callback = prpCallback; - if (!m_webContext->hasValidProcess()) { - callback->invalidate(); - return; - } + m_webContext->relaunchProcessIfNecessary(); uint64_t callbackID = callback->callbackID(); m_arrayCallbacks.set(callbackID, callback.release()); m_webContext->process()->send(Messages::WebDatabaseManager::GetDatabaseOrigins(callbackID), 0); @@ -195,29 +194,25 @@ void WebDatabaseManagerProxy::didGetDatabaseOrigins(const Vector<String>& origin void WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin(const String& databaseIdentifier, WebSecurityOrigin* origin) { - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); m_webContext->process()->send(Messages::WebDatabaseManager::DeleteDatabaseWithNameForOrigin(databaseIdentifier, origin->databaseIdentifier()), 0); } void WebDatabaseManagerProxy::deleteDatabasesForOrigin(WebSecurityOrigin* origin) { - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); m_webContext->process()->send(Messages::WebDatabaseManager::DeleteDatabasesForOrigin(origin->databaseIdentifier()), 0); } void WebDatabaseManagerProxy::deleteAllDatabases() { - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); m_webContext->process()->send(Messages::WebDatabaseManager::DeleteAllDatabases(), 0); } void WebDatabaseManagerProxy::setQuotaForOrigin(WebSecurityOrigin* origin, uint64_t quota) { - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); m_webContext->process()->send(Messages::WebDatabaseManager::SetQuotaForOrigin(origin->databaseIdentifier(), quota), 0); } diff --git a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h index 3658845..d70011c 100644 --- a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h +++ b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h @@ -43,6 +43,7 @@ class MessageID; namespace WebKit { class WebContext; +class WebProcessProxy; class WebSecurityOrigin; typedef GenericCallback<WKArrayRef> ArrayCallback; @@ -77,6 +78,8 @@ public: void didReceiveWebDatabaseManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + bool shouldTerminate(WebProcessProxy*) const; + private: explicit WebDatabaseManagerProxy(WebContext*); diff --git a/Source/WebKit2/UIProcess/WebDownloadClient.cpp b/Source/WebKit2/UIProcess/WebDownloadClient.cpp index 4b1b756..612a056 100644 --- a/Source/WebKit2/UIProcess/WebDownloadClient.cpp +++ b/Source/WebKit2/UIProcess/WebDownloadClient.cpp @@ -42,6 +42,14 @@ void WebDownloadClient::didStart(WebContext* webContext, DownloadProxy* download m_client.didStart(toAPI(webContext), toAPI(downloadProxy), m_client.clientInfo); } +void WebDownloadClient::didReceiveAuthenticationChallenge(WebContext* webContext, DownloadProxy* downloadProxy, AuthenticationChallengeProxy* authenticationChallengeProxy) +{ + if (!m_client.didReceiveAuthenticationChallenge) + return; + + m_client.didReceiveAuthenticationChallenge(toAPI(webContext), toAPI(downloadProxy), toAPI(authenticationChallengeProxy), m_client.clientInfo); +} + void WebDownloadClient::didReceiveResponse(WebContext* webContext, DownloadProxy* downloadProxy, const ResourceResponse& response) { if (!m_client.didReceiveResponse) diff --git a/Source/WebKit2/UIProcess/WebDownloadClient.h b/Source/WebKit2/UIProcess/WebDownloadClient.h index 902c870..46010a1 100644 --- a/Source/WebKit2/UIProcess/WebDownloadClient.h +++ b/Source/WebKit2/UIProcess/WebDownloadClient.h @@ -37,12 +37,14 @@ namespace WebCore { namespace WebKit { +class AuthenticationChallengeProxy; class DownloadProxy; class WebContext; class WebDownloadClient : public APIClient<WKContextDownloadClient> { public: void didStart(WebContext*, DownloadProxy*); + void didReceiveAuthenticationChallenge(WebContext*, DownloadProxy*, AuthenticationChallengeProxy*); void didReceiveResponse(WebContext*, DownloadProxy*, const WebCore::ResourceResponse&); void didReceiveData(WebContext*, DownloadProxy*, uint64_t length); bool shouldDecodeSourceDataOfMIMEType(WebContext*, DownloadProxy*, const String& mimeType); diff --git a/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp b/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp index 568faa1..b9599f3 100644 --- a/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp +++ b/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp @@ -54,7 +54,7 @@ void WebEditCommandProxy::unapply() return; m_page->process()->send(Messages::WebPage::UnapplyEditCommand(m_commandID), m_page->pageID()); - m_page->registerEditCommand(this, WebPageProxy::Undo); + m_page->registerEditCommand(this, WebPageProxy::Redo); } void WebEditCommandProxy::reapply() @@ -63,7 +63,7 @@ void WebEditCommandProxy::reapply() return; m_page->process()->send(Messages::WebPage::ReapplyEditCommand(m_commandID), m_page->pageID()); - m_page->registerEditCommand(this, WebPageProxy::Redo); + m_page->registerEditCommand(this, WebPageProxy::Undo); } } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/WebEditCommandProxy.h b/Source/WebKit2/UIProcess/WebEditCommandProxy.h index 2d21d3f..4c08877 100644 --- a/Source/WebKit2/UIProcess/WebEditCommandProxy.h +++ b/Source/WebKit2/UIProcess/WebEditCommandProxy.h @@ -26,6 +26,7 @@ #ifndef WebEditCommandProxy_h #define WebEditCommandProxy_h +#include "APIObject.h" #include <WebCore/EditAction.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> @@ -34,7 +35,7 @@ namespace WebKit { class WebPageProxy; -class WebEditCommandProxy : public RefCounted<WebEditCommandProxy> { +class WebEditCommandProxy : public APIObject { public: static PassRefPtr<WebEditCommandProxy> create(uint64_t commandID, WebCore::EditAction editAction, WebPageProxy* page) { @@ -53,6 +54,8 @@ public: private: WebEditCommandProxy(uint64_t commandID, WebCore::EditAction, WebPageProxy*); + virtual Type type() const { return TypeEditCommandProxy; } + uint64_t m_commandID; WebCore::EditAction m_editAction; WebPageProxy* m_page; diff --git a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp new file mode 100644 index 0000000..91daf10 --- /dev/null +++ b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebFullScreenManagerProxy.h" + +#if ENABLE(FULLSCREEN_API) + +#include "WebContext.h" +#include "WebFullScreenManagerMessages.h" +#include "WebFullScreenManagerProxyMessages.h" +#include "WebProcess.h" + +namespace WebKit { + +PassRefPtr<WebFullScreenManagerProxy> WebFullScreenManagerProxy::create(WebPageProxy* page) +{ + return adoptRef(new WebFullScreenManagerProxy(page)); +} + +WebFullScreenManagerProxy::WebFullScreenManagerProxy(WebPageProxy* page) + : m_page(page) + , m_webView(0) +{ +} + +WebFullScreenManagerProxy::~WebFullScreenManagerProxy() +{ +} + +void WebFullScreenManagerProxy::invalidate() +{ + m_webView = 0; +} + +void WebFullScreenManagerProxy::setWebView(PlatformWebView* webView) +{ + m_webView = webView; +} + +void WebFullScreenManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) +{ + didReceiveWebFullScreenManagerProxyMessage(connection, messageID, arguments); +} + +CoreIPC::SyncReplyMode WebFullScreenManagerProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply) +{ + return didReceiveSyncWebFullScreenManagerProxyMessage(connection, messageID, arguments, reply); +} + +void WebFullScreenManagerProxy::willEnterFullScreen() +{ + m_page->process()->send(Messages::WebFullScreenManager::WillEnterFullScreen(), m_page->pageID()); +} + +void WebFullScreenManagerProxy::didEnterFullScreen() +{ + m_page->process()->send(Messages::WebFullScreenManager::DidEnterFullScreen(), m_page->pageID()); +} + +void WebFullScreenManagerProxy::willExitFullScreen() +{ + m_page->process()->send(Messages::WebFullScreenManager::WillExitFullScreen(), m_page->pageID()); +} + +void WebFullScreenManagerProxy::didExitFullScreen() +{ + m_page->process()->send(Messages::WebFullScreenManager::DidExitFullScreen(), m_page->pageID()); +} + +void WebFullScreenManagerProxy::beginEnterFullScreenAnimation(float duration) +{ + m_page->process()->send(Messages::WebFullScreenManager::BeginEnterFullScreenAnimation(duration), m_page->pageID()); +} + +void WebFullScreenManagerProxy::beginExitFullScreenAnimation(float duration) +{ + m_page->process()->send(Messages::WebFullScreenManager::BeginExitFullScreenAnimation(duration), m_page->pageID()); +} + +void WebFullScreenManagerProxy::supportsFullScreen(bool withKeyboard, bool& supports) +{ + if (withKeyboard) + supports = false; + else + supports = true; +} + +} // namespace WebKit + +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h new file mode 100644 index 0000000..1f3dca6 --- /dev/null +++ b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebFullScreenManagerProxy_h +#define WebFullScreenManagerProxy_h + +#if ENABLE(FULLSCREEN_API) + +#include "Connection.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace CoreIPC { +class ArgumentDecoder; +class Connection; +class MessageID; +} + +namespace WebCore { +class IntRect; +} + +#if PLATFORM(MAC) +OBJC_CLASS WKView; +#endif + +namespace WebKit { + +#if PLATFORM(MAC) +typedef WKView PlatformWebView; +#elif PLATFORM(WIN) +class WebView; +typedef WebView PlatformWebView; +#elif PLATFORM(QT) +typedef QGraphicsWKView PlatformWebView; +#elif PLATFORM(GTK) +class WebView; +typedef WebView PlatformWebView; +#endif + +class WebPageProxy; +class LayerTreeContext; + +class WebFullScreenManagerProxy : public RefCounted<WebFullScreenManagerProxy> { +public: + static PassRefPtr<WebFullScreenManagerProxy> create(WebPageProxy*); + virtual ~WebFullScreenManagerProxy(); + + void invalidate(); + + void setWebView(PlatformWebView*); + + void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply); + + void willEnterFullScreen(); + void didEnterFullScreen(); + void willExitFullScreen(); + void didExitFullScreen(); + void beginEnterFullScreenAnimation(float duration); + void beginExitFullScreenAnimation(float duration); + +private: + WebFullScreenManagerProxy(WebPageProxy*); + + void supportsFullScreen(bool withKeyboard, bool&); + void enterFullScreen(); + void exitFullScreen(); + void beganEnterFullScreenAnimation(); + void finishedEnterFullScreenAnimation(bool completed); + void beganExitFullScreenAnimation(); + void finishedExitFullScreenAnimation(bool completed); + void enterAcceleratedCompositingMode(const LayerTreeContext&); + void exitAcceleratedCompositingMode(); + void getFullScreenRect(WebCore::IntRect&); + + WebPageProxy* m_page; + PlatformWebView* m_webView; + + void didReceiveWebFullScreenManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + CoreIPC::SyncReplyMode didReceiveSyncWebFullScreenManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply); +}; + +} // namespace WebKit + +#endif // ENABLE(FULLSCREEN_API) + +#endif // WebFullScreenManagerProxy_h diff --git a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.messages.in b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.messages.in new file mode 100644 index 0000000..007e309 --- /dev/null +++ b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.messages.in @@ -0,0 +1,38 @@ +# Copyright (C) 2011 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#if ENABLE(FULLSCREEN_API) +messages -> WebFullScreenManagerProxy { + SupportsFullScreen(bool withKeyboard) -> (bool supportsFullScreen) + EnterFullScreen() + ExitFullScreen() + BeganEnterFullScreenAnimation() + FinishedEnterFullScreenAnimation(bool completed) + BeganExitFullScreenAnimation() + FinishedExitFullScreenAnimation(bool completed) + GetFullScreenRect() -> (WebCore::IntRect rect) +#if USE(ACCELERATED_COMPOSITING) + EnterAcceleratedCompositingMode(WebKit::LayerTreeContext context) + ExitAcceleratedCompositingMode() +#endif +} +#endif diff --git a/Source/WebKit2/UIProcess/WebIconDatabase.cpp b/Source/WebKit2/UIProcess/WebIconDatabase.cpp new file mode 100644 index 0000000..c397a1d --- /dev/null +++ b/Source/WebKit2/UIProcess/WebIconDatabase.cpp @@ -0,0 +1,255 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebIconDatabase.h" + +#include "DataReference.h" +#include "Logging.h" +#include "WebContext.h" +#include "WebIconDatabaseProxyMessages.h" +#include <WebCore/FileSystem.h> +#include <WebCore/IconDatabase.h> +#include <WebCore/IconDatabaseBase.h> +#include <wtf/text/WTFString.h> + +using namespace WebCore; + +namespace WebKit { + +PassRefPtr<WebIconDatabase> WebIconDatabase::create(WebContext* context) +{ + return adoptRef(new WebIconDatabase(context)); +} + +WebIconDatabase::~WebIconDatabase() +{ +} + +WebIconDatabase::WebIconDatabase(WebContext* context) + : m_webContext(context) + , m_urlImportCompleted(false) + , m_databaseCleanupDisabled(false) +{ +} + +void WebIconDatabase::invalidate() +{ +} + +void WebIconDatabase::setDatabasePath(const String& path) +{ + if (m_iconDatabaseImpl && m_iconDatabaseImpl->isOpen()) { + LOG_ERROR("Icon database already has a path and is already open. We don't currently support changing its path and reopening."); + return; + } + + m_iconDatabaseImpl = IconDatabase::create(); + m_iconDatabaseImpl->setClient(this); + IconDatabase::delayDatabaseCleanup(); + m_databaseCleanupDisabled = true; + m_iconDatabaseImpl->setEnabled(true); + if (!m_iconDatabaseImpl->open(directoryName(path), pathGetFileName(path))) { + LOG_ERROR("Unable to open WebKit2 icon database on disk"); + m_iconDatabaseImpl.clear(); + setGlobalIconDatabase(0); + IconDatabase::allowDatabaseCleanup(); + m_databaseCleanupDisabled = false; + } + setGlobalIconDatabase(m_iconDatabaseImpl.get()); +} + +void WebIconDatabase::enableDatabaseCleanup() +{ + if (!m_iconDatabaseImpl) { + LOG_ERROR("Cannot enabled Icon Database cleanup - it hasn't been opened yet."); + return; + } + + if (!m_databaseCleanupDisabled) { + LOG_ERROR("Attempt to enable database cleanup, but it's already enabled."); + ASSERT_NOT_REACHED(); + return; + } + + IconDatabase::allowDatabaseCleanup(); + m_databaseCleanupDisabled = false; +} + +void WebIconDatabase::retainIconForPageURL(const String& pageURL) +{ + LOG(IconDatabase, "WK2 UIProcess retaining icon for page URL %s", pageURL.ascii().data()); + if (m_iconDatabaseImpl) + m_iconDatabaseImpl->retainIconForPageURL(pageURL); +} + +void WebIconDatabase::releaseIconForPageURL(const String& pageURL) +{ + LOG(IconDatabase, "WK2 UIProcess releasing icon for page URL %s", pageURL.ascii().data()); + if (m_iconDatabaseImpl) + m_iconDatabaseImpl->releaseIconForPageURL(pageURL); +} + +void WebIconDatabase::setIconURLForPageURL(const String& iconURL, const String& pageURL) +{ + LOG(IconDatabase, "WK2 UIProcess setting icon URL %s for page URL %s", iconURL.ascii().data(), pageURL.ascii().data()); + if (m_iconDatabaseImpl) + m_iconDatabaseImpl->setIconURLForPageURL(iconURL, pageURL); +} + +void WebIconDatabase::setIconDataForIconURL(const CoreIPC::DataReference& iconData, const String& iconURL) +{ + LOG(IconDatabase, "WK2 UIProcess setting icon data (%i bytes) for page URL %s", (int)iconData.size(), iconURL.ascii().data()); + if (!m_iconDatabaseImpl) + return; + + RefPtr<SharedBuffer> buffer = SharedBuffer::create(iconData.data(), iconData.size()); + m_iconDatabaseImpl->setIconDataForIconURL(buffer.release(), iconURL); +} + +void WebIconDatabase::synchronousIconDataForPageURL(const String&, CoreIPC::DataReference& iconData) +{ + iconData = CoreIPC::DataReference(); +} + +void WebIconDatabase::synchronousIconURLForPageURL(const String&, String& iconURL) +{ + iconURL = String(); +} + +void WebIconDatabase::synchronousIconDataKnownForIconURL(const String&, bool& iconDataKnown) const +{ + iconDataKnown = false; +} + +void WebIconDatabase::synchronousLoadDecisionForIconURL(const String&, int& loadDecision) const +{ + loadDecision = static_cast<int>(IconLoadNo); +} + +void WebIconDatabase::getLoadDecisionForIconURL(const String& iconURL, uint64_t callbackID) +{ + LOG(IconDatabase, "WK2 UIProcess getting load decision for icon URL %s with callback ID %lli", iconURL.ascii().data(), static_cast<long long>(callbackID)); + + if (!m_webContext) + return; + + if (!m_iconDatabaseImpl || !m_iconDatabaseImpl->isOpen() || iconURL.isEmpty()) { + m_webContext->process()->send(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision(static_cast<int>(IconLoadNo), callbackID), 0); + return; + } + + // If the decision hasn't been read from disk yet, set this url and callback ID aside to be notifed later + IconLoadDecision decision = m_iconDatabaseImpl->synchronousLoadDecisionForIconURL(iconURL, 0); + if (decision == IconLoadUnknown) { + // We should never get an unknown load decision after the URL import has completed. + ASSERT(!m_urlImportCompleted); + + m_pendingLoadDecisionURLMap.set(callbackID, iconURL); + return; + } + + m_webContext->process()->send(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision((int)decision, callbackID), 0); +} + +Image* WebIconDatabase::imageForPageURL(const String& pageURL) +{ + if (!m_webContext) + return 0; + + if (!m_iconDatabaseImpl || !m_iconDatabaseImpl->isOpen() || pageURL.isEmpty()) + return 0; + + // The WebCore IconDatabase ignores the passed in size parameter. + // If that changes we'll need to rethink how this API is exposed. + return m_iconDatabaseImpl->synchronousIconForPageURL(pageURL, WebCore::IntSize(32, 32)); +} + + +// WebCore::IconDatabaseClient +bool WebIconDatabase::performImport() +{ + // WebKit2 icon database doesn't currently support importing any old icon database formats. + return true; +} + +void WebIconDatabase::didImportIconURLForPageURL(const String&) +{ + // Send a WK2 client notification out here. +} + +void WebIconDatabase::didImportIconDataForPageURL(const String&) +{ + // Send a WK2 client notification out here. +} + +void WebIconDatabase::didChangeIconForPageURL(const String&) +{ + // Send a WK2 client notification out here. +} + +void WebIconDatabase::didRemoveAllIcons() +{ + // Send a WK2 client notification out here. +} + +void WebIconDatabase::didFinishURLImport() +{ + if (!m_webContext) + return; + + ASSERT(!m_urlImportCompleted); + + LOG(IconDatabase, "WK2 UIProcess URL import complete, notifying all %i pending page URL load decisions", m_pendingLoadDecisionURLMap.size()); + + HashMap<uint64_t, String>::iterator i = m_pendingLoadDecisionURLMap.begin(); + HashMap<uint64_t, String>::iterator end = m_pendingLoadDecisionURLMap.end(); + + for (; i != end; ++i) { + LOG(IconDatabase, "WK2 UIProcess performing delayed callback on callback ID %i for page url %s", (int)i->first, i->second.ascii().data()); + IconLoadDecision decision = m_iconDatabaseImpl->synchronousLoadDecisionForIconURL(i->second, 0); + + // Decisions should never be unknown after the inital import is complete + ASSERT(decision != IconLoadUnknown); + + m_webContext->process()->send(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision(static_cast<int>(decision), i->first), 0); + } + + m_pendingLoadDecisionURLMap.clear(); + + m_urlImportCompleted = true; +} + +void WebIconDatabase::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* decoder) +{ + didReceiveWebIconDatabaseMessage(connection, messageID, decoder); +} + +CoreIPC::SyncReplyMode WebIconDatabase::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* decoder, CoreIPC::ArgumentEncoder* reply) +{ + return didReceiveSyncWebIconDatabaseMessage(connection, messageID, decoder, reply); +} + +} // namespace WebKit diff --git a/Source/WebKit2/UIProcess/WebIconDatabase.h b/Source/WebKit2/UIProcess/WebIconDatabase.h new file mode 100644 index 0000000..802f2aa --- /dev/null +++ b/Source/WebKit2/UIProcess/WebIconDatabase.h @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebIconDatabase_h +#define WebIconDatabase_h + +#include "APIObject.h" + +#include "Connection.h" +#include <WebCore/IconDatabaseClient.h> +#include <wtf/Forward.h> +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> +#include <wtf/Vector.h> +#include <wtf/text/StringHash.h> + +namespace CoreIPC { +class ArgumentDecoder; +class DataReference; +class MessageID; +} + +namespace WebCore { +class IconDatabase; +class Image; +} + +namespace WebKit { + +class WebContext; + +class WebIconDatabase : public APIObject, public WebCore::IconDatabaseClient { +public: + static const Type APIType = TypeIconDatabase; + + static PassRefPtr<WebIconDatabase> create(WebContext*); + virtual ~WebIconDatabase(); + + void invalidate(); + void clearContext() { m_webContext = 0; } + void setDatabasePath(const String&); + void enableDatabaseCleanup(); + + void retainIconForPageURL(const String&); + void releaseIconForPageURL(const String&); + void setIconURLForPageURL(const String&, const String&); + void setIconDataForIconURL(const CoreIPC::DataReference&, const String&); + + void synchronousIconDataForPageURL(const String&, CoreIPC::DataReference&); + void synchronousIconURLForPageURL(const String&, String&); + void synchronousIconDataKnownForIconURL(const String&, bool&) const; + void synchronousLoadDecisionForIconURL(const String&, int&) const; + + void getLoadDecisionForIconURL(const String&, uint64_t callbackID); + + WebCore::Image* imageForPageURL(const String&); + + // WebCore::IconDatabaseClient + virtual bool performImport(); + virtual void didImportIconURLForPageURL(const String&); + virtual void didImportIconDataForPageURL(const String&); + virtual void didChangeIconForPageURL(const String&); + virtual void didRemoveAllIcons(); + virtual void didFinishURLImport(); + + void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*); + +private: + WebIconDatabase(WebContext*); + + virtual Type type() const { return APIType; } + + void didReceiveWebIconDatabaseMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + CoreIPC::SyncReplyMode didReceiveSyncWebIconDatabaseMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*); + + WebContext* m_webContext; + + OwnPtr<WebCore::IconDatabase> m_iconDatabaseImpl; + bool m_urlImportCompleted; + bool m_databaseCleanupDisabled; + HashMap<uint64_t, String> m_pendingLoadDecisionURLMap; + +}; + +} // namespace WebKit + +#endif // WebIconDatabase_h diff --git a/Source/WebKit2/UIProcess/WebIconDatabase.messages.in b/Source/WebKit2/UIProcess/WebIconDatabase.messages.in new file mode 100644 index 0000000..b68a0a7 --- /dev/null +++ b/Source/WebKit2/UIProcess/WebIconDatabase.messages.in @@ -0,0 +1,35 @@ +# Copyright (C) 2011 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +messages -> WebIconDatabase { + RetainIconForPageURL(WTF::String pageURL) + ReleaseIconForPageURL(WTF::String pageURL) + SetIconURLForPageURL(WTF::String iconURL, WTF::String pageURL) + SetIconDataForIconURL(CoreIPC::DataReference iconData, WTF::String iconURL) + + SynchronousIconDataForPageURL(WTF::String pageURL) -> (CoreIPC::DataReference iconData) + SynchronousIconURLForPageURL(WTF::String pageURL) -> (WTF::String iconURL) + SynchronousIconDataKnownForIconURL(WTF::String iconURL) -> (bool dataKnown) + SynchronousLoadDecisionForIconURL(WTF::String iconURL) -> (int loadDecision) + + GetLoadDecisionForIconURL(WTF::String iconURL, uint64_t callbackID) +} diff --git a/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp b/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp index dafa613..1de1532 100644 --- a/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp +++ b/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp @@ -52,6 +52,11 @@ void WebKeyValueStorageManagerProxy::invalidate() invalidateCallbackMap(m_arrayCallbacks); } +bool WebKeyValueStorageManagerProxy::shouldTerminate(WebProcessProxy*) const +{ + return m_arrayCallbacks.isEmpty(); +} + void WebKeyValueStorageManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) { didReceiveWebKeyValueStorageManagerProxyMessage(connection, messageID, arguments); @@ -60,10 +65,7 @@ void WebKeyValueStorageManagerProxy::didReceiveMessage(CoreIPC::Connection* conn void WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins(PassRefPtr<ArrayCallback> prpCallback) { RefPtr<ArrayCallback> callback = prpCallback; - if (!m_webContext->hasValidProcess()) { - callback->invalidate(); - return; - } + m_webContext->relaunchProcessIfNecessary(); uint64_t callbackID = callback->callbackID(); m_arrayCallbacks.set(callbackID, callback.release()); @@ -78,8 +80,7 @@ void WebKeyValueStorageManagerProxy::didGetKeyValueStorageOrigins(const Vector<S void WebKeyValueStorageManagerProxy::deleteEntriesForOrigin(WebSecurityOrigin* origin) { - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); SecurityOriginData securityOriginData; securityOriginData.protocol = origin->protocol(); @@ -91,9 +92,7 @@ void WebKeyValueStorageManagerProxy::deleteEntriesForOrigin(WebSecurityOrigin* o void WebKeyValueStorageManagerProxy::deleteAllEntries() { - if (!m_webContext->hasValidProcess()) - return; - + m_webContext->relaunchProcessIfNecessary(); m_webContext->process()->send(Messages::WebKeyValueStorageManager::DeleteAllEntries(), 0); } diff --git a/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h b/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h index 1c5ea3a..79cb03e 100644 --- a/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h +++ b/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h @@ -44,6 +44,7 @@ namespace WebKit { struct SecurityOriginData; class WebContext; +class WebProcessProxy; class WebSecurityOrigin; typedef GenericCallback<WKArrayRef> ArrayCallback; @@ -64,6 +65,8 @@ public: void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + bool shouldTerminate(WebProcessProxy*) const; + private: WebKeyValueStorageManagerProxy(WebContext*); diff --git a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp new file mode 100644 index 0000000..c8a7f51 --- /dev/null +++ b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebMediaCacheManagerProxy.h" + +#include "WebContext.h" +#include "WebMediaCacheManagerMessages.h" +#include "WebSecurityOrigin.h" + +namespace WebKit { + +PassRefPtr<WebMediaCacheManagerProxy> WebMediaCacheManagerProxy::create(WebContext* context) +{ + return adoptRef(new WebMediaCacheManagerProxy(context)); +} + +WebMediaCacheManagerProxy::WebMediaCacheManagerProxy(WebContext* context) + : m_webContext(context) +{ +} + +WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy() +{ +} + +void WebMediaCacheManagerProxy::invalidate() +{ + invalidateCallbackMap(m_arrayCallbacks); +} + +bool WebMediaCacheManagerProxy::shouldTerminate(WebProcessProxy*) const +{ + return m_arrayCallbacks.isEmpty(); +} + +void WebMediaCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) +{ + didReceiveWebMediaCacheManagerProxyMessage(connection, messageID, arguments); +} + +void WebMediaCacheManagerProxy::getHostnamesWithMediaCache(PassRefPtr<ArrayCallback> prpCallback) +{ + RefPtr<ArrayCallback> callback = prpCallback; + m_webContext->relaunchProcessIfNecessary(); + + uint64_t callbackID = callback->callbackID(); + m_arrayCallbacks.set(callbackID, callback.release()); + m_webContext->process()->send(Messages::WebMediaCacheManager::GetHostnamesWithMediaCache(callbackID), 0); +} + +void WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache(const Vector<String>& hostnameList, uint64_t callbackID) +{ + RefPtr<ArrayCallback> callback = m_arrayCallbacks.take(callbackID); + if (!callback) { + // FIXME: Log error or assert. + return; + } + + size_t hostnameCount = hostnameList.size(); + Vector<RefPtr<APIObject> > hostnames(hostnameCount); + + for (size_t i = 0; i < hostnameCount; ++i) + hostnames[i] = WebString::create(hostnameList[i]); + + callback->performCallbackWithReturnValue(ImmutableArray::adopt(hostnames).get()); +} + +void WebMediaCacheManagerProxy::clearCacheForHostname(const String& hostname) +{ + m_webContext->relaunchProcessIfNecessary(); + m_webContext->process()->send(Messages::WebMediaCacheManager::ClearCacheForHostname(hostname), 0); +} + +void WebMediaCacheManagerProxy::clearCacheForAllHostnames() +{ + m_webContext->relaunchProcessIfNecessary(); + m_webContext->process()->send(Messages::WebMediaCacheManager::ClearCacheForAllHostnames(), 0); +} + +} // namespace WebKit diff --git a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h new file mode 100644 index 0000000..43231e5 --- /dev/null +++ b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebMediaCacheManagerProxy_h +#define WebMediaCacheManagerProxy_h + +#include "APIObject.h" +#include "GenericCallback.h" +#include "ImmutableArray.h" + +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> +#include <wtf/Vector.h> + +namespace CoreIPC { + class ArgumentDecoder; + class Connection; + class MessageID; +} + +namespace WebKit { + +class WebContext; +class WebProcessProxy; + +typedef GenericCallback<WKArrayRef> ArrayCallback; + +class WebMediaCacheManagerProxy : public APIObject { +public: + static const Type APIType = TypeMediaCacheManager; + + static PassRefPtr<WebMediaCacheManagerProxy> create(WebContext*); + virtual ~WebMediaCacheManagerProxy(); + + void invalidate(); + void clearContext() { m_webContext = 0; } + + void getHostnamesWithMediaCache(PassRefPtr<ArrayCallback>); + void clearCacheForHostname(const String&); + void clearCacheForAllHostnames(); + + void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + + bool shouldTerminate(WebProcessProxy*) const; + +private: + WebMediaCacheManagerProxy(WebContext*); + + virtual Type type() const { return APIType; } + + void didGetHostnamesWithMediaCache(const Vector<String>&, uint64_t callbackID); + + void didReceiveWebMediaCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + + WebContext* m_webContext; + HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks; +}; + +} // namespace WebKit + +#endif // WebMediaCacheManagerProxy_h diff --git a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.messages.in b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.messages.in new file mode 100644 index 0000000..7929064 --- /dev/null +++ b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.messages.in @@ -0,0 +1,25 @@ +# Copyright (C) 2011 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +messages -> WebMediaCacheManagerProxy { + DidGetHostnamesWithMediaCache(Vector<WTF::String> hostnames, uint64_t callbackID); +} diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp index 3813a39..ce3af46 100644 --- a/Source/WebKit2/UIProcess/WebPageProxy.cpp +++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp @@ -52,6 +52,8 @@ #include "WebEvent.h" #include "WebFormSubmissionListenerProxy.h" #include "WebFramePolicyListenerProxy.h" +#include "WebFullScreenManagerProxy.h" +#include "WebInspectorProxy.h" #include "WebOpenPanelResultListenerProxy.h" #include "WebPageCreationParameters.h" #include "WebPageGroup.h" @@ -71,10 +73,6 @@ #include <WebCore/WindowFeatures.h> #include <stdio.h> -#if PLATFORM(MAC) -#include "DictionaryPopupInfo.h" -#endif - #if PLATFORM(WIN) #include "WebDragSource.h" #include <WebCore/BitmapInfo.h> @@ -220,6 +218,9 @@ void WebPageProxy::initializeResourceLoadClient(const WKPageResourceLoadClient* void WebPageProxy::initializeUIClient(const WKPageUIClient* client) { + if (!isValid()) + return; + m_uiClient.initialize(client); process()->send(Messages::WebPage::SetCanRunBeforeUnloadConfirmPanel(m_uiClient.canRunBeforeUnloadConfirmPanel()), m_pageID); @@ -297,6 +298,13 @@ void WebPageProxy::close() } #endif +#if ENABLE(FULLSCREEN_API) + if (m_fullScreenManager) { + m_fullScreenManager->invalidate(); + m_fullScreenManager = 0; + } +#endif + if (m_openPanelResultListener) { m_openPanelResultListener->invalidate(); m_openPanelResultListener = 0; @@ -315,6 +323,7 @@ void WebPageProxy::close() invalidateCallbackMap(m_voidCallbacks); invalidateCallbackMap(m_dataCallbacks); invalidateCallbackMap(m_stringCallbacks); + m_loadDependentStringCallbackIDs.clear(); invalidateCallbackMap(m_scriptValueCallbacks); invalidateCallbackMap(m_computedPagesCallbacks); @@ -386,26 +395,27 @@ void WebPageProxy::loadURLRequest(WebURLRequest* urlRequest) void WebPageProxy::loadHTMLString(const String& htmlString, const String& baseURL) { if (!isValid()) - return; + reattachToWebProcess(); + process()->send(Messages::WebPage::LoadHTMLString(htmlString, baseURL), m_pageID); } void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL) { if (!isValid()) - return; + reattachToWebProcess(); - if (!m_mainFrame) - return; + if (m_mainFrame) + m_mainFrame->setUnreachableURL(unreachableURL); - m_mainFrame->setUnreachableURL(unreachableURL); process()->send(Messages::WebPage::LoadAlternateHTMLString(htmlString, baseURL, unreachableURL), m_pageID); } void WebPageProxy::loadPlainTextString(const String& string) { if (!isValid()) - return; + reattachToWebProcess(); + process()->send(Messages::WebPage::LoadPlainTextString(string), m_pageID); } @@ -509,7 +519,10 @@ bool WebPageProxy::canShowMIMEType(const String& mimeType) const if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType)) return true; - + + if (mimeType.startsWith("text/", false)) + return !MIMETypeRegistry::isUnsupportedTextMIMEType(mimeType); + String newMimeType = mimeType; PluginInfoStore::Plugin plugin = context()->pluginInfoStore()->findPlugin(newMimeType, KURL()); if (!plugin.path.isNull()) @@ -542,11 +555,15 @@ void WebPageProxy::setDrawsTransparentBackground(bool drawsTransparentBackground void WebPageProxy::viewWillStartLiveResize() { + if (!isValid()) + return; process()->send(Messages::WebPage::ViewWillStartLiveResize(), m_pageID); } void WebPageProxy::viewWillEndLiveResize() { + if (!isValid()) + return; process()->send(Messages::WebPage::ViewWillEndLiveResize(), m_pageID); } @@ -633,49 +650,7 @@ void WebPageProxy::executeEditCommand(const String& commandName) process()->send(Messages::WebPage::ExecuteEditCommand(commandName), m_pageID); } -#if PLATFORM(MAC) -void WebPageProxy::updateWindowIsVisible(bool windowIsVisible) -{ - if (!isValid()) - return; - process()->send(Messages::WebPage::SetWindowIsVisible(windowIsVisible), m_pageID); -} - -void WebPageProxy::windowAndViewFramesChanged(const IntRect& windowFrameInScreenCoordinates, const IntRect& viewFrameInWindowCoordinates, const IntPoint& accessibilityViewCoordinates) -{ - if (!isValid()) - return; - - process()->send(Messages::WebPage::WindowAndViewFramesChanged(windowFrameInScreenCoordinates, viewFrameInWindowCoordinates, accessibilityViewCoordinates), m_pageID); -} - -void WebPageProxy::getMarkedRange(uint64_t& location, uint64_t& length) -{ - process()->sendSync(Messages::WebPage::GetMarkedRange(), Messages::WebPage::GetMarkedRange::Reply(location, length), m_pageID); -} - -uint64_t WebPageProxy::characterIndexForPoint(const IntPoint point) -{ - uint64_t result; - process()->sendSync(Messages::WebPage::CharacterIndexForPoint(point), Messages::WebPage::CharacterIndexForPoint::Reply(result), m_pageID); - return result; -} - -WebCore::IntRect WebPageProxy::firstRectForCharacterRange(uint64_t location, uint64_t length) -{ - IntRect resultRect; - process()->sendSync(Messages::WebPage::FirstRectForCharacterRange(location, length), Messages::WebPage::FirstRectForCharacterRange::Reply(resultRect), m_pageID); - return resultRect; -} - -bool WebPageProxy::writeSelectionToPasteboard(const String& pasteboardName, const Vector<String>& pasteboardTypes) -{ - bool result; - const double MessageTimeout = 20; - process()->sendSync(Messages::WebPage::WriteSelectionToPasteboard(pasteboardName, pasteboardTypes), Messages::WebPage::WriteSelectionToPasteboard::Reply(result), m_pageID, MessageTimeout); - return result; -} -#elif PLATFORM(WIN) +#if PLATFORM(WIN) WebCore::IntRect WebPageProxy::firstRectForCharacterInSelectedRange(int characterPosition) { IntRect resultRect; @@ -719,17 +694,6 @@ void WebPageProxy::didPerformDragControllerAction(uint64_t resultOperation) m_currentDragOperation = static_cast<DragOperation>(resultOperation); } -#if PLATFORM(MAC) -void WebPageProxy::setDragImage(const WebCore::IntPoint& clientPosition, const IntSize& imageSize, const SharedMemory::Handle& dragImageHandle, bool isLinkDrag) -{ - RefPtr<ShareableBitmap> dragImage = ShareableBitmap::create(imageSize, dragImageHandle); - if (!dragImage) - return; - - m_pageClient->setDragImage(clientPosition, imageSize, dragImage.release(), isLinkDrag); -} -#endif - #if PLATFORM(WIN) void WebPageProxy::startDragDrop(const IntPoint& imageOrigin, const IntPoint& dragPoint, uint64_t okEffect, @@ -880,6 +844,14 @@ void WebPageProxy::handleTouchEvent(const WebTouchEvent& event) } #endif +void WebPageProxy::scrollBy(ScrollDirection direction, ScrollGranularity granularity) +{ + if (!isValid()) + return; + + process()->send(Messages::WebPage::ScrollBy(direction, granularity), m_pageID); +} + void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* frame, uint64_t listenerID) { if (!isValid()) @@ -1147,6 +1119,7 @@ void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, PassRefPtr<StringCall { RefPtr<StringCallback> callback = prpCallback; uint64_t callbackID = callback->callbackID(); + m_loadDependentStringCallbackIDs.add(callbackID); m_stringCallbacks.set(callbackID, callback.get()); process()->send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID), m_pageID); } @@ -1155,6 +1128,7 @@ void WebPageProxy::getContentsAsString(PassRefPtr<StringCallback> prpCallback) { RefPtr<StringCallback> callback = prpCallback; uint64_t callbackID = callback->callbackID(); + m_loadDependentStringCallbackIDs.add(callbackID); m_stringCallbacks.set(callbackID, callback.get()); process()->send(Messages::WebPage::GetContentsAsString(callbackID), m_pageID); } @@ -1205,16 +1179,6 @@ void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback) process()->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID); } -#if PLATFORM(MAC) -void WebPageProxy::performDictionaryLookupAtLocation(const WebCore::FloatPoint& point) -{ - if (!isValid()) - return; - - process()->send(Messages::WebPage::PerformDictionaryLookupAtLocation(point), m_pageID); -} -#endif - void WebPageProxy::preferencesDidChange() { if (!isValid()) @@ -1257,6 +1221,13 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M } #endif +#if ENABLE(FULLSCREEN_API) + if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) { + fullScreenManager()->didReceiveMessage(connection, messageID, arguments); + return; + } +#endif + didReceiveWebPageProxyMessage(connection, messageID, arguments); } @@ -1270,17 +1241,17 @@ void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIP } #endif +#if ENABLE(FULLSCREEN_API) + if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) { + fullScreenManager()->didReceiveSyncMessage(connection, messageID, arguments, reply); + return; + } +#endif + // FIXME: Do something with reply. didReceiveSyncWebPageProxyMessage(connection, messageID, arguments, reply); } -#if PLATFORM(MAC) -void WebPageProxy::interpretKeyEvent(uint32_t type, Vector<KeypressCommand>& commandsList, uint32_t selectionStart, uint32_t selectionEnd, Vector<CompositionUnderline>& underlines) -{ - m_pageClient->interceptKeyEvent(m_keyEventQueue.first(), commandsList, selectionStart, selectionEnd, underlines); -} -#endif - void WebPageProxy::didCreateMainFrame(uint64_t frameID) { MESSAGE_CHECK(!m_mainFrame); @@ -1382,7 +1353,7 @@ void WebPageProxy::didFinishProgress() m_loaderClient.didFinishProgress(this); } -void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, bool loadingSubstituteDataForUnreachableURL, CoreIPC::ArgumentDecoder* arguments) +void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::ArgumentDecoder* arguments) { clearPendingAPIRequestURL(); @@ -1394,8 +1365,7 @@ void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const Strin WebFrameProxy* frame = process()->webFrame(frameID); MESSAGE_CHECK(frame); - if (!loadingSubstituteDataForUnreachableURL) - frame->setUnreachableURL(String()); + frame->setUnreachableURL(unreachableURL); frame->didStartProvisionalLoad(url); m_loaderClient.didStartProvisionalLoadForFrame(this, frame, userData.get()); @@ -1431,6 +1401,19 @@ void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, const Resour m_loaderClient.didFailProvisionalLoadWithErrorForFrame(this, frame, error, userData.get()); } +void WebPageProxy::clearLoadDependentCallbacks() +{ + Vector<uint64_t> callbackIDsCopy; + copyToVector(m_loadDependentStringCallbackIDs, callbackIDsCopy); + m_loadDependentStringCallbackIDs.clear(); + + for (size_t i = 0; i < callbackIDsCopy.size(); ++i) { + RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackIDsCopy[i]); + if (callback) + callback->invalidate(); + } +} + void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo& certificateInfo, CoreIPC::ArgumentDecoder* arguments) { RefPtr<APIObject> userData; @@ -1438,9 +1421,15 @@ void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeTyp if (!arguments->decode(messageDecoder)) return; +#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) + dismissCorrectionPanel(ReasonForDismissingCorrectionPanelIgnored); +#endif + WebFrameProxy* frame = process()->webFrame(frameID); MESSAGE_CHECK(frame); + clearLoadDependentCallbacks(); + frame->didCommitLoad(mimeType, certificateInfo); if (frame->isMainFrame()) { @@ -1489,6 +1478,8 @@ void WebPageProxy::didFailLoadForFrame(uint64_t frameID, const ResourceError& er WebFrameProxy* frame = process()->webFrame(frameID); MESSAGE_CHECK(frame); + clearLoadDependentCallbacks(); + frame->didFailLoad(); m_loaderClient.didFailLoadWithErrorForFrame(this, frame, error, userData.get()); @@ -1798,6 +1789,9 @@ void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message) WebFrameProxy* frame = process()->webFrame(frameID); MESSAGE_CHECK(frame); + // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer. + process()->responsivenessTimer()->stop(); + m_uiClient.runJavaScriptAlert(this, message, frame); } @@ -1806,6 +1800,9 @@ void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, WebFrameProxy* frame = process()->webFrame(frameID); MESSAGE_CHECK(frame); + // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer. + process()->responsivenessTimer()->stop(); + result = m_uiClient.runJavaScriptConfirm(this, message, frame); } @@ -1814,6 +1811,9 @@ void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, WebFrameProxy* frame = process()->webFrame(frameID); MESSAGE_CHECK(frame); + // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer. + process()->responsivenessTimer()->stop(); + result = m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame); } @@ -1889,6 +1889,11 @@ void WebPageProxy::getWindowFrame(FloatRect& newWindowFrame) newWindowFrame = m_pageClient->convertToUserSpace(m_uiClient.windowFrame(this)); } +void WebPageProxy::windowToScreen(const IntRect& viewRect, IntRect& result) +{ + result = m_pageClient->windowToScreen(viewRect); +} + void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose) { WebFrameProxy* frame = process()->webFrame(frameID); @@ -1898,9 +1903,9 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t f } #if ENABLE(TILED_BACKING_STORE) -void WebPageProxy::pageDidRequestScroll(const IntSize& delta) +void WebPageProxy::pageDidRequestScroll(const IntPoint& point) { - m_pageClient->pageDidRequestScroll(delta); + m_pageClient->pageDidRequestScroll(point); } #endif @@ -1983,6 +1988,15 @@ WebInspectorProxy* WebPageProxy::inspector() #endif +#if ENABLE(FULLSCREEN_API) +WebFullScreenManagerProxy* WebPageProxy::fullScreenManager() +{ + if (!m_fullScreenManager) + m_fullScreenManager = WebFullScreenManagerProxy::create(this); + return m_fullScreenManager.get(); +} +#endif + // BackForwardList void WebPageProxy::backForwardAddItem(uint64_t itemID) @@ -2016,17 +2030,6 @@ void WebPageProxy::selectionStateChanged(const SelectionState& selectionState) m_selectionState = selectionState; } -#if PLATFORM(MAC) -// Complex text input support for plug-ins. -void WebPageProxy::sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput) -{ - if (!isValid()) - return; - - process()->send(Messages::WebPage::SendComplexTextInputToPlugin(pluginComplexTextInputIdentifier, textInput), m_pageID); -} -#endif - #if PLATFORM(WIN) void WebPageProxy::didChangeCompositionSelection(bool hasComposition) { @@ -2061,7 +2064,7 @@ void WebPageProxy::didCountStringMatches(const String& string, uint32_t matchCou m_findClient.didCountStringMatches(this, string, matchCount); } -void WebPageProxy::setFindIndicator(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, const SharedMemory::Handle& contentImageHandle, bool fadeOut) +void WebPageProxy::setFindIndicator(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut) { RefPtr<FindIndicator> findIndicator = FindIndicator::create(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageHandle); m_pageClient->setFindIndicator(findIndicator.release(), fadeOut); @@ -2126,20 +2129,21 @@ void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const ContextMe m_activeContextMenuState = contextMenuState; - if (m_activeContextMenu) + if (m_activeContextMenu) { m_activeContextMenu->hideContextMenu(); - else - m_activeContextMenu = m_pageClient->createContextMenuProxy(this); + m_activeContextMenu = 0; + } + + m_activeContextMenu = m_pageClient->createContextMenuProxy(this); + + // Since showContextMenu() can spin a nested run loop we need to turn off the responsiveness timer. + process()->responsivenessTimer()->stop(); // Give the PageContextMenuClient one last swipe at changing the menu. Vector<WebContextMenuItemData> items; - - if (!m_contextMenuClient.getContextMenuFromProposedMenu(this, proposedItems, items, userData.get())) { + if (!m_contextMenuClient.getContextMenuFromProposedMenu(this, proposedItems, items, userData.get())) m_activeContextMenu->showContextMenu(menuLocation, proposedItems); - return; - } - - if (items.size()) + else m_activeContextMenu->showContextMenu(menuLocation, items); } @@ -2176,6 +2180,11 @@ void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item) process()->updateTextCheckerState(); return; } + if (item.action() == ContextMenuItemTagCorrectSpellingAutomatically) { + TextChecker::setAutomaticSpellingCorrectionEnabled(!TextChecker::state().isAutomaticSpellingCorrectionEnabled); + process()->updateTextCheckerState(); + return; + } #endif if (item.action() == ContextMenuItemTagDownloadImageToDisk) { m_context->download(this, KURL(KURL(), m_activeContextMenuState.absoluteImageURLString)); @@ -2185,7 +2194,16 @@ void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item) m_context->download(this, KURL(KURL(), m_activeContextMenuState.absoluteLinkURLString)); return; } - + if (item.action() == ContextMenuItemTagCheckSpellingWhileTyping) { + TextChecker::setContinuousSpellCheckingEnabled(!TextChecker::state().isContinuousSpellCheckingEnabled); + process()->updateTextCheckerState(); + return; + } + if (item.action() == ContextMenuItemTagCheckGrammarWithSpelling) { + TextChecker::setGrammarCheckingEnabled(!TextChecker::state().isGrammarCheckingEnabled); + process()->updateTextCheckerState(); + return; + } if (item.action() == ContextMenuItemTagLearnSpelling || item.action() == ContextMenuItemTagIgnoreSpelling) ++m_pendingLearnOrIgnoreWordMessageCount; @@ -2247,33 +2265,6 @@ void WebPageProxy::unmarkAllBadGrammar() process()->send(Messages::WebPage::UnmarkAllBadGrammar(), m_pageID); } -#if PLATFORM(MAC) -void WebPageProxy::uppercaseWord() -{ - process()->send(Messages::WebPage::UppercaseWord(), m_pageID); -} - -void WebPageProxy::lowercaseWord() -{ - process()->send(Messages::WebPage::LowercaseWord(), m_pageID); -} - -void WebPageProxy::capitalizeWord() -{ - process()->send(Messages::WebPage::CapitalizeWord(), m_pageID); -} - -void WebPageProxy::setSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled) -{ - if (m_isSmartInsertDeleteEnabled == isSmartInsertDeleteEnabled) - return; - - TextChecker::setSmartInsertDeleteEnabled(isSmartInsertDeleteEnabled); - m_isSmartInsertDeleteEnabled = isSmartInsertDeleteEnabled; - process()->send(Messages::WebPage::SetSmartInsertDeleteEnabled(isSmartInsertDeleteEnabled), m_pageID); -} -#endif - void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo) { m_pageClient->registerEditCommand(commandProxy, undoOrRedo); @@ -2293,6 +2284,11 @@ void WebPageProxy::removeEditCommand(WebEditCommandProxy* command) process()->send(Messages::WebPage::DidRemoveEditCommand(command->commandID()), m_pageID); } +bool WebPageProxy::isValidEditCommand(WebEditCommandProxy* command) +{ + return m_editCommandSet.find(command) != m_editCommandSet.end(); +} + int64_t WebPageProxy::spellDocumentTag() { if (!m_hasSpellDocumentTag) { @@ -2341,6 +2337,11 @@ void WebPageProxy::ignoreWord(const String& word) // Other +void WebPageProxy::setFocus(bool focused) +{ + m_pageClient->setFocus(focused); +} + void WebPageProxy::takeFocus(bool direction) { m_pageClient->takeFocus(direction); @@ -2453,9 +2454,12 @@ void WebPageProxy::stringCallback(const String& resultString, uint64_t callbackI RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackID); if (!callback) { // FIXME: Log error or assert. + // this can validly happen if a load invalidated the callback, though return; } + m_loadDependentStringCallbackIDs.remove(callbackID); + callback->performCallbackWithReturnValue(resultString.impl()); } @@ -2496,26 +2500,6 @@ void WebPageProxy::validateCommandCallback(const String& commandName, bool isEna callback->performCallbackWithReturnValue(commandName.impl(), isEnabled, state); } -#if PLATFORM(MAC) -void WebPageProxy::didPerformDictionaryLookup(const String& text, const DictionaryPopupInfo& dictionaryPopupInfo) -{ - m_pageClient->didPerformDictionaryLookup(text, m_viewScaleFactor, dictionaryPopupInfo); -} - -void WebPageProxy::registerWebProcessAccessibilityToken(const CoreIPC::DataReference& data) -{ - m_pageClient->accessibilityWebProcessTokenReceived(data); -} - -void WebPageProxy::registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elementToken, const CoreIPC::DataReference& windowToken) -{ - if (!isValid()) - return; - - process()->send(Messages::WebPage::RegisterUIProcessAccessibilityTokens(elementToken, windowToken), m_pageID); -} -#endif - void WebPageProxy::focusedFrameChanged(uint64_t frameID) { if (!frameID) { @@ -2572,6 +2556,13 @@ void WebPageProxy::processDidCrash() } #endif +#if ENABLE(FULLSCREEN_API) + if (m_fullScreenManager) { + m_fullScreenManager->invalidate(); + m_fullScreenManager = 0; + } +#endif + if (m_openPanelResultListener) { m_openPanelResultListener->invalidate(); m_openPanelResultListener = 0; @@ -2590,6 +2581,7 @@ void WebPageProxy::processDidCrash() invalidateCallbackMap(m_voidCallbacks); invalidateCallbackMap(m_dataCallbacks); invalidateCallbackMap(m_stringCallbacks); + m_loadDependentStringCallbackIDs.clear(); invalidateCallbackMap(m_scriptValueCallbacks); invalidateCallbackMap(m_computedPagesCallbacks); invalidateCallbackMap(m_validateCommandCallbacks); @@ -2633,6 +2625,7 @@ WebPageCreationParameters WebPageProxy::creationParameters() const parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID(); parameters.canRunBeforeUnloadConfirmPanel = m_uiClient.canRunBeforeUnloadConfirmPanel(); parameters.canRunModal = m_uiClient.canRunModal(); + parameters.userSpaceScaleFactor = m_pageClient->userSpaceScaleFactor(); #if PLATFORM(MAC) parameters.isSmartInsertDeleteEnabled = m_isSmartInsertDeleteEnabled; @@ -2677,7 +2670,7 @@ void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const Web WebFrameProxy* frame = process()->webFrame(frameID); MESSAGE_CHECK(frame); - RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, this); + RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, process()); m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get()); } @@ -2748,18 +2741,6 @@ void WebPageProxy::didFinishLoadingDataForCustomRepresentation(const String& sug m_pageClient->didFinishLoadingDataForCustomRepresentation(suggestedFilename, dataReference); } -#if PLATFORM(MAC) -void WebPageProxy::setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled) -{ - m_pageClient->setComplexTextInputEnabled(pluginComplexTextInputIdentifier, complexTextInputEnabled); -} - -void WebPageProxy::setAutodisplay(bool newState) -{ - m_pageClient->setAutodisplay(newState); -} -#endif - void WebPageProxy::backForwardRemovedItem(uint64_t itemID) { process()->send(Messages::WebPage::DidRemoveBackForwardItem(itemID), m_pageID); @@ -2822,4 +2803,41 @@ Color WebPageProxy::backingStoreUpdatesFlashColor() return Color(200, 0, 255); } +void WebPageProxy::saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData* data) +{ + m_uiClient.saveDataToFileInDownloadsFolder(this, suggestedFilename, mimeType, originatingURLString, data); +} + +#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) +void WebPageProxy::showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) +{ + m_pageClient->showCorrectionPanel((WebCore::CorrectionPanelInfo::PanelType)panelType, boundingBoxOfReplacedString, replacedString, replacementString, alternativeReplacementStrings); +} + +void WebPageProxy::dismissCorrectionPanel(int32_t reason) +{ + m_pageClient->dismissCorrectionPanel((WebCore::ReasonForDismissingCorrectionPanel)reason); +} + +void WebPageProxy::dismissCorrectionPanelSoon(int32_t reason, String& result) +{ + result = m_pageClient->dismissCorrectionPanelSoon((WebCore::ReasonForDismissingCorrectionPanel)reason); +} + +void WebPageProxy::recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString) +{ + m_pageClient->recordAutocorrectionResponse((WebCore::EditorClient::AutocorrectionResponseType)responseType, replacedString, replacementString); +} +#endif + +#if PLATFORM(MAC) +void WebPageProxy::handleCorrectionPanelResult(const String& result) +{ +#if !defined(BUILDING_ON_SNOW_LEOPARD) + if (!isClosed()) + process()->send(Messages::WebPage::HandleCorrectionPanelResult(result), m_pageID, 0); +#endif +} +#endif + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h index ce56cea..e3e62d4 100644 --- a/Source/WebKit2/UIProcess/WebPageProxy.h +++ b/Source/WebKit2/UIProcess/WebPageProxy.h @@ -27,6 +27,7 @@ #define WebPageProxy_h #include "APIObject.h" +#include "Connection.h" #include "ContextMenuState.h" #include "DragControllerAction.h" #include "DrawingAreaProxy.h" @@ -37,24 +38,17 @@ #include "WKBase.h" #include "WKPagePrivate.h" #include "WebContextMenuItemData.h" -#include "WebEvent.h" #include "WebFindClient.h" -#include "WebFindOptions.h" #include "WebFormClient.h" #include "WebFrameProxy.h" #include "WebHistoryClient.h" -#include "WebInspectorProxy.h" #include "WebLoaderClient.h" #include "WebPageContextMenuClient.h" #include "WebPolicyClient.h" #include "WebPopupMenuProxy.h" #include "WebResourceLoadClient.h" #include "WebUIClient.h" -#include <WebCore/DragActions.h> -#include <WebCore/EditAction.h> -#include <WebCore/Editor.h> -#include <WebCore/FrameLoaderTypes.h> -#include <WebCore/KeyboardEvent.h> +#include <WebCore/ScrollTypes.h> #include <wtf/HashMap.h> #include <wtf/HashSet.h> #include <wtf/OwnPtr.h> @@ -83,7 +77,6 @@ namespace WebCore { namespace WebKit { -class DrawingAreaProxy; class NativeWebKeyboardEvent; class PageClient; class PlatformCertificateInfo; @@ -93,15 +86,14 @@ class WebBackForwardListItem; class WebContextMenuProxy; class WebData; class WebEditCommandProxy; +class WebFullScreenManagerProxy; class WebKeyboardEvent; class WebMouseEvent; class WebOpenPanelResultListenerProxy; class WebPageGroup; -class WebPopupMenuProxy; class WebProcessProxy; class WebURLRequest; class WebWheelEvent; -struct ContextMenuState; struct DictionaryPopupInfo; struct PlatformPopupMenuData; struct PrintInfo; @@ -182,6 +174,10 @@ public: WebInspectorProxy* inspector(); #endif +#if ENABLE(FULLSCREEN_API) + WebFullScreenManagerProxy* fullScreenManager(); +#endif + void initializeContextMenuClient(const WKPageContextMenuClient*); void initializeFindClient(const WKPageFindClient*); void initializeFormClient(const WKPageFormClient*); @@ -282,6 +278,8 @@ public: void handleTouchEvent(const WebTouchEvent&); #endif + void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity); + String pageTitle() const; const String& toolTip() const { return m_toolTip; } @@ -331,6 +329,7 @@ public: // Called by the UI process when it is ready to send its tokens to the web process. void registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elemenToken, const CoreIPC::DataReference& windowToken); bool writeSelectionToPasteboard(const String& pasteboardName, const Vector<String>& pasteboardTypes); + bool readSelectionFromPasteboard(const String& pasteboardName); #endif void viewScaleFactorDidChange(double); @@ -358,8 +357,6 @@ public: void drawFooter(WebFrameProxy*, const WebCore::FloatRect&); #if PLATFORM(MAC) - void setAutodisplay(bool); - // Dictionary. void performDictionaryLookupAtLocation(const WebCore::FloatPoint&); #endif @@ -373,7 +370,7 @@ public: void didPerformDragControllerAction(uint64_t resultOperation); void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation); #if PLATFORM(MAC) - void setDragImage(const WebCore::IntPoint& clientPosition, const WebCore::IntSize& imageSize, const SharedMemory::Handle& dragImageHandle, bool isLinkDrag); + void setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, bool isLinkDrag); #endif #if PLATFORM(WIN) void startDragDrop(const WebCore::IntPoint& imagePoint, const WebCore::IntPoint& dragPoint, uint64_t okEffect, const HashMap<UINT, Vector<String> >& dataMap, const WebCore::IntSize& dragImageSize, const SharedMemory::Handle& dragImageHandle, bool isLinkDrag); @@ -395,6 +392,7 @@ public: enum UndoOrRedo { Undo, Redo }; void addEditCommand(WebEditCommandProxy*); void removeEditCommand(WebEditCommandProxy*); + bool isValidEditCommand(WebEditCommandProxy*); void registerEditCommand(PassRefPtr<WebEditCommandProxy>, UndoOrRedo); WebProcessProxy* process() const; @@ -454,14 +452,21 @@ public: void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects); +#if PLATFORM(MAC) + void handleCorrectionPanelResult(const String& result); +#endif + static void setDebugPaintFlags(WKPageDebugPaintFlags flags) { s_debugPaintFlags = flags; } static WKPageDebugPaintFlags debugPaintFlags() { return s_debugPaintFlags; } // Color to be used with kWKDebugFlashViewUpdates. static WebCore::Color viewUpdatesFlashColor(); + // Color to be used with kWKDebugFlashBackingStoreUpdates. static WebCore::Color backingStoreUpdatesFlashColor(); + void saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData*); + private: WebPageProxy(PageClient*, WebContext*, WebPageGroup*, uint64_t pageID); @@ -480,7 +485,7 @@ private: void didSaveFrameToPageCache(uint64_t frameID); void didRestoreFrameFromPageCache(uint64_t frameID, uint64_t parentFrameID); - void didStartProvisionalLoadForFrame(uint64_t frameID, const String&, bool loadingSubstituteDataForUnreachableURL, CoreIPC::ArgumentDecoder*); + void didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::ArgumentDecoder*); void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String&, CoreIPC::ArgumentDecoder*); void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::ArgumentDecoder*); void didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo&, CoreIPC::ArgumentDecoder*); @@ -534,6 +539,7 @@ private: void getIsResizable(bool& isResizable); void setWindowFrame(const WebCore::FloatRect&); void getWindowFrame(WebCore::FloatRect&); + void windowToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result); void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose); void didChangeViewportData(const WebCore::ViewportArguments&); void pageDidScroll(); @@ -550,7 +556,7 @@ private: void reattachToWebProcessWithItem(WebBackForwardListItem*); #if ENABLE(TILED_BACKING_STORE) - void pageDidRequestScroll(const WebCore::IntSize&); + void pageDidRequestScroll(const WebCore::IntPoint&); #endif #if PLATFORM(QT) @@ -580,7 +586,7 @@ private: // Find. void didCountStringMatches(const String&, uint32_t matchCount); - void setFindIndicator(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, const SharedMemory::Handle& contentImageHandle, bool fadeOut); + void setFindIndicator(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut); void didFindString(const String&, uint32_t matchCount); void didFailToFindString(const String&); @@ -610,6 +616,7 @@ private: void learnWord(const String& word); void ignoreWord(const String& word); + void setFocus(bool focused); void takeFocus(bool direction); void setToolTip(const String&); void setCursor(const WebCore::Cursor&); @@ -642,6 +649,15 @@ private: void initializeSandboxExtensionHandle(const WebCore::KURL&, SandboxExtension::Handle&); +#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) + void showCorrectionPanel(int32_t panelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings); + void dismissCorrectionPanel(int32_t reason); + void dismissCorrectionPanelSoon(int32_t reason, String& result); + void recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString); +#endif + + void clearLoadDependentCallbacks(); + PageClient* m_pageClient; WebLoaderClient m_loaderClient; WebPolicyClient m_policyClient; @@ -667,9 +683,14 @@ private: RefPtr<WebInspectorProxy> m_inspector; #endif +#if ENABLE(FULLSCREEN_API) + RefPtr<WebFullScreenManagerProxy> m_fullScreenManager; +#endif + HashMap<uint64_t, RefPtr<VoidCallback> > m_voidCallbacks; HashMap<uint64_t, RefPtr<DataCallback> > m_dataCallbacks; HashMap<uint64_t, RefPtr<StringCallback> > m_stringCallbacks; + HashSet<uint64_t> m_loadDependentStringCallbackIDs; HashMap<uint64_t, RefPtr<ScriptValueCallback> > m_scriptValueCallbacks; HashMap<uint64_t, RefPtr<ComputedPagesCallback> > m_computedPagesCallbacks; HashMap<uint64_t, RefPtr<ValidateCommandCallback> > m_validateCommandCallbacks; diff --git a/Source/WebKit2/UIProcess/WebPageProxy.messages.in b/Source/WebKit2/UIProcess/WebPageProxy.messages.in index 8692f14..e145d82 100644 --- a/Source/WebKit2/UIProcess/WebPageProxy.messages.in +++ b/Source/WebKit2/UIProcess/WebPageProxy.messages.in @@ -35,6 +35,7 @@ messages -> WebPageProxy { SetCursor(WebCore::Cursor cursor) SetStatusText(WTF::String statusText) SetToolTip(WTF::String toolTip) + SetFocus(bool focused) TakeFocus(bool direction) FocusedFrameChanged(uint64_t frameID) FrameSetLargestFrameChanged(uint64_t frameID) @@ -48,6 +49,7 @@ messages -> WebPageProxy { GetIsResizable() -> (bool isResizable) SetWindowFrame(WebCore::FloatRect windowFrame) GetWindowFrame() -> (WebCore::FloatRect windowFrame) + WindowToScreen(WebCore::IntRect rect) -> (WebCore::IntRect screenFrame) RunBeforeUnloadConfirmPanel(WTF::String message, uint64_t frameID) -> (bool shouldClose) PageDidScroll() RunOpenPanel(uint64_t frameID, WebKit::WebOpenPanelParameters::Data parameters) @@ -58,7 +60,7 @@ messages -> WebPageProxy { DidChangeScrollOffsetPinningForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar) #if ENABLE(TILED_BACKING_STORE) - PageDidRequestScroll(WebCore::IntSize delta) + PageDidRequestScroll(WebCore::IntPoint point) #endif #if PLATFORM(QT) DidChangeContentsSize(WebCore::IntSize newSize) @@ -92,7 +94,7 @@ messages -> WebPageProxy { DidFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData) DidReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, WTF::String url, WebKit::InjectedBundleUserMessageEncoder userData) DidRemoveFrameFromHierarchy(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData) - DidStartProvisionalLoadForFrame(uint64_t frameID, WTF::String url, bool loadingSubstituteDataForUnreachableURL, WebKit::InjectedBundleUserMessageEncoder userData) + DidStartProvisionalLoadForFrame(uint64_t frameID, WTF::String url, WTF::String unreachableURL, WebKit::InjectedBundleUserMessageEncoder userData) DidReceiveTitleForFrame(uint64_t frameID, WTF::String title, WebKit::InjectedBundleUserMessageEncoder userData) DidDisplayInsecureContentForFrame(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData) DidRunInsecureContentForFrame(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData) @@ -157,7 +159,7 @@ messages -> WebPageProxy { # Find messages DidCountStringMatches(WTF::String string, uint32_t matchCount) - SetFindIndicator(WebCore::FloatRect selectionRect, Vector<WebCore::FloatRect> textRects, WebKit::SharedMemory::Handle contentImageHandle, bool fadeOut) + SetFindIndicator(WebCore::FloatRect selectionRect, Vector<WebCore::FloatRect> textRects, WebKit::ShareableBitmap::Handle contentImageHandle, bool fadeOut) DidFindString(WTF::String string, uint32_t matchCount) DidFailToFindString(WTF::String string) @@ -201,9 +203,17 @@ messages -> WebPageProxy { # Drag and drop messages DidPerformDragControllerAction(uint64_t resultOperation) #if PLATFORM(MAC) - SetDragImage(WebCore::IntPoint clientPosition, WebCore::IntSize imageSize, WebKit::SharedMemory::Handle dragImage, bool linkDrag) + SetDragImage(WebCore::IntPoint clientPosition, WebKit::ShareableBitmap::Handle dragImage, bool linkDrag) #endif #if PLATFORM(WIN) StartDragDrop(WebCore::IntPoint imagePoint, WebCore::IntPoint dragPoint, uint64_t okEffect, HashMap<UINT,Vector<String> > dataMap, WebCore::IntSize dragImageSize, WebKit::SharedMemory::Handle dragImage, bool linkDrag) #endif + +#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) + # Autocorrection messages + ShowCorrectionPanel(int32_t panelType, WebCore::FloatRect boundingBoxOfReplacedString, String replacedString, String replacementString, Vector<String> alternativeReplacementStrings) + DismissCorrectionPanel(int32_t reason) + DismissCorrectionPanelSoon(int32_t reason) -> (String result) + RecordAutocorrectionResponse(int32_t responseType, String replacedString, String replacementString); +#endif } diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.cpp b/Source/WebKit2/UIProcess/WebProcessProxy.cpp index 42e3408..8a48724 100644 --- a/Source/WebKit2/UIProcess/WebProcessProxy.cpp +++ b/Source/WebKit2/UIProcess/WebProcessProxy.cpp @@ -252,7 +252,9 @@ void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC || messageID.is<CoreIPC::MessageClassWebCookieManagerProxy>() || messageID.is<CoreIPC::MessageClassWebDatabaseManagerProxy>() || messageID.is<CoreIPC::MessageClassWebGeolocationManagerProxy>() + || messageID.is<CoreIPC::MessageClassWebIconDatabase>() || messageID.is<CoreIPC::MessageClassWebKeyValueStorageManagerProxy>() + || messageID.is<CoreIPC::MessageClassWebMediaCacheManagerProxy>() || messageID.is<CoreIPC::MessageClassWebResourceCacheManagerProxy>()) { m_context->didReceiveMessage(connection, messageID, arguments); return; @@ -290,7 +292,8 @@ CoreIPC::SyncReplyMode WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connectio } #endif - if (messageID.is<CoreIPC::MessageClassWebContext>() || messageID.is<CoreIPC::MessageClassWebContextLegacy>() || messageID.is<CoreIPC::MessageClassDownloadProxy>()) + if (messageID.is<CoreIPC::MessageClassWebContext>() || messageID.is<CoreIPC::MessageClassWebContextLegacy>() + || messageID.is<CoreIPC::MessageClassDownloadProxy>() || messageID.is<CoreIPC::MessageClassWebIconDatabase>()) return m_context->didReceiveSyncMessage(connection, messageID, arguments, reply); uint64_t pageID = arguments->destinationID(); diff --git a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp index aa65113..403a8dc 100644 --- a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp +++ b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp @@ -56,13 +56,15 @@ void WebResourceCacheManagerProxy::invalidate() invalidateCallbackMap(m_arrayCallbacks); } +bool WebResourceCacheManagerProxy::shouldTerminate(WebProcessProxy*) const +{ + return m_arrayCallbacks.isEmpty(); +} + void WebResourceCacheManagerProxy::getCacheOrigins(PassRefPtr<ArrayCallback> prpCallback) { RefPtr<ArrayCallback> callback = prpCallback; - if (!m_webContext->hasValidProcess()) { - callback->invalidate(); - return; - } + m_webContext->relaunchProcessIfNecessary(); uint64_t callbackID = callback->callbackID(); m_arrayCallbacks.set(callbackID, callback.release()); m_webContext->process()->send(Messages::WebResourceCacheManager::GetCacheOrigins(callbackID), 0); @@ -76,8 +78,7 @@ void WebResourceCacheManagerProxy::didGetCacheOrigins(const Vector<SecurityOrigi void WebResourceCacheManagerProxy::clearCacheForOrigin(WebSecurityOrigin* origin) { - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); SecurityOriginData securityOrigin; securityOrigin.protocol = origin->protocol(); @@ -88,8 +89,7 @@ void WebResourceCacheManagerProxy::clearCacheForOrigin(WebSecurityOrigin* origin void WebResourceCacheManagerProxy::clearCacheForAllOrigins() { - if (!m_webContext->hasValidProcess()) - return; + m_webContext->relaunchProcessIfNecessary(); m_webContext->process()->send(Messages::WebResourceCacheManager::ClearCacheForAllOrigins(), 0); } diff --git a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h index 0a2c3c8..1a360b4 100644 --- a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h +++ b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h @@ -42,6 +42,7 @@ namespace WebKit { struct SecurityOriginData; class WebContext; +class WebProcessProxy; class WebSecurityOrigin; typedef GenericCallback<WKArrayRef> ArrayCallback; @@ -62,6 +63,8 @@ public: void didReceiveWebResourceCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + bool shouldTerminate(WebProcessProxy*) const; + private: explicit WebResourceCacheManagerProxy(WebContext*); diff --git a/Source/WebKit2/UIProcess/WebUIClient.cpp b/Source/WebKit2/UIProcess/WebUIClient.cpp index 31dd458..9bb8efc 100644 --- a/Source/WebKit2/UIProcess/WebUIClient.cpp +++ b/Source/WebKit2/UIProcess/WebUIClient.cpp @@ -329,10 +329,18 @@ void WebUIClient::runModal(WebPageProxy* page) void WebUIClient::didCompleteRubberBandForMainFrame(WebPageProxy* page, const IntSize& initialOverhang) { - if (!m_client.runModal) + if (!m_client.didCompleteRubberBandForMainFrame) return; m_client.didCompleteRubberBandForMainFrame(toAPI(page), toAPI(initialOverhang), m_client.clientInfo); } +void WebUIClient::saveDataToFileInDownloadsFolder(WebPageProxy* page, const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData* data) +{ + if (!m_client.saveDataToFileInDownloadsFolder) + return; + + m_client.saveDataToFileInDownloadsFolder(toAPI(page), toAPI(suggestedFilename.impl()), toAPI(mimeType.impl()), toURLRef(originatingURLString.impl()), toAPI(data), m_client.clientInfo); +} + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/WebUIClient.h b/Source/WebKit2/UIProcess/WebUIClient.h index ed47f8f..8fcf7b6 100644 --- a/Source/WebKit2/UIProcess/WebUIClient.h +++ b/Source/WebKit2/UIProcess/WebUIClient.h @@ -44,6 +44,7 @@ namespace WebKit { class APIObject; class GeolocationPermissionRequestProxy; class NativeWebKeyboardEvent; +class WebData; class WebFrameProxy; class WebPageProxy; class WebSecurityOrigin; @@ -98,6 +99,8 @@ public: void runModal(WebPageProxy*); void didCompleteRubberBandForMainFrame(WebPageProxy*, const WebCore::IntSize&); + + void saveDataToFileInDownloadsFolder(WebPageProxy*, const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData*); }; } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp b/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp index dc26899..45e77df 100644 --- a/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp +++ b/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp @@ -151,7 +151,6 @@ void WebPageProxy::restoreFromSessionStateData(WebData* webData) provisionalURL = static_cast<CFStringRef>(value); } - bool restoredFromBackForwardList = false; if (backForwardListDictionary) { if (!m_backForwardList->restoreFromCFDictionaryRepresentation(backForwardListDictionary)) LOG(SessionState, "Failed to restore back/forward list from SessionHistory dictionary"); @@ -161,21 +160,23 @@ void WebPageProxy::restoreFromSessionStateData(WebData* webData) for (size_t i = 0; i < size; ++i) process()->registerNewWebBackForwardListItem(entries[i].get()); - SandboxExtension::Handle sandboxExtensionHandle; - if (WebBackForwardListItem* item = m_backForwardList->currentItem()) - initializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle); - - process()->send(Messages::WebPage::RestoreSessionAndNavigateToCurrentItem(SessionState(m_backForwardList->entries(), m_backForwardList->currentIndex()), sandboxExtensionHandle), m_pageID); - - restoredFromBackForwardList = true; + SessionState state(m_backForwardList->entries(), m_backForwardList->currentIndex()); + if (provisionalURL) + process()->send(Messages::WebPage::RestoreSession(state), m_pageID); + else { + SandboxExtension::Handle sandboxExtensionHandle; + if (WebBackForwardListItem* item = m_backForwardList->currentItem()) { + initializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle); + setPendingAPIRequestURL(item->url()); + } + + process()->send(Messages::WebPage::RestoreSessionAndNavigateToCurrentItem(state, sandboxExtensionHandle), m_pageID); + } } } } - // FIXME: It would be better to load the provisional URL even if the back/forward list is also present. - // But when we tried it, it overwrote the current item in the back/forward list instead of pushing a - // new item on. For now, just throw away the provisional URL if there is also a back/forward list. - if (provisionalURL && !restoredFromBackForwardList) + if (provisionalURL) loadURL(provisionalURL); } diff --git a/Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp b/Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp index d67726c..e09bfa5 100644 --- a/Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp +++ b/Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp @@ -41,9 +41,24 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters&) { } +void WebContext::platformInvalidateContext() +{ +} + String WebContext::platformDefaultDatabaseDirectory() const { return WTF::String::fromUTF8(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL)); } +String WebContext::platformDefaultIconDatabasePath() const +{ + // FIXME: Implement. + return WTF::String(); +} + +String WebContext::platformDefaultLocalStorageDirectory() const +{ + return WTF::String::fromUTF8(g_build_filename(g_get_user_data_dir(), "webkit", "localstorage", NULL)); +} + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp b/Source/WebKit2/UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp new file mode 100644 index 0000000..82e8657 --- /dev/null +++ b/Source/WebKit2/UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2011 Igalia S.L. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" +#include "WebFullScreenManagerProxy.h" + +#if ENABLE(FULLSCREEN_API) + +#include "WebContext.h" +#include "WebFullScreenManagerMessages.h" +#include "WebFullScreenManagerProxyMessages.h" +#include "WebProcess.h" + +#include <WebCore/NotImplemented.h> + +namespace WebKit { + +void WebFullScreenManagerProxy::enterFullScreen() +{ + notImplemented(); +} + +void WebFullScreenManagerProxy::exitFullScreen() +{ + notImplemented(); +} + +void WebFullScreenManagerProxy::beganEnterFullScreenAnimation() +{ + notImplemented(); +} + +void WebFullScreenManagerProxy::finishedEnterFullScreenAnimation(bool completed) +{ + notImplemented(); +} + +void WebFullScreenManagerProxy::beganExitFullScreenAnimation() +{ + notImplemented(); +} + +void WebFullScreenManagerProxy::finishedExitFullScreenAnimation(bool completed) +{ + notImplemented(); +} + +void WebFullScreenManagerProxy::enterAcceleratedCompositingMode(const LayerTreeContext& context) +{ + notImplemented(); +} + +void WebFullScreenManagerProxy::exitAcceleratedCompositingMode() +{ + notImplemented(); +} + +void WebFullScreenManagerProxy::getFullScreenRect(WebCore::IntRect& rect) +{ + notImplemented(); +} + +} // namespace WebKit + +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit2/UIProcess/gtk/WebView.cpp b/Source/WebKit2/UIProcess/gtk/WebView.cpp index 5063922..2ff67cd 100644 --- a/Source/WebKit2/UIProcess/gtk/WebView.cpp +++ b/Source/WebKit2/UIProcess/gtk/WebView.cpp @@ -179,6 +179,11 @@ void WebView::didRelaunchProcess() notImplemented(); } +void WebView::setFocus(bool) +{ + notImplemented(); +} + void WebView::takeFocus(bool) { notImplemented(); @@ -189,9 +194,17 @@ void WebView::toolTipChanged(const String&, const String&) notImplemented(); } -void WebView::setCursor(const Cursor&) +void WebView::setCursor(const Cursor& cursor) { - notImplemented(); + // [GTK] Widget::setCursor() gets called frequently + // http://bugs.webkit.org/show_bug.cgi?id=16388 + // Setting the cursor may be an expensive operation in some backends, + // so don't re-set the cursor if it's already set to the target value. + GdkWindow* window = gtk_widget_get_window(m_viewWidget); + GdkCursor* currentCursor = gdk_window_get_cursor(window); + GdkCursor* newCursor = cursor.platformCursor().get(); + if (currentCursor != newCursor) + gdk_window_set_cursor(window, newCursor); } void WebView::setViewportArguments(const WebCore::ViewportArguments&) @@ -221,6 +234,12 @@ FloatRect WebView::convertToUserSpace(const FloatRect& viewRect) return viewRect; } +IntRect WebView::windowToScreen(const IntRect& rect) +{ + notImplemented(); + return IntRect(); +} + void WebView::doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) { notImplemented(); diff --git a/Source/WebKit2/UIProcess/gtk/WebView.h b/Source/WebKit2/UIProcess/gtk/WebView.h index 256dc04..6c281ed 100644 --- a/Source/WebKit2/UIProcess/gtk/WebView.h +++ b/Source/WebKit2/UIProcess/gtk/WebView.h @@ -85,6 +85,7 @@ private: virtual void processDidCrash(); virtual void didRelaunchProcess(); virtual void pageClosed(); + virtual void setFocus(bool focused); virtual void takeFocus(bool direction); virtual void toolTipChanged(const WTF::String&, const WTF::String&); virtual void setCursor(const WebCore::Cursor&); @@ -93,6 +94,7 @@ private: virtual void clearAllEditCommands(); virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&); virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&); + virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&); virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled); virtual void didNotHandleKeyEvent(const NativeWebKeyboardEvent&); virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*); @@ -100,6 +102,7 @@ private: virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut); virtual void didChangeScrollbarsForMainFrame() const; virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects); + virtual float userSpaceScaleFactor() const { return 1; } #if USE(ACCELERATED_COMPOSITING) virtual void pageDidEnterAcceleratedCompositing(); diff --git a/Source/WebKit2/UIProcess/mac/CorrectionPanel.h b/Source/WebKit2/UIProcess/mac/CorrectionPanel.h new file mode 100644 index 0000000..d4bc353 --- /dev/null +++ b/Source/WebKit2/UIProcess/mac/CorrectionPanel.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef CorrectionPanel_h +#define CorrectionPanel_h + +#if !defined(BUILDING_ON_SNOW_LEOPARD) +#import <AppKit/NSTextChecker.h> +#import <WebCore/CorrectionPanelInfo.h> +#import <wtf/RetainPtr.h> + +@class WKView; + +namespace WebKit { + +class CorrectionPanel { +public: + CorrectionPanel(); + ~CorrectionPanel(); + void show(WKView*, WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings); + void dismiss(WebCore::ReasonForDismissingCorrectionPanel); + String dismissSoon(WebCore::ReasonForDismissingCorrectionPanel); + static void recordAutocorrectionResponse(WKView*, NSCorrectionResponse, const String& replacedString, const String& replacementString); + +private: + bool isShowing() const { return m_view; } + void dismissInternal(WebCore::ReasonForDismissingCorrectionPanel, bool dismissingExternally); + void handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement, NSCorrectionBubbleType); + + bool m_wasDismissedExternally; + WebCore::ReasonForDismissingCorrectionPanel m_reasonForDismissing; + RetainPtr<WKView> m_view; + RetainPtr<NSString> m_resultForSynchronousDismissal; + RetainPtr<NSCondition> m_resultCondition; +}; + +} // namespace WebKit + +#endif // !defined(BUILDING_ON_SNOW_LEOPARD) + +#endif // CorrectionPanel_h diff --git a/Source/WebKit2/UIProcess/mac/CorrectionPanel.mm b/Source/WebKit2/UIProcess/mac/CorrectionPanel.mm new file mode 100644 index 0000000..ab6818f --- /dev/null +++ b/Source/WebKit2/UIProcess/mac/CorrectionPanel.mm @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "config.h" +#if !defined(BUILDING_ON_SNOW_LEOPARD) +#import "CorrectionPanel.h" + +#import "WebPageProxy.h" +#import "WKView.h" +#import "WKViewPrivate.h" + +using namespace WebCore; + +static inline NSCorrectionBubbleType correctionBubbleType(CorrectionPanelInfo::PanelType panelType) +{ + switch (panelType) { + case CorrectionPanelInfo::PanelTypeCorrection: + return NSCorrectionBubbleTypeCorrection; + case CorrectionPanelInfo::PanelTypeReversion: + return NSCorrectionBubbleTypeReversion; + case CorrectionPanelInfo::PanelTypeSpellingSuggestions: + return NSCorrectionBubbleTypeGuesses; + } + ASSERT_NOT_REACHED(); + return NSCorrectionBubbleTypeCorrection; +} + +namespace WebKit { + +CorrectionPanel::CorrectionPanel() + : m_wasDismissedExternally(false) + , m_reasonForDismissing(ReasonForDismissingCorrectionPanelIgnored) + , m_resultCondition(AdoptNS, [[NSCondition alloc] init]) +{ +} + +CorrectionPanel::~CorrectionPanel() +{ + dismissInternal(ReasonForDismissingCorrectionPanelIgnored, false); +} + +void CorrectionPanel::show(WKView* view, CorrectionPanelInfo::PanelType type, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) +{ + dismissInternal(ReasonForDismissingCorrectionPanelIgnored, false); + + if (!view) + return; + + NSString* replacedStringAsNSString = replacedString; + NSString* replacementStringAsNSString = replacementString; + m_view = view; + NSCorrectionBubbleType bubbleType = correctionBubbleType(type); + + NSMutableArray* alternativeStrings = 0; + if (!alternativeReplacementStrings.isEmpty()) { + size_t size = alternativeReplacementStrings.size(); + alternativeStrings = [NSMutableArray arrayWithCapacity:size]; + for (size_t i = 0; i < size; ++i) + [alternativeStrings addObject:(NSString*)alternativeReplacementStrings[i]]; + } + + NSSpellChecker* spellChecker = [NSSpellChecker sharedSpellChecker]; + [spellChecker showCorrectionBubbleOfType:bubbleType primaryString:replacementStringAsNSString alternativeStrings:alternativeStrings forStringInRect:boundingBoxOfReplacedString view:m_view.get() completionHandler:^(NSString* acceptedString) { + handleAcceptedReplacement(acceptedString, replacedStringAsNSString, replacementStringAsNSString, bubbleType); + }]; +} + +void CorrectionPanel::dismiss(ReasonForDismissingCorrectionPanel reason) +{ + dismissInternal(reason, true); +} + +String CorrectionPanel::dismissSoon(ReasonForDismissingCorrectionPanel reason) +{ + if (!isShowing()) + return String(); + + dismissInternal(reason, true); + [m_resultCondition.get() lock]; + while (!m_resultForSynchronousDismissal) + [m_resultCondition.get() wait]; + [m_resultCondition.get() unlock]; + return m_resultForSynchronousDismissal.get(); +} + +void CorrectionPanel::dismissInternal(ReasonForDismissingCorrectionPanel reason, bool dismissingExternally) +{ + m_wasDismissedExternally = dismissingExternally; + if (!isShowing()) + return; + + m_reasonForDismissing = reason; + m_resultForSynchronousDismissal.clear(); + [[NSSpellChecker sharedSpellChecker] dismissCorrectionBubbleForView:m_view.get()]; + m_view.clear(); +} + +void CorrectionPanel::recordAutocorrectionResponse(WKView* view, NSCorrectionResponse response, const String& replacedString, const String& replacementString) +{ + [[NSSpellChecker sharedSpellChecker] recordResponse:response toCorrection:replacementString forWord:replacedString language:nil inSpellDocumentWithTag:[view spellCheckerDocumentTag]]; +} + +void CorrectionPanel::handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement, NSCorrectionBubbleType correctionBubbleType) +{ + NSSpellChecker* spellChecker = [NSSpellChecker sharedSpellChecker]; + NSInteger documentTag = [m_view.get() spellCheckerDocumentTag]; + + switch (correctionBubbleType) { + case NSCorrectionBubbleTypeCorrection: + if (acceptedReplacement) + [spellChecker recordResponse:NSCorrectionResponseAccepted toCorrection:acceptedReplacement forWord:replaced language:nil inSpellDocumentWithTag:documentTag]; + else { + if (!m_wasDismissedExternally || m_reasonForDismissing == ReasonForDismissingCorrectionPanelCancelled) + [spellChecker recordResponse:NSCorrectionResponseRejected toCorrection:proposedReplacement forWord:replaced language:nil inSpellDocumentWithTag:documentTag]; + else + [spellChecker recordResponse:NSCorrectionResponseIgnored toCorrection:proposedReplacement forWord:replaced language:nil inSpellDocumentWithTag:documentTag]; + } + break; + case NSCorrectionBubbleTypeReversion: + if (acceptedReplacement) + [spellChecker recordResponse:NSCorrectionResponseReverted toCorrection:replaced forWord:acceptedReplacement language:nil inSpellDocumentWithTag:documentTag]; + break; + case NSCorrectionBubbleTypeGuesses: + if (acceptedReplacement) + [spellChecker recordResponse:NSCorrectionResponseAccepted toCorrection:acceptedReplacement forWord:replaced language:nil inSpellDocumentWithTag:documentTag]; + break; + } + + if (!m_wasDismissedExternally) { + [m_view.get() handleCorrectionPanelResult:acceptedReplacement]; + return; + } + + [m_resultCondition.get() lock]; + if (acceptedReplacement) + m_resultForSynchronousDismissal.adoptNS([acceptedReplacement copy]); + [m_resultCondition.get() signal]; + [m_resultCondition.get() unlock]; +} + +} // namespace WebKit + +#endif //!defined(BUILDING_ON_SNOW_LEOPARD) + diff --git a/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h b/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h new file mode 100644 index 0000000..57311e7 --- /dev/null +++ b/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if ENABLE(FULLSCREEN_API) + +#import <Cocoa/Cocoa.h> +#import <wtf/RetainPtr.h> + +namespace WebKit { +class LayerTreeContext; +} + +namespace WebCore { +class IntRect; +} + +@class WKView; + +@interface WKFullScreenWindowController : NSWindowController { +@private + WKView *_webView; + RetainPtr<NSView> _webViewPlaceholder; + RetainPtr<NSView> _layerViewPlaceholder; + RetainPtr<NSView> _layerHostingView; + + BOOL _isAnimating; + BOOL _isFullScreen; + BOOL _isWindowLoaded; + BOOL _forceDisableAnimation; + BOOL _isPlaying; + CGRect _initialFrame; + uint32_t _idleDisplaySleepAssertion; + uint32_t _idleSystemSleepAssertion; + NSTimer *_tickleTimer; +} + +- (WKView*)webView; +- (void)setWebView:(WKView*)webView; + +- (void)enterFullScreen:(NSScreen *)screen; +- (void)exitFullScreen; +- (void)beganEnterFullScreenAnimation; +- (void)beganExitFullScreenAnimation; +- (void)finishedEnterFullScreenAnimation:(bool)completed; +- (void)finishedExitFullScreenAnimation:(bool)completed; +- (void)enterAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)context; +- (void)exitAcceleratedCompositingMode; +- (WebCore::IntRect)getFullScreenRect; + +@end + +#endif diff --git a/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm b/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm new file mode 100644 index 0000000..91eeaf6 --- /dev/null +++ b/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm @@ -0,0 +1,608 @@ +/* + * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "config.h" + +#if ENABLE(FULLSCREEN_API) + +#import "WKFullScreenWindowController.h" + +#import "LayerTreeContext.h" +#import "WKAPICast.h" +#import "WKViewInternal.h" +#import "WebFullScreenManagerProxy.h" +#import "WebPageProxy.h" +#import <Carbon/Carbon.h> // For SetSystemUIMode() +#import <IOKit/pwr_mgt/IOPMLib.h> // For IOPMAssertionCreate() +#import <QuartzCore/QuartzCore.h> +#import <WebCore/FloatRect.h> +#import <WebCore/IntRect.h> +#import <WebKitSystemInterface.h> + +static const NSTimeInterval tickleTimerInterval = 1.0; + +using namespace WebKit; +using namespace WebCore; + +#if defined(BUILDING_ON_LEOPARD) +@interface CATransaction(SnowLeopardConvenienceFunctions) ++ (void)setDisableActions:(BOOL)flag; ++ (void)setAnimationDuration:(CFTimeInterval)dur; +@end + +@implementation CATransaction(SnowLeopardConvenienceFunctions) ++ (void)setDisableActions:(BOOL)flag +{ + [self setValue:[NSNumber numberWithBool:flag] forKey:kCATransactionDisableActions]; +} + ++ (void)setAnimationDuration:(CFTimeInterval)dur +{ + [self setValue:[NSNumber numberWithDouble:dur] forKey:kCATransactionAnimationDuration]; +} +@end + +#endif + +@interface WKFullScreenWindow : NSWindow +{ + NSView* _animationView; + CALayer* _backgroundLayer; +} +- (CALayer*)backgroundLayer; +- (NSView*)animationView; +@end + +@interface WKFullScreenWindowController(Private) +- (void)_requestExitFullScreenWithAnimation:(BOOL)animation; +- (void)_updateMenuAndDockForFullScreen; +- (void)_updatePowerAssertions; +- (WKFullScreenWindow *)_fullScreenWindow; +- (CFTimeInterval)_animationDuration; +- (void)_swapView:(NSView*)view with:(NSView*)otherView; +- (WebFullScreenManagerProxy*)_manager; +@end + +@interface NSWindow(IsOnActiveSpaceAdditionForTigerAndLeopard) +- (BOOL)isOnActiveSpace; +@end + +@implementation WKFullScreenWindowController + +#pragma mark - +#pragma mark Initialization +- (id)init +{ + NSWindow *window = [[WKFullScreenWindow alloc] initWithContentRect:NSZeroRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; + self = [super initWithWindow:window]; + [window release]; + if (!self) + return nil; + [self windowDidLoad]; + + return self; +} + +- (void)dealloc +{ + [self setWebView:nil]; + + [NSObject cancelPreviousPerformRequestsWithTarget:self]; + + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [super dealloc]; +} + +- (void)windowDidLoad +{ + [super windowDidLoad]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidResignActive:) name:NSApplicationDidResignActiveNotification object:NSApp]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidChangeScreenParameters:) name:NSApplicationDidChangeScreenParametersNotification object:NSApp]; +} + +#pragma mark - +#pragma mark Accessors + +- (WKView*)webView +{ + return _webView; +} + +- (void)setWebView:(WKView *)webView +{ + [webView retain]; + [_webView release]; + _webView = webView; +} + +#pragma mark - +#pragma mark Notifications + +- (void)applicationDidResignActive:(NSNotification*)notification +{ + // Check to see if the fullScreenWindow is on the active space; this function is available + // on 10.6 and later, so default to YES if the function is not available: + NSWindow* fullScreenWindow = [self _fullScreenWindow]; + BOOL isOnActiveSpace = ([fullScreenWindow respondsToSelector:@selector(isOnActiveSpace)] ? [fullScreenWindow isOnActiveSpace] : YES); + + // Replicate the QuickTime Player (X) behavior when losing active application status: + // Is the fullScreen screen the main screen? (Note: this covers the case where only a + // single screen is available.) Is the fullScreen screen on the current space? IFF so, + // then exit fullScreen mode. + if ([fullScreenWindow screen] == [[NSScreen screens] objectAtIndex:0] && isOnActiveSpace) + [self _requestExitFullScreenWithAnimation:NO]; +} + +- (void)applicationDidChangeScreenParameters:(NSNotification*)notification +{ + // The user may have changed the main screen by moving the menu bar, or they may have changed + // the Dock's size or location, or they may have changed the fullScreen screen's dimensions. + // Update our presentation parameters, and ensure that the full screen window occupies the + // entire screen: + [self _updateMenuAndDockForFullScreen]; + NSWindow* window = [self window]; + [window setFrame:[[window screen] frame] display:YES]; +} + +#pragma mark - +#pragma mark Exposed Interface + +- (void)enterFullScreen:(NSScreen *)screen +{ + if (_isFullScreen) + return; + + _isFullScreen = YES; + _isAnimating = YES; + + NSDisableScreenUpdates(); + + if (!screen) + screen = [NSScreen mainScreen]; + NSRect screenFrame = [screen frame]; + + NSRect webViewFrame = [_webView convertRectToBase:[_webView frame]]; + webViewFrame.origin = [[_webView window] convertBaseToScreen:webViewFrame.origin]; + + // In the case of a multi-monitor setup where the webView straddles two + // monitors, we must create a window large enough to contain the destination + // frame and the initial frame. + NSRect windowFrame = NSUnionRect(screenFrame, webViewFrame); + [[self window] setFrame:windowFrame display:YES]; + + CALayer* backgroundLayer = [[self _fullScreenWindow] backgroundLayer]; + NSRect backgroundFrame = {[[self window] convertScreenToBase:screenFrame.origin], screenFrame.size}; + backgroundFrame = [[[self window] contentView] convertRectFromBase:backgroundFrame]; + + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + [backgroundLayer setFrame:NSRectToCGRect(backgroundFrame)]; + [CATransaction commit]; + + CFTimeInterval duration = [self _animationDuration]; + [self _manager]->willEnterFullScreen(); + [self _manager]->beginEnterFullScreenAnimation(duration); +} + +- (void)beganEnterFullScreenAnimation +{ + [self _updateMenuAndDockForFullScreen]; + [self _updatePowerAssertions]; + + // In a previous incarnation, the NSWindow attached to this controller may have + // been on a different screen. Temporarily change the collectionBehavior of the window: + NSWindow* fullScreenWindow = [self window]; + NSWindowCollectionBehavior behavior = [fullScreenWindow collectionBehavior]; + [fullScreenWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces]; + [fullScreenWindow makeKeyAndOrderFront:self]; + [fullScreenWindow setCollectionBehavior:behavior]; + + // Start the opacity animation. We can use implicit animations here because we don't care when + // the animation finishes. + [CATransaction begin]; + [CATransaction setAnimationDuration:[self _animationDuration]]; + [[[self _fullScreenWindow] backgroundLayer] setOpacity:1]; + [CATransaction commit]; + + NSEnableScreenUpdates(); + _isAnimating = YES; +} + +- (void)finishedEnterFullScreenAnimation:(bool)completed +{ + NSDisableScreenUpdates(); + + if (completed) { + // Swap the webView placeholder into place. + if (!_webViewPlaceholder) + _webViewPlaceholder.adoptNS([[NSView alloc] init]); + [self _swapView:_webView with:_webViewPlaceholder.get()]; + + // Then insert the WebView into the full screen window + NSView* animationView = [[self _fullScreenWindow] animationView]; + [animationView addSubview:_webView positioned:NSWindowBelow relativeTo:_layerHostingView.get()]; + [_webView setFrame:[animationView bounds]]; + + // FIXME: In Barolo, orderIn will animate, which is not what we want. Find a way + // to work around this behavior. + //[[_webViewPlaceholder.get() window] orderOut:self]; + [[self window] makeKeyAndOrderFront:self]; + } + + [self _manager]->didEnterFullScreen(); + NSEnableScreenUpdates(); + + _isAnimating = NO; +} + +- (void)exitFullScreen +{ + if (!_isFullScreen) + return; + + _isFullScreen = NO; + _isAnimating = YES; + + NSDisableScreenUpdates(); + + [self _manager]->willExitFullScreen(); + [self _manager]->beginExitFullScreenAnimation([self _animationDuration]); +} + +- (void)beganExitFullScreenAnimation +{ + [self _updateMenuAndDockForFullScreen]; + [self _updatePowerAssertions]; + + // The user may have moved the fullScreen window in Spaces, so temporarily change + // the collectionBehavior of the webView's window: + NSWindow* webWindow = [[self webView] window]; + NSWindowCollectionBehavior behavior = [webWindow collectionBehavior]; + [webWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces]; + [webWindow orderWindow:NSWindowBelow relativeTo:[[self window] windowNumber]]; + [webWindow setCollectionBehavior:behavior]; + + // Swap the webView back into its original position: + if ([_webView window] == [self window]) + [self _swapView:_webViewPlaceholder.get() with:_webView]; + + [CATransaction begin]; + [CATransaction setAnimationDuration:[self _animationDuration]]; + [[[self _fullScreenWindow] backgroundLayer] setOpacity:0]; + [CATransaction commit]; + + NSEnableScreenUpdates(); + _isAnimating = YES; +} + +- (void)finishedExitFullScreenAnimation:(bool)completed +{ + NSDisableScreenUpdates(); + + if (completed) { + [self _updateMenuAndDockForFullScreen]; + [self _updatePowerAssertions]; + [NSCursor setHiddenUntilMouseMoves:YES]; + + [[self window] orderOut:self]; + [[_webView window] makeKeyAndOrderFront:self]; + } + + [self _manager]->didExitFullScreen(); + NSEnableScreenUpdates(); + + _isAnimating = NO; +} + +- (void)enterAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)layerTreeContext +{ + if (_layerHostingView) + return; + + ASSERT(!layerTreeContext.isEmpty()); + + // Create an NSView that will host our layer tree. + _layerHostingView.adoptNS([[NSView alloc] initWithFrame:[[self window] frame]]); + [_layerHostingView.get() setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + WKFullScreenWindow* window = [self _fullScreenWindow]; + [[window animationView] addSubview:_layerHostingView.get()]; + + // Create a root layer that will back the NSView. + RetainPtr<CALayer> rootLayer(AdoptNS, [[CALayer alloc] init]); +#ifndef NDEBUG + [rootLayer.get() setName:@"Hosting root layer"]; +#endif + + CALayer *renderLayer = WKMakeRenderLayer(layerTreeContext.contextID); + [rootLayer.get() addSublayer:renderLayer]; + + [_layerHostingView.get() setLayer:rootLayer.get()]; + [_layerHostingView.get() setWantsLayer:YES]; + [[window backgroundLayer] setHidden:NO]; + [CATransaction commit]; +} + +- (void)exitAcceleratedCompositingMode +{ + if (!_layerHostingView) + return; + + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + [_layerHostingView.get() removeFromSuperview]; + [_layerHostingView.get() setLayer:nil]; + [_layerHostingView.get() setWantsLayer:NO]; + [[[self _fullScreenWindow] backgroundLayer] setHidden:YES]; + [CATransaction commit]; + + _layerHostingView = 0; +} + +- (WebCore::IntRect)getFullScreenRect +{ + return enclosingIntRect([[self window] frame]); +} + +#pragma mark - +#pragma mark Internal Interface + +- (void)_updateMenuAndDockForFullScreen +{ + // NSApplicationPresentationOptions is available on > 10.6 only: +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + NSApplicationPresentationOptions options = NSApplicationPresentationDefault; + NSScreen* fullScreenScreen = [[self window] screen]; + + if (_isFullScreen) { + // Auto-hide the menu bar if the fullScreenScreen contains the menu bar: + // NOTE: if the fullScreenScreen contains the menu bar but not the dock, we must still + // auto-hide the dock, or an exception will be thrown. + if ([[NSScreen screens] objectAtIndex:0] == fullScreenScreen) + options |= (NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideDock); + // Check if the current screen contains the dock by comparing the screen's frame to its + // visibleFrame; if a dock is present, the visibleFrame will differ. If the current screen + // contains the dock, hide it. + else if (!NSEqualRects([fullScreenScreen frame], [fullScreenScreen visibleFrame])) + options |= NSApplicationPresentationAutoHideDock; + } + + if ([NSApp respondsToSelector:@selector(setPresentationOptions:)]) + [NSApp setPresentationOptions:options]; + else +#endif + SetSystemUIMode(_isFullScreen ? kUIModeNormal : kUIModeAllHidden, 0); +} + +#if !defined(BUILDING_ON_TIGER) // IOPMAssertionCreateWithName not defined on < 10.5 +- (void)_disableIdleDisplaySleep +{ + if (_idleDisplaySleepAssertion == kIOPMNullAssertionID) +#if defined(BUILDING_ON_LEOPARD) // IOPMAssertionCreateWithName is not defined in the 10.5 SDK + IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &_idleDisplaySleepAssertion); +#else // IOPMAssertionCreate is depreciated in > 10.5 + IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, CFSTR("WebKit playing a video fullScreen."), &_idleDisplaySleepAssertion); +#endif +} + +- (void)_enableIdleDisplaySleep +{ + if (_idleDisplaySleepAssertion != kIOPMNullAssertionID) { + IOPMAssertionRelease(_idleDisplaySleepAssertion); + _idleDisplaySleepAssertion = kIOPMNullAssertionID; + } +} + +- (void)_disableIdleSystemSleep +{ + if (_idleSystemSleepAssertion == kIOPMNullAssertionID) +#if defined(BUILDING_ON_LEOPARD) // IOPMAssertionCreateWithName is not defined in the 10.5 SDK + IOPMAssertionCreate(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, &_idleSystemSleepAssertion); +#else // IOPMAssertionCreate is depreciated in > 10.5 + IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR("WebKit playing a video fullScreen."), &_idleSystemSleepAssertion); +#endif +} + +- (void)_enableIdleSystemSleep +{ + if (_idleSystemSleepAssertion != kIOPMNullAssertionID) { + IOPMAssertionRelease(_idleSystemSleepAssertion); + _idleSystemSleepAssertion = kIOPMNullAssertionID; + } +} + +- (void)_enableTickleTimer +{ + [_tickleTimer invalidate]; + [_tickleTimer release]; + _tickleTimer = [[NSTimer scheduledTimerWithTimeInterval:tickleTimerInterval target:self selector:@selector(_tickleTimerFired) userInfo:nil repeats:YES] retain]; +} + +- (void)_disableTickleTimer +{ + [_tickleTimer invalidate]; + [_tickleTimer release]; + _tickleTimer = nil; +} + +- (void)_tickleTimerFired +{ + UpdateSystemActivity(OverallAct); +} +#endif + +- (void)_updatePowerAssertions +{ +#if !defined(BUILDING_ON_TIGER) + if (_isPlaying && _isFullScreen) { + [self _disableIdleSystemSleep]; + [self _disableIdleDisplaySleep]; + [self _enableTickleTimer]; + } else { + [self _enableIdleSystemSleep]; + [self _enableIdleDisplaySleep]; + [self _disableTickleTimer]; + } +#endif +} + +- (WebFullScreenManagerProxy*)_manager +{ + WebPageProxy* webPage = toImpl([_webView pageRef]); + if (!webPage) + return 0; + return webPage->fullScreenManager(); +} + +- (void)_requestExit +{ + [self exitFullScreen]; + _forceDisableAnimation = NO; +} + +- (void)_requestExitFullScreenWithAnimation:(BOOL)animation +{ + _forceDisableAnimation = !animation; + [self performSelector:@selector(_requestExit) withObject:nil afterDelay:0]; + +} + +- (void)_swapView:(NSView*)view with:(NSView*)otherView +{ + [otherView setFrame:[view frame]]; + [otherView setAutoresizingMask:[view autoresizingMask]]; + [otherView removeFromSuperview]; + [[view superview] replaceSubview:view with:otherView]; +} + +#pragma mark - +#pragma mark Utility Functions + +- (WKFullScreenWindow *)_fullScreenWindow +{ + ASSERT([[self window] isKindOfClass:[WKFullScreenWindow class]]); + return (WKFullScreenWindow *)[self window]; +} + +- (CFTimeInterval)_animationDuration +{ + static const CFTimeInterval defaultDuration = 0.5; + CFTimeInterval duration = defaultDuration; +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + NSUInteger modifierFlags = [NSEvent modifierFlags]; +#else + NSUInteger modifierFlags = [[NSApp currentEvent] modifierFlags]; +#endif + if ((modifierFlags & NSControlKeyMask) == NSControlKeyMask) + duration *= 2; + if ((modifierFlags & NSShiftKeyMask) == NSShiftKeyMask) + duration *= 10; + if (_forceDisableAnimation) { + // This will disable scale animation + duration = 0; + } + return duration; +} + +@end + +#pragma mark - +@implementation WKFullScreenWindow + +- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag +{ + UNUSED_PARAM(aStyle); + self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:bufferingType defer:flag]; + if (!self) + return nil; + [self setOpaque:NO]; + [self setBackgroundColor:[NSColor clearColor]]; + [self setIgnoresMouseEvents:NO]; + [self setAcceptsMouseMovedEvents:YES]; + [self setReleasedWhenClosed:NO]; + [self setHasShadow:YES]; +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + [self setMovable:NO]; +#else + [self setMovableByWindowBackground:NO]; +#endif + + NSView* contentView = [self contentView]; + _animationView = [[NSView alloc] initWithFrame:[contentView bounds]]; + + CALayer* contentLayer = [[CALayer alloc] init]; + [_animationView setLayer:contentLayer]; + [_animationView setWantsLayer:YES]; + [_animationView setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable]; + [contentView addSubview:_animationView]; + + _backgroundLayer = [[CALayer alloc] init]; + [contentLayer addSublayer:_backgroundLayer]; + + [_backgroundLayer setBackgroundColor:CGColorGetConstantColor(kCGColorBlack)]; + [_backgroundLayer setOpacity:0]; + return self; +} + +- (void)dealloc +{ + [_animationView release]; + [_backgroundLayer release]; + [super dealloc]; +} + +- (BOOL)canBecomeKeyWindow +{ + return YES; +} + +- (void)keyDown:(NSEvent *)theEvent +{ + if ([[theEvent charactersIgnoringModifiers] isEqual:@"\e"]) // Esacpe key-code + [self cancelOperation:self]; + else [super keyDown:theEvent]; +} + +- (void)cancelOperation:(id)sender +{ + UNUSED_PARAM(sender); + [[self windowController] _requestExitFullScreenWithAnimation:YES]; +} + +- (CALayer*)backgroundLayer +{ + return _backgroundLayer; +} + +- (NSView*)animationView +{ + return _animationView; +} +@end + +#endif diff --git a/Source/WebKit2/UIProcess/mac/WebContextMac.mm b/Source/WebKit2/UIProcess/mac/WebContextMac.mm index 498b6e7..f7c186d 100644 --- a/Source/WebKit2/UIProcess/mac/WebContextMac.mm +++ b/Source/WebKit2/UIProcess/mac/WebContextMac.mm @@ -35,6 +35,12 @@ using namespace WebCore; NSString *WebDatabaseDirectoryDefaultsKey = @"WebDatabaseDirectory"; NSString *WebKitLocalCacheDefaultsKey = @"WebKitLocalCache"; +NSString *WebStorageDirectoryDefaultsKey = @"WebKitLocalStorageDatabasePathPreferenceKey"; + +static NSString *WebKitApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification = @"NSApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification"; + +// FIXME: <rdar://problem/9138817> - After this "backwards compatibility" radar is removed, this code should be removed to only return an empty String. +NSString *WebIconDatabaseDirectoryDefaultsKey = @"WebIconDatabaseDirectoryDefaultsKey"; namespace WebKit { @@ -97,8 +103,18 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para #if USE(CFURLSTORAGESESSIONS) parameters.uiProcessBundleIdentifier = String([[NSBundle mainBundle] bundleIdentifier]); #endif + + // Listen for enhanced accessibility changes and propagate them to the WebProcess. + m_enhancedAccessibilityObserver = [[NSNotificationCenter defaultCenter] addObserverForName:WebKitApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *note) { + setEnhancedAccessibility([[[note userInfo] objectForKey:@"AXEnhancedUserInterface"] boolValue]); + }]; } +void WebContext::platformInvalidateContext() +{ + [[NSNotificationCenter defaultCenter] removeObserver:(id)m_enhancedAccessibilityObserver.get()]; +} + String WebContext::platformDefaultDatabaseDirectory() const { NSString *databasesDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebDatabaseDirectoryDefaultsKey]; @@ -107,5 +123,22 @@ String WebContext::platformDefaultDatabaseDirectory() const return [databasesDirectory stringByStandardizingPath]; } +String WebContext::platformDefaultIconDatabasePath() const +{ + // FIXME: <rdar://problem/9138817> - After this "backwards compatibility" radar is removed, this code should be removed to only return an empty String. + NSString *databasesDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebIconDatabaseDirectoryDefaultsKey]; + if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]]) + databasesDirectory = @"~/Library/Icons/WebpageIcons.db"; + return [databasesDirectory stringByStandardizingPath]; +} + +String WebContext::platformDefaultLocalStorageDirectory() const +{ + NSString *localStorageDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebStorageDirectoryDefaultsKey]; + if (!localStorageDirectory || ![localStorageDirectory isKindOfClass:[NSString class]]) + localStorageDirectory = @"~/Library/WebKit/LocalStorage"; + return [localStorageDirectory stringByStandardizingPath]; +} + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm b/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm index 67139b3..fd0f534 100644 --- a/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm +++ b/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm @@ -199,6 +199,9 @@ void WebContextMenuProxyMac::populate(const Vector<WebContextMenuItemData>& item void WebContextMenuProxyMac::showContextMenu(const IntPoint& menuLocation, const Vector<WebContextMenuItemData>& items) { + if (items.isEmpty()) + return; + populate(items); [[WKMenuTarget sharedMenuTarget] setMenuProxy:this]; @@ -215,14 +218,12 @@ void WebContextMenuProxyMac::showContextMenu(const IntPoint& menuLocation, const float vertOffset = roundf((NSMaxY(menuRect) - NSMaxY(titleFrame)) + NSHeight(titleFrame)); NSPoint location = NSMakePoint(NSMinX(menuRect), NSMaxY(menuRect) - vertOffset); - RetainPtr<NSView> dummyView(AdoptNS, [[NSView alloc] initWithFrame:menuRect]); - [m_webView addSubview:dummyView.get()]; - location = [dummyView.get() convertPoint:location fromView:m_webView]; - - WKPopupMenu(menu, location, roundf(NSWidth(menuRect)), dummyView.get(), -1, nil); + location = [m_webView convertPoint:location toView:nil]; + location = [m_webView.window convertBaseToScreen:location]; + + WKPopupContextMenu(menu, location); [m_popup.get() dismissPopUp]; - [dummyView.get() removeFromSuperview]; } void WebContextMenuProxyMac::hideContextMenu() diff --git a/Source/WebKit2/UIProcess/mac/WebCookieManagerProxyMac.mm b/Source/WebKit2/UIProcess/mac/WebCookieManagerProxyMac.mm new file mode 100644 index 0000000..6a31346 --- /dev/null +++ b/Source/WebKit2/UIProcess/mac/WebCookieManagerProxyMac.mm @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2011, 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "config.h" +#import "WebCookieManagerProxy.h" + +namespace WebKit { + +void WebCookieManagerProxy::persistHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy) +{ + // FIXME: The sandbox appears to prevent persisting the new policy to disk, so we must set the + // policy in the UI Process as well as in the Web Process (to make sure it gets set on any + // Private Browsing Cookie Storage). + [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:policy]; +} + +} // namespace WebKit diff --git a/Source/WebKit2/UIProcess/mac/WebFullScreenManagerProxyMac.mm b/Source/WebKit2/UIProcess/mac/WebFullScreenManagerProxyMac.mm new file mode 100644 index 0000000..d533573 --- /dev/null +++ b/Source/WebKit2/UIProcess/mac/WebFullScreenManagerProxyMac.mm @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebFullScreenManagerProxy.h" +#include "LayerTreeContext.h" +#include "WKFullScreenWindowController.h" +#include "WKViewInternal.h" + +#if ENABLE(FULLSCREEN_API) + +namespace WebKit { + +void WebFullScreenManagerProxy::enterFullScreen() +{ + if (!m_webView) + return; + [[m_webView fullScreenWindowController] enterFullScreen:nil]; +} + +void WebFullScreenManagerProxy::exitFullScreen() +{ + if (!m_webView) + return; + [[m_webView fullScreenWindowController] exitFullScreen]; +} + +void WebFullScreenManagerProxy::beganEnterFullScreenAnimation() +{ + if (!m_webView) + return; + [[m_webView fullScreenWindowController] beganEnterFullScreenAnimation]; +} + +void WebFullScreenManagerProxy::finishedEnterFullScreenAnimation(bool completed) +{ + if (!m_webView) + return; + [[m_webView fullScreenWindowController] finishedEnterFullScreenAnimation:completed]; +} + +void WebFullScreenManagerProxy::beganExitFullScreenAnimation() +{ + if (!m_webView) + return; + [[m_webView fullScreenWindowController] beganExitFullScreenAnimation]; +} + +void WebFullScreenManagerProxy::finishedExitFullScreenAnimation(bool completed) +{ + if (!m_webView) + return; + [[m_webView fullScreenWindowController] finishedExitFullScreenAnimation:completed]; +} + +void WebFullScreenManagerProxy::enterAcceleratedCompositingMode(const LayerTreeContext& context) +{ + if (!m_webView) + return; + [[m_webView fullScreenWindowController] enterAcceleratedCompositingMode:context]; +} + +void WebFullScreenManagerProxy::exitAcceleratedCompositingMode() +{ + if (!m_webView) + return; + [[m_webView fullScreenWindowController] exitAcceleratedCompositingMode]; +} + +void WebFullScreenManagerProxy::getFullScreenRect(WebCore::IntRect& rect) +{ + if (!m_webView) + return; + rect = [[m_webView fullScreenWindowController] getFullScreenRect]; +} + +} // namespace WebKit + +#endif diff --git a/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm b/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm index 67d184c..9657764 100644 --- a/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm +++ b/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm @@ -32,6 +32,7 @@ #import "WKView.h" #import "WebPageProxy.h" #import <WebKitSystemInterface.h> +#import <WebCore/LocalizedStrings.h> #import <wtf/text/WTFString.h> using namespace WebCore; @@ -134,8 +135,7 @@ void WebInspectorProxy::platformClose() void WebInspectorProxy::platformInspectedURLChanged(const String& urlString) { - // FIXME: this should be made localizable once WebKit2 supports it. <rdar://problem/8728860> - NSString *title = [NSString stringWithFormat:@"Web Inspector \u2014 %@", (NSString *)urlString]; + NSString *title = [NSString stringWithFormat:UI_STRING("Web Inspector — %@", "Web Inspector window title"), (NSString *)urlString]; [m_inspectorWindow.get() setTitle:title]; } diff --git a/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm b/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm index 1d3ed53..90df81e 100644 --- a/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm +++ b/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,7 +26,13 @@ #import "config.h" #import "WebPageProxy.h" +#import "DataReference.h" +#import "DictionaryPopupInfo.h" +#import "NativeWebKeyboardEvent.h" #import "PageClient.h" +#import "TextChecker.h" +#import "WebPageMessages.h" +#import "WebProcessProxy.h" #import <wtf/text/StringConcatenate.h> @interface NSApplication (Details) @@ -113,4 +119,133 @@ CGContextRef WebPageProxy::containingWindowGraphicsContext() return m_pageClient->containingWindowGraphicsContext(); } +void WebPageProxy::updateWindowIsVisible(bool windowIsVisible) +{ + if (!isValid()) + return; + process()->send(Messages::WebPage::SetWindowIsVisible(windowIsVisible), m_pageID); +} + +void WebPageProxy::windowAndViewFramesChanged(const IntRect& windowFrameInScreenCoordinates, const IntRect& viewFrameInWindowCoordinates, const IntPoint& accessibilityViewCoordinates) +{ + if (!isValid()) + return; + + process()->send(Messages::WebPage::WindowAndViewFramesChanged(windowFrameInScreenCoordinates, viewFrameInWindowCoordinates, accessibilityViewCoordinates), m_pageID); +} + +void WebPageProxy::getMarkedRange(uint64_t& location, uint64_t& length) +{ + process()->sendSync(Messages::WebPage::GetMarkedRange(), Messages::WebPage::GetMarkedRange::Reply(location, length), m_pageID); +} + +uint64_t WebPageProxy::characterIndexForPoint(const IntPoint point) +{ + uint64_t result; + process()->sendSync(Messages::WebPage::CharacterIndexForPoint(point), Messages::WebPage::CharacterIndexForPoint::Reply(result), m_pageID); + return result; +} + +WebCore::IntRect WebPageProxy::firstRectForCharacterRange(uint64_t location, uint64_t length) +{ + IntRect resultRect; + process()->sendSync(Messages::WebPage::FirstRectForCharacterRange(location, length), Messages::WebPage::FirstRectForCharacterRange::Reply(resultRect), m_pageID); + return resultRect; +} + +bool WebPageProxy::writeSelectionToPasteboard(const String& pasteboardName, const Vector<String>& pasteboardTypes) +{ + bool result; + const double MessageTimeout = 20; + process()->sendSync(Messages::WebPage::WriteSelectionToPasteboard(pasteboardName, pasteboardTypes), Messages::WebPage::WriteSelectionToPasteboard::Reply(result), m_pageID, MessageTimeout); + return result; +} + +bool WebPageProxy::readSelectionFromPasteboard(const String& pasteboardName) +{ + bool result; + const double MessageTimeout = 20; + process()->sendSync(Messages::WebPage::ReadSelectionFromPasteboard(pasteboardName), Messages::WebPage::ReadSelectionFromPasteboard::Reply(result), m_pageID, MessageTimeout); + return result; +} + +void WebPageProxy::setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, bool isLinkDrag) +{ + RefPtr<ShareableBitmap> dragImage = ShareableBitmap::create(dragImageHandle); + if (!dragImage) + return; + + m_pageClient->setDragImage(clientPosition, dragImage.release(), isLinkDrag); +} + +void WebPageProxy::performDictionaryLookupAtLocation(const WebCore::FloatPoint& point) +{ + if (!isValid()) + return; + + process()->send(Messages::WebPage::PerformDictionaryLookupAtLocation(point), m_pageID); +} + +void WebPageProxy::interpretKeyEvent(uint32_t type, Vector<KeypressCommand>& commandsList, uint32_t selectionStart, uint32_t selectionEnd, Vector<CompositionUnderline>& underlines) +{ + m_pageClient->interceptKeyEvent(m_keyEventQueue.first(), commandsList, selectionStart, selectionEnd, underlines); +} + +// Complex text input support for plug-ins. +void WebPageProxy::sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput) +{ + if (!isValid()) + return; + + process()->send(Messages::WebPage::SendComplexTextInputToPlugin(pluginComplexTextInputIdentifier, textInput), m_pageID); +} + +void WebPageProxy::uppercaseWord() +{ + process()->send(Messages::WebPage::UppercaseWord(), m_pageID); +} + +void WebPageProxy::lowercaseWord() +{ + process()->send(Messages::WebPage::LowercaseWord(), m_pageID); +} + +void WebPageProxy::capitalizeWord() +{ + process()->send(Messages::WebPage::CapitalizeWord(), m_pageID); +} + +void WebPageProxy::setSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled) +{ + if (m_isSmartInsertDeleteEnabled == isSmartInsertDeleteEnabled) + return; + + TextChecker::setSmartInsertDeleteEnabled(isSmartInsertDeleteEnabled); + m_isSmartInsertDeleteEnabled = isSmartInsertDeleteEnabled; + process()->send(Messages::WebPage::SetSmartInsertDeleteEnabled(isSmartInsertDeleteEnabled), m_pageID); +} + +void WebPageProxy::didPerformDictionaryLookup(const String& text, const DictionaryPopupInfo& dictionaryPopupInfo) +{ + m_pageClient->didPerformDictionaryLookup(text, m_viewScaleFactor, dictionaryPopupInfo); +} + +void WebPageProxy::registerWebProcessAccessibilityToken(const CoreIPC::DataReference& data) +{ + m_pageClient->accessibilityWebProcessTokenReceived(data); +} + +void WebPageProxy::registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elementToken, const CoreIPC::DataReference& windowToken) +{ + if (!isValid()) + return; + + process()->send(Messages::WebPage::RegisterUIProcessAccessibilityTokens(elementToken, windowToken), m_pageID); +} + +void WebPageProxy::setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled) +{ + m_pageClient->setComplexTextInputEnabled(pluginComplexTextInputIdentifier, complexTextInputEnabled); +} + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp b/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp index 777f98c..16283bc 100644 --- a/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp +++ b/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp @@ -82,6 +82,9 @@ PassRefPtr<WebContextMenuProxyQt> WebContextMenuProxyQt::create(QWKPage* page) void WebContextMenuProxyQt::showContextMenu(const IntPoint& position, const Vector<WebContextMenuItemData>& items) { + if (items.isEmpty()) + return; + OwnPtr<QMenu> menu = createContextMenu(items); // We send the signal, even with no items, because the client should be able to show custom items diff --git a/Source/WebKit2/UIProcess/qt/WebContextQt.cpp b/Source/WebKit2/UIProcess/qt/WebContextQt.cpp index c1301d5..b46587e 100644 --- a/Source/WebKit2/UIProcess/qt/WebContextQt.cpp +++ b/Source/WebKit2/UIProcess/qt/WebContextQt.cpp @@ -47,10 +47,26 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters&) qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus"); } +void WebContext::platformInvalidateContext() +{ +} + String WebContext::platformDefaultDatabaseDirectory() const { // FIXME: Implement. return ""; } +String WebContext::platformDefaultIconDatabasePath() const +{ + // FIXME: Implement. + return ""; +} + +String WebContext::platformDefaultLocalStorageDirectory() const +{ + // FIXME: Implement. + return ""; +} + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/win/WebContextMenuProxyWin.cpp b/Source/WebKit2/UIProcess/win/WebContextMenuProxyWin.cpp index 5afd07e..4b5a5a7 100644 --- a/Source/WebKit2/UIProcess/win/WebContextMenuProxyWin.cpp +++ b/Source/WebKit2/UIProcess/win/WebContextMenuProxyWin.cpp @@ -73,6 +73,9 @@ void WebContextMenuProxyWin::populateMenu(HMENU menu, const Vector<WebContextMen void WebContextMenuProxyWin::showContextMenu(const IntPoint& origin, const Vector<WebContextMenuItemData>& items) { + if (items.isEmpty()) + return; + // Hide any context menu we have showing (this also destroys the menu). hideContextMenu(); diff --git a/Source/WebKit2/UIProcess/win/WebContextWin.cpp b/Source/WebKit2/UIProcess/win/WebContextWin.cpp index 26708d7..d5fd859 100644 --- a/Source/WebKit2/UIProcess/win/WebContextWin.cpp +++ b/Source/WebKit2/UIProcess/win/WebContextWin.cpp @@ -64,22 +64,39 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para RetainPtr<CFStringRef> cfURLCachePath(AdoptCF, wkCopyFoundationCacheDirectory()); parameters.cfURLCachePath = String(cfURLCachePath.get()); - // Remove the ending '/' (necessary to have CFNetwork find the Cache file). + // Remove the ending '\' (necessary to have CFNetwork find the Cache file). ASSERT(parameters.cfURLCachePath.length()); - if (parameters.cfURLCachePath[parameters.cfURLCachePath.length() - 1] == '/') + if (parameters.cfURLCachePath[parameters.cfURLCachePath.length() - 1] == '\\') parameters.cfURLCachePath.remove(parameters.cfURLCachePath.length() - 1); #if USE(CFURLSTORAGESESSIONS) parameters.uiProcessBundleIdentifier = String(reinterpret_cast<CFStringRef>(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleIdentifierKey))); #endif // USE(CFURLSTORAGESESSIONS) + parameters.initialHTTPCookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy; + #endif // USE(CFNETWORK) } +void WebContext::platformInvalidateContext() +{ +} + String WebContext::platformDefaultDatabaseDirectory() const { return WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases"); } +String WebContext::platformDefaultIconDatabasePath() const +{ + // IconDatabase should be disabled by default on Windows, and should therefore have no default path. + return String(); +} + +String WebContext::platformDefaultLocalStorageDirectory() const +{ + return WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "LocalStorage"); +} + } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp b/Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp index 186ad44..1745a06 100644 --- a/Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp +++ b/Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp @@ -28,6 +28,7 @@ #include "resource.h" #include <tchar.h> +#include <WebCore/SystemInfo.h> #include <WebCore/WebCoreInstanceHandle.h> #include <wtf/StdLibExtras.h> #include <wtf/text/StringConcatenate.h> @@ -36,30 +37,6 @@ using namespace WebCore; namespace WebKit { -static String windowsVersion() -{ - String osVersion; - OSVERSIONINFO versionInfo = { 0 }; - versionInfo.dwOSVersionInfoSize = sizeof(versionInfo); - ::GetVersionEx(&versionInfo); - - if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { - if (versionInfo.dwMajorVersion == 4) { - if (versionInfo.dwMinorVersion == 0) - osVersion = "Windows 95"; - else if (versionInfo.dwMinorVersion == 10) - osVersion = "Windows 98"; - else if (versionInfo.dwMinorVersion == 90) - osVersion = "Windows 98; Win 9x 4.90"; - } - } else if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) - osVersion = makeString("Windows NT ", String::number(versionInfo.dwMajorVersion), '.', String::number(versionInfo.dwMinorVersion)); - - if (!osVersion.length()) - osVersion = makeString("Windows ", String::number(versionInfo.dwMajorVersion), '.', String::number(versionInfo.dwMinorVersion)); - return osVersion; -} - static String userVisibleWebKitVersionString() { LPWSTR buildNumberStringPtr; @@ -71,12 +48,10 @@ static String userVisibleWebKitVersionString() String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent) { - DEFINE_STATIC_LOCAL(String, osVersion, (windowsVersion())); + DEFINE_STATIC_LOCAL(String, osVersion, (windowsVersionForUAString())); DEFINE_STATIC_LOCAL(String, webKitVersion, (userVisibleWebKitVersionString())); - if (applicationNameForUserAgent.isEmpty()) - return makeString("Mozilla/5.0 (", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)"); - return makeString("Mozilla/5.0 (", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko) ", applicationNameForUserAgent); + return makeString("Mozilla/5.0 (", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)", applicationNameForUserAgent.isEmpty() ? "" : " ", applicationNameForUserAgent); } } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/win/WebUndoClient.cpp b/Source/WebKit2/UIProcess/win/WebUndoClient.cpp new file mode 100644 index 0000000..9bc96f5 --- /dev/null +++ b/Source/WebKit2/UIProcess/win/WebUndoClient.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebUndoClient.h" + +#include "WKAPICast.h" +#include "WebEditCommandProxy.h" +#include "WebView.h" + +namespace WebKit { + +void WebUndoClient::registerEditCommand(WebView* view, PassRefPtr<WebEditCommandProxy> prpCommand, WebPageProxy::UndoOrRedo undoOrRedo) +{ + if (!m_client.registerEditCommand) + return; + + RefPtr<WebEditCommandProxy> command = prpCommand; + m_client.registerEditCommand(toAPI(view), toAPI(command.release().releaseRef()), (undoOrRedo == WebPageProxy::Undo) ? kWKViewUndo : kWKViewRedo, m_client.clientInfo); +} + +void WebUndoClient::clearAllEditCommands(WebView* view) +{ + if (!m_client.clearAllEditCommands) + return; + + m_client.clearAllEditCommands(toAPI(view), m_client.clientInfo); +} + +} // namespace WebKit + diff --git a/Source/WebKit2/UIProcess/win/WebUndoClient.h b/Source/WebKit2/UIProcess/win/WebUndoClient.h new file mode 100755 index 0000000..12582c0 --- /dev/null +++ b/Source/WebKit2/UIProcess/win/WebUndoClient.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebUndoClient_h +#define WebUndoClient_h + +#include "APIClient.h" +#include "WKView.h" +#include "WebPageProxy.h" +#include <wtf/Forward.h> + +namespace WebKit { + +class WebEditCommandProxy; + +class WebUndoClient : public APIClient<WKViewUndoClient> { +public: + void registerEditCommand(WebView*, PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo); + void clearAllEditCommands(WebView*); +}; + +} // namespace WebKit + +#endif // WebUndoClient_h diff --git a/Source/WebKit2/UIProcess/win/WebView.cpp b/Source/WebKit2/UIProcess/win/WebView.cpp index 62e0c42..1447864 100644 --- a/Source/WebKit2/UIProcess/win/WebView.cpp +++ b/Source/WebKit2/UIProcess/win/WebView.cpp @@ -44,7 +44,9 @@ #include <WebCore/BitmapInfo.h> #include <WebCore/Cursor.h> #include <WebCore/FloatRect.h> +#if PLATFORM(CG) #include <WebCore/GraphicsContextCG.h> +#endif #include <WebCore/IntRect.h> #include <WebCore/SoftLinking.h> #include <WebCore/WebCoreInstanceHandle.h> @@ -149,6 +151,12 @@ LRESULT WebView::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_VISTA_MOUSEHWHEEL: lResult = onWheelEvent(hWnd, message, wParam, lParam, handled); break; + case WM_HSCROLL: + lResult = onHorizontalScroll(hWnd, message, wParam, lParam, handled); + break; + case WM_VSCROLL: + lResult = onVerticalScroll(hWnd, message, wParam, lParam, handled); + break; case WM_SYSKEYDOWN: case WM_KEYDOWN: case WM_SYSCHAR: @@ -280,6 +288,20 @@ WebView::~WebView() void WebView::initialize() { ::RegisterDragDrop(m_window, this); + + if (shouldInitializeTrackPointHack()) { + // If we detected a registry key belonging to a TrackPoint driver, then create fake + // scrollbars, so the WebView will receive WM_VSCROLL and WM_HSCROLL messages. + // We create an invisible vertical scrollbar and an invisible horizontal scrollbar to allow + // for receiving both types of messages. + ::CreateWindow(TEXT("SCROLLBAR"), TEXT("FAKETRACKPOINTHSCROLLBAR"), WS_CHILD | WS_VISIBLE | SBS_HORZ, 0, 0, 0, 0, m_window, 0, instanceHandle(), 0); + ::CreateWindow(TEXT("SCROLLBAR"), TEXT("FAKETRACKPOINTVSCROLLBAR"), WS_CHILD | WS_VISIBLE | SBS_VERT, 0, 0, 0, 0, m_window, 0, instanceHandle(), 0); + } +} + +void WebView::initializeUndoClient(const WKViewUndoClient* client) +{ + m_undoClient.initialize(client); } void WebView::setParentWindow(HWND parentWindow) @@ -394,6 +416,70 @@ LRESULT WebView::onWheelEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa return 0; } +LRESULT WebView::onHorizontalScroll(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool& handled) +{ + ScrollDirection direction; + ScrollGranularity granularity; + switch (LOWORD(wParam)) { + case SB_LINELEFT: + granularity = ScrollByLine; + direction = ScrollLeft; + break; + case SB_LINERIGHT: + granularity = ScrollByLine; + direction = ScrollRight; + break; + case SB_PAGELEFT: + granularity = ScrollByDocument; + direction = ScrollLeft; + break; + case SB_PAGERIGHT: + granularity = ScrollByDocument; + direction = ScrollRight; + break; + default: + handled = false; + return 0; + } + + m_page->scrollBy(direction, granularity); + + handled = true; + return 0; +} + +LRESULT WebView::onVerticalScroll(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool& handled) +{ + ScrollDirection direction; + ScrollGranularity granularity; + switch (LOWORD(wParam)) { + case SB_LINEDOWN: + granularity = ScrollByLine; + direction = ScrollDown; + break; + case SB_LINEUP: + granularity = ScrollByLine; + direction = ScrollUp; + break; + case SB_PAGEDOWN: + granularity = ScrollByDocument; + direction = ScrollDown; + break; + case SB_PAGEUP: + granularity = ScrollByDocument; + direction = ScrollUp; + break; + default: + handled = false; + return 0; + } + + m_page->scrollBy(direction, granularity); + + handled = true; + return 0; +} + LRESULT WebView::onKeyEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool& handled) { m_page->handleKeyboardEvent(NativeWebKeyboardEvent(hWnd, message, wParam, lParam)); @@ -490,8 +576,10 @@ LRESULT WebView::onSizeEvent(HWND, UINT, WPARAM, LPARAM lParam, bool& handled) int width = LOWORD(lParam); int height = HIWORD(lParam); - if (m_page && m_page->drawingArea()) - m_page->drawingArea()->setSize(IntSize(width, height), IntSize()); + if (m_page && m_page->drawingArea()) { + m_page->drawingArea()->setSize(IntSize(width, height), m_nextResizeScrollOffset); + m_nextResizeScrollOffset = IntSize(); + } handled = true; return 0; @@ -638,8 +726,39 @@ void WebView::stopTrackingMouseLeave() ::TrackMouseEvent(&trackMouseEvent); } +bool WebView::shouldInitializeTrackPointHack() +{ + static bool shouldCreateScrollbars; + static bool hasRunTrackPointCheck; + + if (hasRunTrackPointCheck) + return shouldCreateScrollbars; + + hasRunTrackPointCheck = true; + const wchar_t* trackPointKeys[] = { + L"Software\\Lenovo\\TrackPoint", + L"Software\\Lenovo\\UltraNav", + L"Software\\Alps\\Apoint\\TrackPoint", + L"Software\\Synaptics\\SynTPEnh\\UltraNavUSB", + L"Software\\Synaptics\\SynTPEnh\\UltraNavPS2" + }; + + for (size_t i = 0; i < WTF_ARRAY_LENGTH(trackPointKeys); ++i) { + HKEY trackPointKey; + int readKeyResult = ::RegOpenKeyExW(HKEY_CURRENT_USER, trackPointKeys[i], 0, KEY_READ, &trackPointKey); + ::RegCloseKey(trackPointKey); + if (readKeyResult == ERROR_SUCCESS) { + shouldCreateScrollbars = true; + return shouldCreateScrollbars; + } + } + + return shouldCreateScrollbars; +} + void WebView::close() { + m_undoClient.initialize(0); ::RevokeDragDrop(m_window); setParentWindow(0); m_page->close(); @@ -789,16 +908,41 @@ void WebView::setInitialFocus(bool forward) m_page->setInitialFocus(forward); } +void WebView::setScrollOffsetOnNextResize(const IntSize& scrollOffset) +{ + // The next time we get a WM_SIZE message, scroll by the specified amount in onSizeEvent(). + m_nextResizeScrollOffset = scrollOffset; +} + void WebView::setViewportArguments(const WebCore::ViewportArguments&) { } -void WebView::registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo) +void WebView::registerEditCommand(PassRefPtr<WebEditCommandProxy> prpCommand, WebPageProxy::UndoOrRedo undoOrRedo) { + RefPtr<WebEditCommandProxy> command = prpCommand; + m_undoClient.registerEditCommand(this, command, undoOrRedo); } void WebView::clearAllEditCommands() { + m_undoClient.clearAllEditCommands(this); +} + +void WebView::reapplyEditCommand(WebEditCommandProxy* command) +{ + if (!m_page->isValid() || !m_page->isValidEditCommand(command)) + return; + + command->reapply(); +} + +void WebView::unapplyEditCommand(WebEditCommandProxy* command) +{ + if (!m_page->isValid() || !m_page->isValidEditCommand(command)) + return; + + command->unapply(); } FloatRect WebView::convertToDeviceSpace(const FloatRect& rect) @@ -806,6 +950,11 @@ FloatRect WebView::convertToDeviceSpace(const FloatRect& rect) return rect; } +IntRect WebView::windowToScreen(const IntRect& rect) +{ + return rect; +} + FloatRect WebView::convertToUserSpace(const FloatRect& rect) { return rect; @@ -1105,11 +1254,15 @@ void WebView::setFindIndicator(PassRefPtr<FindIndicator> prpFindIndicator, bool hbmp = CreateDIBSection(0, &bitmapInfo, DIB_RGB_COLORS, static_cast<void**>(&bits), 0, 0); HBITMAP hbmpOld = static_cast<HBITMAP>(SelectObject(hdc, hbmp)); +#if PLATFORM(CG) RetainPtr<CGContextRef> context(AdoptCF, CGBitmapContextCreate(bits, width, height, 8, width * sizeof(RGBQUAD), deviceRGBColorSpaceRef(), kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst)); GraphicsContext graphicsContext(context.get()); contentImage->paint(graphicsContext, IntPoint(), contentImage->bounds()); +#else + // FIXME: Implement! +#endif ::SelectObject(hdc, hbmpOld); ::DeleteDC(hdc); diff --git a/Source/WebKit2/UIProcess/win/WebView.h b/Source/WebKit2/UIProcess/win/WebView.h index 28aedd6..1d65179 100644 --- a/Source/WebKit2/UIProcess/win/WebView.h +++ b/Source/WebKit2/UIProcess/win/WebView.h @@ -30,6 +30,7 @@ #include "PageClient.h" #include "WKView.h" #include "WebPageProxy.h" +#include "WebUndoClient.h" #include <ShlObj.h> #include <WebCore/COMPtr.h> #include <WebCore/DragActions.h> @@ -61,9 +62,14 @@ public: void setIsInWindow(bool); void setOverrideCursor(HCURSOR); void setInitialFocus(bool forward); + void setScrollOffsetOnNextResize(const WebCore::IntSize&); void setFindIndicatorCallback(WKViewFindIndicatorCallback, void*); WKViewFindIndicatorCallback getFindIndicatorCallback(void**); void initialize(); + + void initializeUndoClient(const WKViewUndoClient*); + void reapplyEditCommand(WebEditCommandProxy*); + void unapplyEditCommand(WebEditCommandProxy*); // IUnknown virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); @@ -89,6 +95,8 @@ private: LRESULT onMouseEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); LRESULT onWheelEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); + LRESULT onHorizontalScroll(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); + LRESULT onVerticalScroll(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); LRESULT onKeyEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); LRESULT onPaintEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); LRESULT onPrintClientEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled); @@ -123,6 +131,8 @@ private: void startTrackingMouseLeave(); void stopTrackingMouseLeave(); + bool shouldInitializeTrackPointHack(); + void close(); HCURSOR cursorToShow() const; @@ -134,6 +144,7 @@ private: virtual void displayView(); virtual void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset); virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects); + virtual float userSpaceScaleFactor() const { return 1; } virtual WebCore::IntSize viewSize(); virtual bool isViewWindowActive(); @@ -144,6 +155,7 @@ private: virtual void didRelaunchProcess(); virtual void pageClosed(); virtual void takeFocus(bool direction); + virtual void setFocus(bool focused) { } virtual void toolTipChanged(const WTF::String&, const WTF::String&); virtual void setCursor(const WebCore::Cursor&); virtual void setViewportArguments(const WebCore::ViewportArguments&); @@ -151,6 +163,7 @@ private: virtual void clearAllEditCommands(); virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&); virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&); + virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&); virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled); virtual void compositionSelectionChanged(bool); virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*); @@ -177,6 +190,8 @@ private: HWND m_window; HWND m_topLevelParentWindow; HWND m_toolTipWindow; + + WebCore::IntSize m_nextResizeScrollOffset; HCURSOR m_lastCursorSet; HCURSOR m_webCoreCursor; @@ -192,6 +207,8 @@ private: unsigned m_inIMEComposition; + WebUndoClient m_undoClient; + WKViewFindIndicatorCallback m_findIndicatorCallback; void* m_findIndicatorCallbackContext; diff --git a/Source/WebKit2/WebKit2.pri b/Source/WebKit2/WebKit2.pri index 681f83f..c6ae792 100644 --- a/Source/WebKit2/WebKit2.pri +++ b/Source/WebKit2/WebKit2.pri @@ -41,13 +41,17 @@ WEBKIT2_INCLUDEPATH = \ $$SOURCE_DIR/WebKit2/WebProcess/ApplicationCache \ $$SOURCE_DIR/WebKit2/WebProcess/Authentication \ $$SOURCE_DIR/WebKit2/WebProcess/Cookies \ + $$SOURCE_DIR/WebKit2/WebProcess/Cookies/qt \ $$SOURCE_DIR/WebKit2/WebProcess/Downloads \ $$SOURCE_DIR/WebKit2/WebProcess/Downloads/qt \ + $$SOURCE_DIR/WebKit2/WebProcess/FullScreen \ $$SOURCE_DIR/WebKit2/WebProcess/Geolocation \ + $$SOURCE_DIR/WebKit2/WebProcess/IconDatabase \ $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle \ $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/DOM \ $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c \ $$SOURCE_DIR/WebKit2/WebProcess/KeyValueStorage \ + $$SOURCE_DIR/WebKit2/WebProcess/MediaCache \ $$SOURCE_DIR/WebKit2/WebProcess/Plugins \ $$SOURCE_DIR/WebKit2/WebProcess/Plugins/Netscape \ $$SOURCE_DIR/WebKit2/WebProcess/ResourceCache \ diff --git a/Source/WebKit2/WebKit2.pro b/Source/WebKit2/WebKit2.pro index 1e7d051..d3b0814 100644 --- a/Source/WebKit2/WebKit2.pro +++ b/Source/WebKit2/WebKit2.pro @@ -33,12 +33,18 @@ WEBKIT2_GENERATED_HEADERS = \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebCookieManagerProxyMessages.h \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerMessages.h \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerProxyMessages.h \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebFullScreenManagerMessages.h \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebFullScreenManagerProxyMessages.h \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerMessages.h \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerProxyMessages.h \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebIconDatabaseMessages.h \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebIconDatabaseProxyMessages.h \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorMessages.h \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorProxyMessages.h \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebKeyValueStorageManagerMessages.h \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebKeyValueStorageManagerProxyMessages.h \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebMediaCacheManagerMessages.h \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebMediaCacheManagerProxyMessages.h \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebPageMessages.h \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebPageProxyMessages.h \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebProcessConnectionMessages.h \ @@ -62,12 +68,18 @@ WEBKIT2_GENERATED_SOURCES = \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebCookieManagerProxyMessageReceiver.cpp \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerMessageReceiver.cpp \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerProxyMessageReceiver.cpp \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebFullScreenManagerMessageReceiver.cpp \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebFullScreenManagerProxyMessageReceiver.cpp \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerMessageReceiver.cpp \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerProxyMessageReceiver.cpp \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebIconDatabaseMessageReceiver.cpp \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebIconDatabaseProxyMessageReceiver.cpp \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorMessageReceiver.cpp \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorProxyMessageReceiver.cpp \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebKeyValueStorageManagerMessageReceiver.cpp \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebKeyValueStorageManagerProxyMessageReceiver.cpp \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebMediaCacheManagerMessageReceiver.cpp \ + $$WEBKIT2_GENERATED_SOURCES_DIR/WebMediaCacheManagerProxyMessageReceiver.cpp \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebPageMessageReceiver.cpp \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebPageProxyMessageReceiver.cpp \ $$WEBKIT2_GENERATED_SOURCES_DIR/WebProcessConnectionMessageReceiver.cpp \ @@ -190,12 +202,15 @@ HEADERS += \ UIProcess/WebFrameListenerProxy.h \ UIProcess/WebFramePolicyListenerProxy.h \ UIProcess/WebFrameProxy.h \ + UIProcess/WebFullScreenManagerProxy.h \ UIProcess/WebGeolocationManagerProxy.h \ UIProcess/WebGeolocationProvider.h \ UIProcess/WebHistoryClient.h \ + UIProcess/WebIconDatabase.h \ UIProcess/WebInspectorProxy.h \ UIProcess/WebKeyValueStorageManagerProxy.h \ UIProcess/WebLoaderClient.h \ + UIProcess/WebMediaCacheManagerProxy.h \ UIProcess/WebNavigationData.h \ UIProcess/WebOpenPanelResultListenerProxy.h \ UIProcess/WebPageContextMenuClient.h \ @@ -214,8 +229,10 @@ HEADERS += \ WebProcess/Cookies/WebCookieManager.h \ WebProcess/Downloads/Download.h \ WebProcess/Downloads/DownloadManager.h \ + WebProcess/FullScreen/WebFullScreenManager.h \ WebProcess/Geolocation/GeolocationPermissionRequestManager.h \ WebProcess/Geolocation/WebGeolocationManager.h \ + WebProcess/IconDatabase/WebIconDatabaseProxy.h \ WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h \ WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h \ WebProcess/InjectedBundle/InjectedBundle.h \ @@ -229,6 +246,7 @@ HEADERS += \ WebProcess/InjectedBundle/InjectedBundleScriptWorld.h \ WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h \ WebProcess/KeyValueStorage/WebKeyValueStorageManager.h \ + WebProcess/MediaCache/WebMediaCacheManager.h \ WebProcess/ResourceCache/WebResourceCacheManager.h \ WebProcess/Plugins/Netscape/JSNPMethod.h \ WebProcess/Plugins/Netscape/JSNPObject.h \ @@ -380,12 +398,15 @@ SOURCES += \ UIProcess/WebFrameListenerProxy.cpp \ UIProcess/WebFramePolicyListenerProxy.cpp \ UIProcess/WebFrameProxy.cpp \ + UIProcess/WebFullScreenManagerProxy.cpp \ UIProcess/WebGeolocationManagerProxy.cpp \ UIProcess/WebGeolocationProvider.cpp \ UIProcess/WebHistoryClient.cpp \ + UIProcess/WebIconDatabase.cpp \ UIProcess/WebInspectorProxy.cpp \ UIProcess/WebKeyValueStorageManagerProxy.cpp \ UIProcess/WebLoaderClient.cpp \ + UIProcess/WebMediaCacheManagerProxy.cpp \ UIProcess/WebNavigationData.cpp \ UIProcess/WebOpenPanelResultListenerProxy.cpp \ UIProcess/WebPageContextMenuClient.cpp \ @@ -410,11 +431,14 @@ SOURCES += \ WebProcess/ApplicationCache/WebApplicationCacheManager.cpp \ WebProcess/Authentication/AuthenticationManager.cpp \ WebProcess/Cookies/WebCookieManager.cpp \ + WebProcess/Cookies/qt/WebCookieManagerQt.cpp \ WebProcess/Downloads/Download.cpp \ WebProcess/Downloads/DownloadManager.cpp \ + WebProcess/Downloads/qt/DownloadQt.cpp \ + WebProcess/FullScreen/WebFullScreenManager.cpp \ WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp \ WebProcess/Geolocation/WebGeolocationManager.cpp \ - WebProcess/Downloads/qt/DownloadQt.cpp \ + WebProcess/IconDatabase/WebIconDatabaseProxy.cpp \ WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp \ WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp \ WebProcess/InjectedBundle/InjectedBundle.cpp \ @@ -433,6 +457,7 @@ SOURCES += \ WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp \ WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp \ WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp \ + WebProcess/MediaCache/WebMediaCacheManager.cpp \ WebProcess/ResourceCache/WebResourceCacheManager.cpp \ WebProcess/Plugins/Netscape/JSNPMethod.cpp \ WebProcess/Plugins/Netscape/JSNPObject.cpp \ @@ -442,7 +467,7 @@ SOURCES += \ WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp \ WebProcess/Plugins/Netscape/NetscapePlugin.cpp \ WebProcess/Plugins/Netscape/NetscapePluginStream.cpp \ - WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp \ + WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \ WebProcess/Plugins/Netscape/qt/PluginProxyQt.cpp \ WebProcess/Plugins/Plugin.cpp \ WebProcess/Plugins/PluginView.cpp \ diff --git a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj index 76679b7..d54f8f2 100644 --- a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj +++ b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ ); dependencies = ( 1A50DB3C110A3C19000D3FE5 /* PBXTargetDependency */, + BCDE0AC113272712001259FB /* PBXTargetDependency */, ); name = All; productName = WebKit2; @@ -63,11 +64,8 @@ 1A119A95127B796200A9ECB1 /* MessageSender.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A119A94127B796200A9ECB1 /* MessageSender.h */; }; 1A186EEA12EF7618008E5F37 /* LayerTreeHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A186EE812EF7618008E5F37 /* LayerTreeHost.h */; }; 1A186EEB12EF7618008E5F37 /* LayerTreeHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A186EE912EF7618008E5F37 /* LayerTreeHost.cpp */; }; - 1A18718512EF9877008E5F37 /* LayerTreeHostMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A18718412EF9877008E5F37 /* LayerTreeHostMac.mm */; }; 1A1C4EC810D06099005E67E7 /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1C79A100E7FC50078DEBC /* WebCore.framework */; }; 1A1C649B11F4174200553C19 /* WebContextMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C648611F415B700553C19 /* WebContextMac.mm */; }; - 1A1FA285127A13BC0050E709 /* NPObjectProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1FA284127A13BC0050E709 /* NPObjectProxy.cpp */; }; - 1A1FA35D127A45BF0050E709 /* NPObjectMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1FA35C127A45BF0050E709 /* NPObjectMessageReceiver.cpp */; }; 1A2161B011F37664008AD0F5 /* NPRuntimeObjectMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2161AE11F37664008AD0F5 /* NPRuntimeObjectMap.h */; }; 1A2161B111F37664008AD0F5 /* NPRuntimeObjectMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2161AF11F37664008AD0F5 /* NPRuntimeObjectMap.cpp */; }; 1A2162B011F38971008AD0F5 /* NPRuntimeUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2162AE11F38971008AD0F5 /* NPRuntimeUtilities.cpp */; }; @@ -98,6 +96,8 @@ 1A2D957012848564001EB962 /* ChildProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2D956E12848564001EB962 /* ChildProcess.cpp */; }; 1A30066E1110F4F70031937C /* ResponsivenessTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A30066C1110F4F70031937C /* ResponsivenessTimer.h */; }; 1A30EAC6115D7DA30053E937 /* ConnectionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A30EAC5115D7DA30053E937 /* ConnectionMac.cpp */; }; + 1A3979F61332983A00E00300 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; }; + 1A3979F71332983F00E00300 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */; }; 1A3DD1FD125E59F3004515E6 /* WebFindClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3DD1FC125E59F3004515E6 /* WebFindClient.cpp */; }; 1A3DD202125E5A1F004515E6 /* WebFindClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3DD201125E5A1F004515E6 /* WebFindClient.h */; }; 1A3DD206125E5A2F004515E6 /* APIClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3DD205125E5A2F004515E6 /* APIClient.h */; }; @@ -125,7 +125,6 @@ 1A64218712DCF49200CAAE2C /* DrawingAreaProxyImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A64218512DCF49200CAAE2C /* DrawingAreaProxyImpl.cpp */; }; 1A6421F612DCFBAB00CAAE2C /* DrawingAreaImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6421F412DCFBAB00CAAE2C /* DrawingAreaImpl.h */; }; 1A6421F712DCFBAB00CAAE2C /* DrawingAreaImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6421F512DCFBAB00CAAE2C /* DrawingAreaImpl.cpp */; }; - 1A64228B12DD024700CAAE2C /* DrawingArea.messages.in in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1A64228A12DD024700CAAE2C /* DrawingArea.messages.in */; }; 1A64229912DD029200CAAE2C /* DrawingAreaMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A64229712DD029200CAAE2C /* DrawingAreaMessageReceiver.cpp */; }; 1A64229A12DD029200CAAE2C /* DrawingAreaMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A64229812DD029200CAAE2C /* DrawingAreaMessages.h */; }; 1A64230812DD09EB00CAAE2C /* DrawingAreaProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A64230612DD09EB00CAAE2C /* DrawingAreaProxyMessageReceiver.cpp */; }; @@ -137,7 +136,6 @@ 1A64256812DE42EC00CAAE2C /* BackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A64256612DE42EC00CAAE2C /* BackingStore.h */; }; 1A64256912DE42EC00CAAE2C /* BackingStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A64256712DE42EC00CAAE2C /* BackingStore.cpp */; }; 1A64292D12DE5F9800CAAE2C /* BackingStoreMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A64292C12DE5F9800CAAE2C /* BackingStoreMac.mm */; }; - 1A690D1712F39E3300ECD289 /* LayerTreeHostMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A690D1612F39E3300ECD289 /* LayerTreeHostMac.h */; }; 1A6F9F9011E13EFC00DB1371 /* CommandLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */; }; 1A6F9FB711E1408500DB1371 /* CommandLineMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */; }; 1A6FA01E11E1526300DB1371 /* WebProcessMainMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FA01D11E1526300DB1371 /* WebProcessMainMac.mm */; }; @@ -202,8 +200,7 @@ 1AB7D72D1288CAAD00CFD08C /* WebDownloadClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7D72B1288CAAD00CFD08C /* WebDownloadClient.cpp */; }; 1AB7D78D1288CD9A00CFD08C /* WKDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7D78B1288CD9A00CFD08C /* WKDownload.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1AB7D78E1288CD9A00CFD08C /* WKDownload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7D78C1288CD9A00CFD08C /* WKDownload.cpp */; }; - 1AC25FC212A48F6000BD2671 /* PluginProcessShim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC25F8A12A48E0300BD2671 /* PluginProcessShim.cpp */; }; - 1AC25FDC12A4902700BD2671 /* PluginProcessShim.dylib in Copy Plug-in Process Shim */ = {isa = PBXBuildFile; fileRef = 1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */; }; + 1AC25FC212A48F6000BD2671 /* PluginProcessShim.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AC25F8A12A48E0300BD2671 /* PluginProcessShim.mm */; }; 1AC41AC71263C88300054E94 /* BinarySemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC41AC51263C88300054E94 /* BinarySemaphore.h */; }; 1AC41AC81263C88300054E94 /* BinarySemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC41AC61263C88300054E94 /* BinarySemaphore.cpp */; }; 1AC86FF3130B46D3002C1257 /* WKPluginSiteDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC86FF1130B46D3002C1257 /* WKPluginSiteDataManager.cpp */; }; @@ -263,12 +260,30 @@ 33367658130C9ECB006C9DE2 /* WebResourceCacheManagerProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 33367654130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessages.h */; }; 33AA1066131F060000D4A575 /* WebCookieManagerProxyClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33AA1064131F060000D4A575 /* WebCookieManagerProxyClient.cpp */; }; 33AA1067131F060000D4A575 /* WebCookieManagerProxyClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 33AA1065131F060000D4A575 /* WebCookieManagerProxyClient.h */; }; + 33D3A3B51339600B00709BE4 /* WKMediaCacheManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33D3A3B31339600B00709BE4 /* WKMediaCacheManager.cpp */; }; + 33D3A3B61339600B00709BE4 /* WKMediaCacheManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 33D3A3B41339600B00709BE4 /* WKMediaCacheManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 33D3A3BA1339606200709BE4 /* WebMediaCacheManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33D3A3B71339606200709BE4 /* WebMediaCacheManagerProxy.cpp */; }; + 33D3A3BB1339606200709BE4 /* WebMediaCacheManagerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 33D3A3B81339606200709BE4 /* WebMediaCacheManagerProxy.h */; }; + 33D3A3C1133960B000709BE4 /* WebMediaCacheManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33D3A3BE133960B000709BE4 /* WebMediaCacheManager.cpp */; }; + 33D3A3C2133960B000709BE4 /* WebMediaCacheManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 33D3A3BF133960B000709BE4 /* WebMediaCacheManager.h */; }; + 33D3A3C81339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33D3A3C41339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp */; }; + 33D3A3C91339617900709BE4 /* WebMediaCacheManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 33D3A3C51339617900709BE4 /* WebMediaCacheManagerMessages.h */; }; + 33D3A3CA1339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33D3A3C61339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp */; }; + 33D3A3CB1339617900709BE4 /* WebMediaCacheManagerProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 33D3A3C71339617900709BE4 /* WebMediaCacheManagerProxyMessages.h */; }; 33F9D5B91312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33F9D5B81312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp */; }; 37C4E9F6131C6E7E0029BD5A /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = B396EA5512E0ED2D00F4FEB7 /* config.h */; }; 37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F623B712A57B6200E3FDF6 /* WKFindOptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 51021E9C12B16788005C033C /* WebContextMenuClientMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */; }; 510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */; }; 510FBB9B1288C95E00AFFDF4 /* WebContextMenuItemData.h in Headers */ = {isa = PBXBuildFile; fileRef = 510FBB991288C95E00AFFDF4 /* WebContextMenuItemData.h */; }; + 5110AE0C133C16CB0072717A /* WKIconDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5110AE0A133C16CB0072717A /* WKIconDatabase.cpp */; }; + 5110AE0D133C16CB0072717A /* WKIconDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5110AE0B133C16CB0072717A /* WKIconDatabase.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 511B24A6132E095700065A0C /* WebIconDatabaseProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511B24A4132E095700065A0C /* WebIconDatabaseProxy.cpp */; }; + 511B24A7132E095700065A0C /* WebIconDatabaseProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B24A5132E095700065A0C /* WebIconDatabaseProxy.h */; }; + 511B24AA132E097200065A0C /* WebIconDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511B24A8132E097200065A0C /* WebIconDatabase.cpp */; }; + 511B24AB132E097200065A0C /* WebIconDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B24A9132E097200065A0C /* WebIconDatabase.h */; }; + 5123CF1B133D260A0056F800 /* WKIconDatabaseCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5123CF19133D260A0056F800 /* WKIconDatabaseCG.cpp */; }; + 5123CF1C133D260A0056F800 /* WKIconDatabaseCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 5123CF1A133D260A0056F800 /* WKIconDatabaseCG.h */; settings = {ATTRIBUTES = (Public, ); }; }; 512935D71288D19400A4B695 /* WebContextMenuItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512935D51288D19400A4B695 /* WebContextMenuItem.cpp */; }; 512935D81288D19400A4B695 /* WebContextMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 512935D61288D19400A4B695 /* WebContextMenuItem.h */; }; 512935E31288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512935E11288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp */; }; @@ -306,6 +321,7 @@ 5153569C1291B1D2000749DC /* WebPageContextMenuClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5153569A1291B1D2000749DC /* WebPageContextMenuClient.cpp */; }; 5153569D1291B1D2000749DC /* WebPageContextMenuClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 5153569B1291B1D2000749DC /* WebPageContextMenuClient.h */; }; 51578B831209ECEF00A37C4A /* WebData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51578B821209ECEF00A37C4A /* WebData.h */; }; + 5160BFE113381DF900918999 /* Logging.mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160BFE013381DF900918999 /* Logging.mac.mm */; }; 516A4A5D120A2CCD00C05B7F /* WebError.h in Headers */ = {isa = PBXBuildFile; fileRef = 516A4A5B120A2CCD00C05B7F /* WebError.h */; }; 51871B5B127CB89D00F76232 /* WebContextMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51871B59127CB89D00F76232 /* WebContextMenu.cpp */; }; 51871B5C127CB89D00F76232 /* WebContextMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 51871B5A127CB89D00F76232 /* WebContextMenu.h */; }; @@ -336,8 +352,11 @@ 51ACBBA1127A8F2C00D203B9 /* WebContextMenuProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */; }; 51B3005012529D0E000B5CA0 /* WebBackForwardListCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */; }; 51B3005112529D0E000B5CA0 /* WebPageProxyCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */; }; + 51D02F64132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D02F63132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp */; }; + 51D02F6A132EC73700BEAA96 /* WebIconDatabaseMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D02F67132EC73700BEAA96 /* WebIconDatabaseMessages.h */; }; + 51D02F6B132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D02F68132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp */; }; + 51D02F6C132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D02F69132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h */; }; 6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */; }; - 6546A82C13000164000CEB1C /* InjectedBundlePageResourceLoadClient.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 6546A82A13000164000CEB1C /* InjectedBundlePageResourceLoadClient.h */; }; 659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6546A82913000164000CEB1C /* InjectedBundlePageResourceLoadClient.cpp */; }; 65B86F1E12F11DE300B7DD8A /* WKBundleInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6D8A91A611F0EFD100DD01FE /* com.apple.WebProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = 6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */; }; @@ -363,6 +382,8 @@ 93FC67BE12D3CCF200A60610 /* DecoderAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FC679E12D3CC7400A60610 /* DecoderAdapter.h */; }; 93FC67BF12D3CCF200A60610 /* EncoderAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93FC679F12D3CC7400A60610 /* EncoderAdapter.cpp */; }; 93FC67C012D3CCF200A60610 /* EncoderAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FC67A012D3CC7400A60610 /* EncoderAdapter.h */; }; + B878B615133428DC006888E9 /* CorrectionPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = B878B613133428DC006888E9 /* CorrectionPanel.h */; }; + B878B616133428DC006888E9 /* CorrectionPanel.mm in Sources */ = {isa = PBXBuildFile; fileRef = B878B614133428DC006888E9 /* CorrectionPanel.mm */; }; BC0092F7115837A300E0AE2A /* RunLoopMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC0092F5115837A300E0AE2A /* RunLoopMac.mm */; }; BC0092F8115837A300E0AE2A /* WorkQueueMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0092F6115837A300E0AE2A /* WorkQueueMac.cpp */; }; BC032D7510F4378D0058C15A /* WebChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC032D6010F4378D0058C15A /* WebChromeClient.h */; }; @@ -676,6 +697,9 @@ BCDDB32D124EC2E10048D13C /* WKAPICast.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDDB32C124EC2E10048D13C /* WKAPICast.h */; }; BCDE059B11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDE059911CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h */; }; BCDE059C11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */; }; + BCDE093B13272496001259FB /* MainMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FA31011E3921E00DB1371 /* MainMac.cpp */; }; + BCDE093D13272496001259FB /* PluginProcessShim.dylib in Copy Plug-in Process Shim */ = {isa = PBXBuildFile; fileRef = 1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */; }; + BCDE0ABF13272708001259FB /* PluginProcess.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCDE094213272496001259FB /* PluginProcess.app */; }; BCE2315D122C30CA00D5C35A /* WebURLRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE2315B122C30CA00D5C35A /* WebURLRequest.h */; }; BCE2315E122C30CA00D5C35A /* WebURLRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE2315C122C30CA00D5C35A /* WebURLRequest.cpp */; }; BCE231C2122C466E00D5C35A /* WebURLRequestMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCE231C0122C466E00D5C35A /* WebURLRequestMac.mm */; }; @@ -716,6 +740,8 @@ BCF69FA31176D01400471A52 /* WebNavigationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF69FA11176D01400471A52 /* WebNavigationData.cpp */; }; BCF69FA91176D1CB00471A52 /* WKNavigationData.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF69FA71176D1CB00471A52 /* WKNavigationData.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCF69FAA1176D1CB00471A52 /* WKNavigationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */; }; + BCFD548B132D82680055D816 /* WKErrorCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCFD5489132D82680055D816 /* WKErrorCF.cpp */; }; + BCFD548C132D82680055D816 /* WKErrorCF.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFD548A132D82680055D816 /* WKErrorCF.h */; settings = {ATTRIBUTES = (Public, ); }; }; BFA6179F12F0B99D0033E0CA /* WKViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BFA6179E12F0B99D0033E0CA /* WKViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; C01A260112662F2100C9ED55 /* ShareableBitmapCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C01A260012662F2100C9ED55 /* ShareableBitmapCG.cpp */; }; C02BFF1E1251502E009CCBEA /* NativeWebKeyboardEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C02BFF1D1251502E009CCBEA /* NativeWebKeyboardEventMac.mm */; }; @@ -725,11 +751,14 @@ C0337DD3127A2A0E008FF4F4 /* WebKeyboardEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0337DD2127A2A0E008FF4F4 /* WebKeyboardEvent.cpp */; }; C0337DD8127A51B6008FF4F4 /* WebTouchEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0337DD7127A51B6008FF4F4 /* WebTouchEvent.cpp */; }; C0337DDD127A521C008FF4F4 /* WebPlatformTouchPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0337DDC127A521C008FF4F4 /* WebPlatformTouchPoint.cpp */; }; + C03A136C133BEBF900D767D1 /* LayerTreeHostCAMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C03A136B133BEBF900D767D1 /* LayerTreeHostCAMac.mm */; }; + C064504A133BE709003470E2 /* LayerTreeHostCA.h in Headers */ = {isa = PBXBuildFile; fileRef = C098A053133BE1C500B199A4 /* LayerTreeHostCA.h */; }; C06C6095124C144B0001682F /* WebPageCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C06C6093124C14430001682F /* WebPageCreationParameters.cpp */; }; C09AE5E9125257C20025825D /* WKNativeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = C09AE5E8125257C20025825D /* WKNativeEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; C0CE72A01247E71D00BC0EC4 /* WebPageMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */; }; C0CE72A11247E71D00BC0EC4 /* WebPageMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = C0CE729F1247E71D00BC0EC4 /* WebPageMessages.h */; }; C0CE72AD1247E78D00BC0EC4 /* HandleMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = C0CE72AC1247E78D00BC0EC4 /* HandleMessage.h */; }; + C0D74DDE133BE2D90089CD44 /* LayerTreeHostCA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C098A054133BE1C500B199A4 /* LayerTreeHostCA.cpp */; }; C0E3AA7A1209E83000A49D01 /* ModuleMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0E3AA481209E45000A49D01 /* ModuleMac.mm */; }; C0E3AA7B1209E83500A49D01 /* Module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0E3AA451209E2BA00A49D01 /* Module.cpp */; }; C0E3AA7C1209E83C00A49D01 /* Module.h in Headers */ = {isa = PBXBuildFile; fileRef = C0E3AA441209E2BA00A49D01 /* Module.h */; }; @@ -738,6 +767,15 @@ C574A37712E6099D002DFE98 /* WebDragClientMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C554FFA212E4E8EA002F22C0 /* WebDragClientMac.mm */; }; C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = C574A57F12E66681002DFE98 /* PasteboardTypes.h */; }; C574A58212E66681002DFE98 /* PasteboardTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = C574A58012E66681002DFE98 /* PasteboardTypes.mm */; }; + CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA3E131A2E8A00EEDED2 /* WebFullScreenManagerProxy.cpp */; }; + CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA45131ACC8800EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp */; }; + CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA48131ACD8E00EEDED2 /* WebFullScreenManagerMessageReceiver.cpp */; }; + CD73BA53131B645B00EEDED2 /* WebFullScreenManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA37131A29FE00EEDED2 /* WebFullScreenManager.cpp */; }; + CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */; }; + CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */; }; + CDCA85D5132AC2B300E961DF /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CDCA85D4132AC2B300E961DF /* IOKit.framework */; }; + CDCA85EE132AD70100E961DF /* WebFullScreenManagerProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */; }; + CDCA8603132ADC0500E961DF /* WebFullScreenManagerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85E6132AD33000E961DF /* WebFullScreenManagerMac.mm */; }; D3B9484611FF4B6500032B39 /* WebPopupMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3B9484211FF4B6500032B39 /* WebPopupMenu.cpp */; }; D3B9484711FF4B6500032B39 /* WebPopupMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = D3B9484311FF4B6500032B39 /* WebPopupMenu.h */; }; D3B9484811FF4B6500032B39 /* WebSearchPopupMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3B9484411FF4B6500032B39 /* WebSearchPopupMenu.cpp */; }; @@ -745,8 +783,6 @@ E134F01712EA5D33004EC58D /* WKPrintingView.h in Headers */ = {isa = PBXBuildFile; fileRef = E134F01512EA5D11004EC58D /* WKPrintingView.h */; }; E134F01A12EA5D99004EC58D /* WKPrintingView.mm in Sources */ = {isa = PBXBuildFile; fileRef = E134F01912EA5D99004EC58D /* WKPrintingView.mm */; }; E18C92F412DB9E7100CF2AEB /* PrintInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18C92F312DB9E7100CF2AEB /* PrintInfo.cpp */; }; - E18C92F512DB9E7A00CF2AEB /* PrintInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18C92F312DB9E7100CF2AEB /* PrintInfo.cpp */; }; - E18C92F612DB9E9400CF2AEB /* PrintInfoMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1CC1B8F12D7EADF00625838 /* PrintInfoMac.mm */; }; E1BB16A413201B9B00F49431 /* FullKeyboardAccessWatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = E1BB1688132018BA00F49431 /* FullKeyboardAccessWatcher.h */; }; E1BB16A513201B9B00F49431 /* FullKeyboardAccessWatcher.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1BB1689132018BA00F49431 /* FullKeyboardAccessWatcher.mm */; }; E1CC1B9012D7EADF00625838 /* PrintInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CC1B8E12D7EADF00625838 /* PrintInfo.h */; }; @@ -769,9 +805,12 @@ F634445612A885C8000612D8 /* WebSecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = F634445512A885C8000612D8 /* WebSecurityOrigin.h */; }; F634445C12A885E9000612D8 /* WKSecurityOrigin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F634445A12A885E9000612D8 /* WKSecurityOrigin.cpp */; }; F634445D12A885E9000612D8 /* WKSecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = F634445B12A885E9000612D8 /* WKSecurityOrigin.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F6389550133BEF38008941D5 /* HTTPCookieAcceptPolicy.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F638954F133BEF38008941D5 /* HTTPCookieAcceptPolicy.h */; }; F67DD7BA125E40D9007BDCB8 /* WKSerializedScriptValuePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F67DD7B9125E40D9007BDCB8 /* WKSerializedScriptValuePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; F6A25FDC12ADC6CC00DC40CC /* WebDatabaseManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6A25FDA12ADC6CC00DC40CC /* WebDatabaseManager.cpp */; }; F6A25FDD12ADC6CC00DC40CC /* WebDatabaseManager.h in Headers */ = {isa = PBXBuildFile; fileRef = F6A25FDB12ADC6CC00DC40CC /* WebDatabaseManager.h */; }; + F6A90813133C20510082C3F4 /* WebCookieManagerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6A90811133C1F3D0082C3F4 /* WebCookieManagerMac.mm */; }; + F6D632BC133D198200743D77 /* WebCookieManagerProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6D632BA133D181B00743D77 /* WebCookieManagerProxyMac.mm */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -789,19 +828,33 @@ remoteGlobalIDString = 1A50DB1D110A3BDC000D3FE5; remoteInfo = WebProcess; }; - 1AC25FD712A48FD500BD2671 /* PBXContainerItemProxy */ = { + 37F7407812721F740093869B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C0CE72851247E66800BC0EC4; + remoteInfo = "Derived Sources"; + }; + BCDE093513272496001259FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; proxyType = 1; remoteGlobalIDString = 1AC25FAF12A48EA700BD2671; remoteInfo = PluginProcessShim; }; - 37F7407812721F740093869B /* PBXContainerItemProxy */ = { + BCDE093713272496001259FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = C0CE72851247E66800BC0EC4; - remoteInfo = "Derived Sources"; + remoteGlobalIDString = 8DC2EF4F0486A6940098B216; + remoteInfo = WebKit2; + }; + BCDE0AC013272712001259FB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = BCDE093313272496001259FB; + remoteInfo = "Plugin Process"; }; /* End PBXContainerItemProxy section */ @@ -813,18 +866,18 @@ dstSubfolderSpec = 1; files = ( 1A50DB66110A3D57000D3FE5 /* WebProcess.app in CopyFiles */, - 1A64228B12DD024700CAAE2C /* DrawingArea.messages.in in CopyFiles */, - 6546A82C13000164000CEB1C /* InjectedBundlePageResourceLoadClient.h in CopyFiles */, + BCDE0ABF13272708001259FB /* PluginProcess.app in CopyFiles */, + F6389550133BEF38008941D5 /* HTTPCookieAcceptPolicy.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; - 1AC25FDD12A4904500BD2671 /* Copy Plug-in Process Shim */ = { + BCDE093C13272496001259FB /* Copy Plug-in Process Shim */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; - dstPath = WebProcess.app/Contents/MacOS; + dstPath = PluginProcess.app/Contents/MacOS; dstSubfolderSpec = 16; files = ( - 1AC25FDC12A4902700BD2671 /* PluginProcessShim.dylib in Copy Plug-in Process Shim */, + BCDE093D13272496001259FB /* PluginProcessShim.dylib in Copy Plug-in Process Shim */, ); name = "Copy Plug-in Process Shim"; runOnlyForDeploymentPostprocessing = 0; @@ -868,7 +921,6 @@ 1A119A94127B796200A9ECB1 /* MessageSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageSender.h; sourceTree = "<group>"; }; 1A186EE812EF7618008E5F37 /* LayerTreeHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeHost.h; sourceTree = "<group>"; }; 1A186EE912EF7618008E5F37 /* LayerTreeHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayerTreeHost.cpp; sourceTree = "<group>"; }; - 1A18718412EF9877008E5F37 /* LayerTreeHostMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LayerTreeHostMac.mm; sourceTree = "<group>"; }; 1A1C648611F415B700553C19 /* WebContextMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMac.mm; sourceTree = "<group>"; }; 1A1FA251127A0E4F0050E709 /* NPRemoteObjectMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NPRemoteObjectMap.h; sourceTree = "<group>"; }; 1A1FA252127A0E4F0050E709 /* NPRemoteObjectMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRemoteObjectMap.cpp; sourceTree = "<group>"; }; @@ -947,7 +999,6 @@ 1A64256612DE42EC00CAAE2C /* BackingStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackingStore.h; sourceTree = "<group>"; }; 1A64256712DE42EC00CAAE2C /* BackingStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackingStore.cpp; sourceTree = "<group>"; }; 1A64292C12DE5F9800CAAE2C /* BackingStoreMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BackingStoreMac.mm; sourceTree = "<group>"; }; - 1A690D1612F39E3300ECD289 /* LayerTreeHostMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeHostMac.h; sourceTree = "<group>"; }; 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandLine.h; sourceTree = "<group>"; }; 1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommandLineMac.cpp; sourceTree = "<group>"; }; 1A6FA01D11E1526300DB1371 /* WebProcessMainMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessMainMac.mm; sourceTree = "<group>"; }; @@ -1017,7 +1068,7 @@ 1AB7D78B1288CD9A00CFD08C /* WKDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownload.h; sourceTree = "<group>"; }; 1AB7D78C1288CD9A00CFD08C /* WKDownload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKDownload.cpp; sourceTree = "<group>"; }; 1AC25F8912A48E0300BD2671 /* PluginProcessShim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessShim.h; sourceTree = "<group>"; }; - 1AC25F8A12A48E0300BD2671 /* PluginProcessShim.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProcessShim.cpp; sourceTree = "<group>"; }; + 1AC25F8A12A48E0300BD2671 /* PluginProcessShim.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginProcessShim.mm; sourceTree = "<group>"; }; 1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = PluginProcessShim.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; 1AC25FBB12A48EDA00BD2671 /* PluginProcessShim.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = PluginProcessShim.xcconfig; sourceTree = "<group>"; }; 1AC41AC51263C88300054E94 /* BinarySemaphore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BinarySemaphore.h; sourceTree = "<group>"; }; @@ -1086,11 +1137,31 @@ 33367654130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceCacheManagerProxyMessages.h; sourceTree = "<group>"; }; 33AA1064131F060000D4A575 /* WebCookieManagerProxyClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCookieManagerProxyClient.cpp; sourceTree = "<group>"; }; 33AA1065131F060000D4A575 /* WebCookieManagerProxyClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCookieManagerProxyClient.h; sourceTree = "<group>"; }; + 33D3A3B31339600B00709BE4 /* WKMediaCacheManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKMediaCacheManager.cpp; sourceTree = "<group>"; }; + 33D3A3B41339600B00709BE4 /* WKMediaCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKMediaCacheManager.h; sourceTree = "<group>"; }; + 33D3A3B71339606200709BE4 /* WebMediaCacheManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebMediaCacheManagerProxy.cpp; sourceTree = "<group>"; }; + 33D3A3B81339606200709BE4 /* WebMediaCacheManagerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaCacheManagerProxy.h; sourceTree = "<group>"; }; + 33D3A3B91339606200709BE4 /* WebMediaCacheManagerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebMediaCacheManagerProxy.messages.in; sourceTree = "<group>"; }; + 33D3A3BE133960B000709BE4 /* WebMediaCacheManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebMediaCacheManager.cpp; path = MediaCache/WebMediaCacheManager.cpp; sourceTree = "<group>"; }; + 33D3A3BF133960B000709BE4 /* WebMediaCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebMediaCacheManager.h; path = MediaCache/WebMediaCacheManager.h; sourceTree = "<group>"; }; + 33D3A3C0133960B000709BE4 /* WebMediaCacheManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebMediaCacheManager.messages.in; path = MediaCache/WebMediaCacheManager.messages.in; sourceTree = "<group>"; }; + 33D3A3C41339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebMediaCacheManagerMessageReceiver.cpp; sourceTree = "<group>"; }; + 33D3A3C51339617900709BE4 /* WebMediaCacheManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaCacheManagerMessages.h; sourceTree = "<group>"; }; + 33D3A3C61339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebMediaCacheManagerProxyMessageReceiver.cpp; sourceTree = "<group>"; }; + 33D3A3C71339617900709BE4 /* WebMediaCacheManagerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaCacheManagerProxyMessages.h; sourceTree = "<group>"; }; 33F9D5B81312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = WebResourceCacheManagerCFNet.cpp; path = ResourceCache/cf/WebResourceCacheManagerCFNet.cpp; sourceTree = "<group>"; }; 37F623B712A57B6200E3FDF6 /* WKFindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFindOptions.h; sourceTree = "<group>"; }; 51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuClientMac.mm; sourceTree = "<group>"; }; 510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenuItemData.cpp; sourceTree = "<group>"; }; 510FBB991288C95E00AFFDF4 /* WebContextMenuItemData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenuItemData.h; sourceTree = "<group>"; }; + 5110AE0A133C16CB0072717A /* WKIconDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKIconDatabase.cpp; sourceTree = "<group>"; }; + 5110AE0B133C16CB0072717A /* WKIconDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKIconDatabase.h; sourceTree = "<group>"; }; + 511B24A4132E095700065A0C /* WebIconDatabaseProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebIconDatabaseProxy.cpp; path = IconDatabase/WebIconDatabaseProxy.cpp; sourceTree = "<group>"; }; + 511B24A5132E095700065A0C /* WebIconDatabaseProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebIconDatabaseProxy.h; path = IconDatabase/WebIconDatabaseProxy.h; sourceTree = "<group>"; }; + 511B24A8132E097200065A0C /* WebIconDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIconDatabase.cpp; sourceTree = "<group>"; }; + 511B24A9132E097200065A0C /* WebIconDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabase.h; sourceTree = "<group>"; }; + 5123CF19133D260A0056F800 /* WKIconDatabaseCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WKIconDatabaseCG.cpp; path = cg/WKIconDatabaseCG.cpp; sourceTree = "<group>"; }; + 5123CF1A133D260A0056F800 /* WKIconDatabaseCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKIconDatabaseCG.h; path = cg/WKIconDatabaseCG.h; sourceTree = "<group>"; }; 512935D51288D19400A4B695 /* WebContextMenuItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenuItem.cpp; sourceTree = "<group>"; }; 512935D61288D19400A4B695 /* WebContextMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenuItem.h; sourceTree = "<group>"; }; 512935E11288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageContextMenuClient.cpp; sourceTree = "<group>"; }; @@ -1129,9 +1200,11 @@ 5153569A1291B1D2000749DC /* WebPageContextMenuClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageContextMenuClient.cpp; sourceTree = "<group>"; }; 5153569B1291B1D2000749DC /* WebPageContextMenuClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageContextMenuClient.h; sourceTree = "<group>"; }; 51578B821209ECEF00A37C4A /* WebData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebData.h; sourceTree = "<group>"; }; + 5160BFE013381DF900918999 /* Logging.mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Logging.mac.mm; sourceTree = "<group>"; }; 516A4A5B120A2CCD00C05B7F /* WebError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebError.h; sourceTree = "<group>"; }; 517A33B3130B308C00F80CB5 /* WKApplicationCacheManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKApplicationCacheManager.cpp; sourceTree = "<group>"; }; 517A33B4130B308C00F80CB5 /* WKApplicationCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKApplicationCacheManager.h; sourceTree = "<group>"; }; + 5184BC4A132E907A006B9E28 /* WebIconDatabase.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebIconDatabase.messages.in; sourceTree = "<group>"; }; 51871B59127CB89D00F76232 /* WebContextMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenu.cpp; sourceTree = "<group>"; }; 51871B5A127CB89D00F76232 /* WebContextMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenu.h; sourceTree = "<group>"; }; 518ACAE912AEE6BB00B04B83 /* WKProtectionSpaceTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProtectionSpaceTypes.h; sourceTree = "<group>"; }; @@ -1163,6 +1236,11 @@ 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuProxyMac.mm; sourceTree = "<group>"; }; 51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebBackForwardListCF.cpp; path = cf/WebBackForwardListCF.cpp; sourceTree = "<group>"; }; 51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPageProxyCF.cpp; path = cf/WebPageProxyCF.cpp; sourceTree = "<group>"; }; + 51D02F63132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIconDatabaseMessageReceiver.cpp; sourceTree = "<group>"; }; + 51D02F65132EC6D300BEAA96 /* WebIconDatabaseProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebIconDatabaseProxy.messages.in; path = IconDatabase/WebIconDatabaseProxy.messages.in; sourceTree = "<group>"; }; + 51D02F67132EC73700BEAA96 /* WebIconDatabaseMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseMessages.h; sourceTree = "<group>"; }; + 51D02F68132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIconDatabaseProxyMessageReceiver.cpp; sourceTree = "<group>"; }; + 51D02F69132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseProxyMessages.h; sourceTree = "<group>"; }; 5DAD7294116FF70B00EE5396 /* WebProcess.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebProcess.xcconfig; sourceTree = "<group>"; }; 5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; }; 6546A82913000164000CEB1C /* InjectedBundlePageResourceLoadClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageResourceLoadClient.cpp; sourceTree = "<group>"; }; @@ -1195,6 +1273,8 @@ 93FC67A012D3CC7400A60610 /* EncoderAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncoderAdapter.h; sourceTree = "<group>"; }; A72D5D7F1236CBA800A88B15 /* WebSerializedScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSerializedScriptValue.h; sourceTree = "<group>"; }; B396EA5512E0ED2D00F4FEB7 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; }; + B878B613133428DC006888E9 /* CorrectionPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorrectionPanel.h; sourceTree = "<group>"; }; + B878B614133428DC006888E9 /* CorrectionPanel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CorrectionPanel.mm; sourceTree = "<group>"; }; BC0092F5115837A300E0AE2A /* RunLoopMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RunLoopMac.mm; sourceTree = "<group>"; }; BC0092F6115837A300E0AE2A /* WorkQueueMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkQueueMac.cpp; sourceTree = "<group>"; }; BC032D6010F4378D0058C15A /* WebChromeClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebChromeClient.h; sourceTree = "<group>"; }; @@ -1257,6 +1337,8 @@ BC111B4C112F619200337BAB /* PageClientImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageClientImpl.mm; sourceTree = "<group>"; }; BC111B5B112F629800337BAB /* WebEventFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebEventFactory.h; sourceTree = "<group>"; }; BC111B5C112F629800337BAB /* WebEventFactory.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEventFactory.mm; sourceTree = "<group>"; }; + BC122FA3132707F300F7EAC1 /* PluginProcess.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = PluginProcess.xcconfig; sourceTree = "<group>"; }; + BC122FA61327087400F7EAC1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = PluginProcess/Info.plist; sourceTree = "<group>"; }; BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreIPCMessageKinds.h; sourceTree = "<group>"; }; BC14DF75120B5B7900826C0C /* InjectedBundleScriptWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleScriptWorld.h; sourceTree = "<group>"; }; BC14DF76120B5B7900826C0C /* InjectedBundleScriptWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleScriptWorld.cpp; sourceTree = "<group>"; }; @@ -1513,6 +1595,7 @@ BCDDB32C124EC2E10048D13C /* WKAPICast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKAPICast.h; sourceTree = "<group>"; }; BCDE059911CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextInjectedBundleClient.h; sourceTree = "<group>"; }; BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextInjectedBundleClient.cpp; sourceTree = "<group>"; }; + BCDE094213272496001259FB /* PluginProcess.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PluginProcess.app; sourceTree = BUILT_PRODUCTS_DIR; }; BCE2315B122C30CA00D5C35A /* WebURLRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebURLRequest.h; sourceTree = "<group>"; }; BCE2315C122C30CA00D5C35A /* WebURLRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebURLRequest.cpp; sourceTree = "<group>"; }; BCE231C0122C466E00D5C35A /* WebURLRequestMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebURLRequestMac.mm; sourceTree = "<group>"; }; @@ -1557,6 +1640,8 @@ BCF69FA11176D01400471A52 /* WebNavigationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNavigationData.cpp; sourceTree = "<group>"; }; BCF69FA71176D1CB00471A52 /* WKNavigationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationData.h; sourceTree = "<group>"; }; BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNavigationData.cpp; sourceTree = "<group>"; }; + BCFD5489132D82680055D816 /* WKErrorCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKErrorCF.cpp; sourceTree = "<group>"; }; + BCFD548A132D82680055D816 /* WKErrorCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKErrorCF.h; sourceTree = "<group>"; }; BFA6179E12F0B99D0033E0CA /* WKViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKViewPrivate.h; sourceTree = "<group>"; }; C01A260012662F2100C9ED55 /* ShareableBitmapCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShareableBitmapCG.cpp; sourceTree = "<group>"; }; C02BFF1512514FD8009CCBEA /* NativeWebKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebKeyboardEvent.h; sourceTree = "<group>"; }; @@ -1567,9 +1652,12 @@ C0337DD2127A2A0E008FF4F4 /* WebKeyboardEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKeyboardEvent.cpp; sourceTree = "<group>"; }; C0337DD7127A51B6008FF4F4 /* WebTouchEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebTouchEvent.cpp; sourceTree = "<group>"; }; C0337DDC127A521C008FF4F4 /* WebPlatformTouchPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPlatformTouchPoint.cpp; sourceTree = "<group>"; }; + C03A136B133BEBF900D767D1 /* LayerTreeHostCAMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LayerTreeHostCAMac.mm; sourceTree = "<group>"; }; C06C6093124C14430001682F /* WebPageCreationParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageCreationParameters.cpp; sourceTree = "<group>"; }; C06C6094124C14430001682F /* WebPageCreationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageCreationParameters.h; sourceTree = "<group>"; }; C08FDE87124A851C007645BD /* messages_unittest.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = messages_unittest.py; sourceTree = "<group>"; }; + C098A053133BE1C500B199A4 /* LayerTreeHostCA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeHostCA.h; sourceTree = "<group>"; }; + C098A054133BE1C500B199A4 /* LayerTreeHostCA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LayerTreeHostCA.cpp; sourceTree = "<group>"; }; C09AE5E8125257C20025825D /* WKNativeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNativeEvent.h; sourceTree = "<group>"; }; C0CE72581247E4DA00BC0EC4 /* WebPage.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebPage.messages.in; sourceTree = "<group>"; }; C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageMessageReceiver.cpp; sourceTree = "<group>"; }; @@ -1588,6 +1676,22 @@ C554FFA212E4E8EA002F22C0 /* WebDragClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDragClientMac.mm; sourceTree = "<group>"; }; C574A57F12E66681002DFE98 /* PasteboardTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteboardTypes.h; sourceTree = "<group>"; }; C574A58012E66681002DFE98 /* PasteboardTypes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardTypes.mm; sourceTree = "<group>"; }; + CD73BA37131A29FE00EEDED2 /* WebFullScreenManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebFullScreenManager.cpp; path = FullScreen/WebFullScreenManager.cpp; sourceTree = "<group>"; }; + CD73BA38131A29FE00EEDED2 /* WebFullScreenManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebFullScreenManager.h; path = FullScreen/WebFullScreenManager.h; sourceTree = "<group>"; }; + CD73BA39131A29FE00EEDED2 /* WebFullScreenManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebFullScreenManager.messages.in; path = FullScreen/WebFullScreenManager.messages.in; sourceTree = "<group>"; }; + CD73BA3E131A2E8A00EEDED2 /* WebFullScreenManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFullScreenManagerProxy.cpp; sourceTree = "<group>"; }; + CD73BA3F131A2E8A00EEDED2 /* WebFullScreenManagerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFullScreenManagerProxy.h; sourceTree = "<group>"; }; + CD73BA40131A2E8A00EEDED2 /* WebFullScreenManagerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebFullScreenManagerProxy.messages.in; sourceTree = "<group>"; }; + CD73BA45131ACC8800EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFullScreenManagerProxyMessageReceiver.cpp; sourceTree = "<group>"; }; + CD73BA48131ACD8E00EEDED2 /* WebFullScreenManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFullScreenManagerMessageReceiver.cpp; sourceTree = "<group>"; }; + CD73BA49131ACD8E00EEDED2 /* WebFullScreenManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFullScreenManagerMessages.h; sourceTree = "<group>"; }; + CD73BA4A131ACD8F00EEDED2 /* WebFullScreenManagerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFullScreenManagerProxyMessages.h; sourceTree = "<group>"; }; + CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKFullScreenWindowController.mm; sourceTree = "<group>"; }; + CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFullScreenWindowController.h; sourceTree = "<group>"; }; + CDCA85D4132AC2B300E961DF /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; }; + CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFullScreenManagerProxyMac.mm; sourceTree = "<group>"; }; + CDCA85E5132AD33000E961DF /* WebFullScreenManagerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFullScreenManagerMac.h; sourceTree = "<group>"; }; + CDCA85E6132AD33000E961DF /* WebFullScreenManagerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFullScreenManagerMac.mm; sourceTree = "<group>"; }; D3B9484211FF4B6500032B39 /* WebPopupMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPopupMenu.cpp; sourceTree = "<group>"; }; D3B9484311FF4B6500032B39 /* WebPopupMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPopupMenu.h; sourceTree = "<group>"; }; D3B9484411FF4B6500032B39 /* WebSearchPopupMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSearchPopupMenu.cpp; sourceTree = "<group>"; }; @@ -1617,9 +1721,13 @@ F634445512A885C8000612D8 /* WebSecurityOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOrigin.h; sourceTree = "<group>"; }; F634445A12A885E9000612D8 /* WKSecurityOrigin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKSecurityOrigin.cpp; sourceTree = "<group>"; }; F634445B12A885E9000612D8 /* WKSecurityOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKSecurityOrigin.h; sourceTree = "<group>"; }; + F638954F133BEF38008941D5 /* HTTPCookieAcceptPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPCookieAcceptPolicy.h; sourceTree = "<group>"; }; F67DD7B9125E40D9007BDCB8 /* WKSerializedScriptValuePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKSerializedScriptValuePrivate.h; sourceTree = "<group>"; }; + F6A0C13F13281E6E0070430F /* ResourceCachesToClear.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceCachesToClear.h; sourceTree = "<group>"; }; F6A25FDA12ADC6CC00DC40CC /* WebDatabaseManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebDatabaseManager.cpp; sourceTree = "<group>"; }; F6A25FDB12ADC6CC00DC40CC /* WebDatabaseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseManager.h; sourceTree = "<group>"; }; + F6A90811133C1F3D0082C3F4 /* WebCookieManagerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCookieManagerMac.mm; sourceTree = "<group>"; }; + F6D632BA133D181B00743D77 /* WebCookieManagerProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCookieManagerProxyMac.mm; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1627,7 +1735,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1A3979F61332983A00E00300 /* AppKit.framework in Frameworks */, 1AA479B012A5A436008236C3 /* Carbon.framework in Frameworks */, + 1A3979F71332983F00E00300 /* QuartzCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1644,6 +1754,7 @@ 1AA1CC5D100FA1A10078DEBC /* QuartzCore.framework in Frameworks */, 1A1C4EC810D06099005E67E7 /* WebCore.framework in Frameworks */, BCF5068512431861005955AE /* Security.framework in Frameworks */, + CDCA85D5132AC2B300E961DF /* IOKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1656,6 +1767,7 @@ 8DC2EF5B0486A6940098B216 /* WebKit2.framework */, 1A50DB1E110A3BDC000D3FE5 /* WebProcess.app */, 1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */, + BCDE094213272496001259FB /* PluginProcess.app */, ); name = Products; sourceTree = "<group>"; @@ -1697,6 +1809,7 @@ 089C1665FE841158C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( + BC122FA51327085D00F7EAC1 /* PluginProcess */, BC8A500E11765AD400757573 /* WebKit2 */, BC8A500F11765AE300757573 /* WebProcess */, 6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */, @@ -1715,6 +1828,7 @@ 1AA1CD06100FA1BA0078DEBC /* Carbon.framework */, 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */, BCD0042C110C1E27003B8A67 /* CoreServices.framework */, + CDCA85D4132AC2B300E961DF /* IOKit.framework */, 1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */, BC87DFA91018101400564216 /* libicucore.dylib */, 1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */, @@ -1757,7 +1871,7 @@ 1A2D91A51281D739001EB962 /* PluginControllerProxyMac.mm */, 1A0EC802124BD41E007EF4A5 /* PluginProcessMainMac.mm */, 1AA4792212A59FD9008236C3 /* PluginProcessMac.mm */, - 1AC25F8A12A48E0300BD2671 /* PluginProcessShim.cpp */, + 1AC25F8A12A48E0300BD2671 /* PluginProcessShim.mm */, 1AC25F8912A48E0300BD2671 /* PluginProcessShim.h */, ); path = mac; @@ -1788,6 +1902,7 @@ 5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */, 1A4F976B100E7B6600637A18 /* DebugRelease.xcconfig */, 1A4F976C100E7B6600637A18 /* FeatureDefines.xcconfig */, + BC122FA3132707F300F7EAC1 /* PluginProcess.xcconfig */, 1AC25FBB12A48EDA00BD2671 /* PluginProcessShim.xcconfig */, 1A4F976E100E7B6600637A18 /* Version.xcconfig */, BCB86F4B116AAACD00CE20B7 /* WebKit2.xcconfig */, @@ -1885,6 +2000,7 @@ 1A7E814E1152D2240003695B /* mac */ = { isa = PBXGroup; children = ( + 5160BFE013381DF900918999 /* Logging.mac.mm */, 1A24B5F011F531E800C38269 /* MachUtilities.cpp */, 1A24B5F111F531E800C38269 /* MachUtilities.h */, C0E3AA481209E45000A49D01 /* ModuleMac.mm */, @@ -1925,6 +2041,7 @@ C517388012DF8F4F00EE3F47 /* DragControllerAction.h */, 0FB659221208B4DB0044816C /* DrawingAreaInfo.h */, 762B7481120BBA0100819339 /* FontSmoothingLevel.h */, + F638954F133BEF38008941D5 /* HTTPCookieAcceptPolicy.h */, BCCF6B2312C93E7A008F9C35 /* ImageOptions.h */, BC64696D11DBE603006455B0 /* ImmutableArray.cpp */, BC64696E11DBE603006455B0 /* ImmutableArray.h */, @@ -1944,6 +2061,7 @@ E1CC1B8E12D7EADF00625838 /* PrintInfo.h */, BCE81D8A1319F7EF00241910 /* FontInfo.cpp */, BCE81D8B1319F7EF00241910 /* FontInfo.h */, + F6A0C13F13281E6E0070430F /* ResourceCachesToClear.h */, BC2D021612AC41CB00E732A3 /* SameDocumentNavigationType.h */, 1AAB4A8C1296F0A20023952F /* SandboxExtension.h */, 33152973130D0CB200ED2483 /* SecurityOriginData.cpp */, @@ -2128,6 +2246,7 @@ 3309344B1315B93A0097A7BC /* Cookies */ = { isa = PBXGroup; children = ( + F638955A133BF57D008941D5 /* mac */, 3309344C1315B94D0097A7BC /* WebCookieManager.cpp */, 3309344D1315B94D0097A7BC /* WebCookieManager.h */, 3309344E1315B94D0097A7BC /* WebCookieManager.messages.in */, @@ -2146,6 +2265,16 @@ name = ResourceCache; sourceTree = "<group>"; }; + 33D3A3BD1339609800709BE4 /* MediaCache */ = { + isa = PBXGroup; + children = ( + 33D3A3BE133960B000709BE4 /* WebMediaCacheManager.cpp */, + 33D3A3BF133960B000709BE4 /* WebMediaCacheManager.h */, + 33D3A3C0133960B000709BE4 /* WebMediaCacheManager.messages.in */, + ); + name = MediaCache; + sourceTree = "<group>"; + }; 33F9D5B71312F1B1000D683F /* cf */ = { isa = PBXGroup; children = ( @@ -2154,6 +2283,15 @@ name = cf; sourceTree = "<group>"; }; + 5123CF18133D25E60056F800 /* cg */ = { + isa = PBXGroup; + children = ( + 5123CF19133D260A0056F800 /* WKIconDatabaseCG.cpp */, + 5123CF1A133D260A0056F800 /* WKIconDatabaseCG.h */, + ); + name = cg; + sourceTree = "<group>"; + }; 512E352A130B559900ABD19A /* ApplicationCache */ = { isa = PBXGroup; children = ( @@ -2209,17 +2347,30 @@ name = cf; sourceTree = "<group>"; }; + 51FBB9C1132E079200F327B4 /* IconDatabase */ = { + isa = PBXGroup; + children = ( + 511B24A4132E095700065A0C /* WebIconDatabaseProxy.cpp */, + 511B24A5132E095700065A0C /* WebIconDatabaseProxy.h */, + 51D02F65132EC6D300BEAA96 /* WebIconDatabaseProxy.messages.in */, + ); + name = IconDatabase; + sourceTree = "<group>"; + }; BC032D5C10F436D50058C15A /* WebProcess */ = { isa = PBXGroup; children = ( + CD73BA3D131A2A2100EEDED2 /* FullScreen */, 512E352A130B559900ABD19A /* ApplicationCache */, 512F588612A8834700629530 /* Authentication */, 3309344B1315B93A0097A7BC /* Cookies */, 1A61614C127798B5003ACD86 /* Downloads */, BC0E5FCB12D696DD0012A72A /* Geolocation */, + 51FBB9C1132E079200F327B4 /* IconDatabase */, BC204EDF11C83E72008F3375 /* InjectedBundle */, 51A9E0FB1315CC0E009E7031 /* KeyValueStorage */, 1A6FA01C11E1526300DB1371 /* mac */, + 33D3A3BD1339609800709BE4 /* MediaCache */, 1A6FB7AA11E64B4900DB1371 /* Plugins */, 3336762B130C9978006C9DE2 /* ResourceCache */, BC032D5D10F437220058C15A /* WebCoreSupport */, @@ -2272,6 +2423,7 @@ BC032D5E10F4372B0058C15A /* WebPage */ = { isa = PBXGroup; children = ( + C098A052133BE1C500B199A4 /* ca */, BC963D6C113DD19500574BE2 /* mac */, BC5F7BB21182376C0052C02C /* ChunkedUpdateDrawingArea.cpp */, BC5F7BB31182376C0052C02C /* ChunkedUpdateDrawingArea.h */, @@ -2384,6 +2536,9 @@ BCB9F69E1123A84B00A137E0 /* WebFramePolicyListenerProxy.h */, BC111B0A112F5E4F00337BAB /* WebFrameProxy.cpp */, BC9B389F10F538BE00443A15 /* WebFrameProxy.h */, + CD73BA3E131A2E8A00EEDED2 /* WebFullScreenManagerProxy.cpp */, + CD73BA3F131A2E8A00EEDED2 /* WebFullScreenManagerProxy.h */, + CD73BA40131A2E8A00EEDED2 /* WebFullScreenManagerProxy.messages.in */, BC54CACA12D64291005C67B0 /* WebGeolocationManagerProxy.cpp */, BC54CAC912D64291005C67B0 /* WebGeolocationManagerProxy.h */, BC0E615212D6CAC80012A72A /* WebGeolocationManagerProxy.messages.in */, @@ -2391,6 +2546,9 @@ BC1BE1F012D54DBD0004A228 /* WebGeolocationProvider.h */, BCF69F841176CD6F00471A52 /* WebHistoryClient.cpp */, BCF69F851176CD6F00471A52 /* WebHistoryClient.h */, + 511B24A8132E097200065A0C /* WebIconDatabase.cpp */, + 511B24A9132E097200065A0C /* WebIconDatabase.h */, + 5184BC4A132E907A006B9E28 /* WebIconDatabase.messages.in */, 1C8E28331275D73800BC7BD0 /* WebInspectorProxy.cpp */, 1C8E28321275D73800BC7BD0 /* WebInspectorProxy.h */, 1C77C1951288A872006A742F /* WebInspectorProxy.messages.in */, @@ -2399,6 +2557,9 @@ 51A9E1041315CCFC009E7031 /* WebKeyValueStorageManagerProxy.messages.in */, BCB9E76111232B9E00A137E0 /* WebLoaderClient.cpp */, BC59534010FC04520098F82D /* WebLoaderClient.h */, + 33D3A3B71339606200709BE4 /* WebMediaCacheManagerProxy.cpp */, + 33D3A3B81339606200709BE4 /* WebMediaCacheManagerProxy.h */, + 33D3A3B91339606200709BE4 /* WebMediaCacheManagerProxy.messages.in */, BCF69FA11176D01400471A52 /* WebNavigationData.cpp */, BCF69FA01176D01400471A52 /* WebNavigationData.h */, BC1DFEA312B31F87005DF730 /* WebOpenPanelResultListenerProxy.cpp */, @@ -2444,6 +2605,7 @@ BC0C376610F807660076D7CB /* C */ = { isa = PBXGroup; children = ( + 5123CF18133D25E60056F800 /* cg */, BCB63477116BF10600603215 /* WebKit2.h */, BCDDB32C124EC2E10048D13C /* WKAPICast.h */, 517A33B3130B308C00F80CB5 /* WKApplicationCacheManager.cpp */, @@ -2480,10 +2642,14 @@ BC06F44C12DBDF3F002D78DE /* WKGeolocationPermissionRequest.h */, BC0E619712D6CD120012A72A /* WKGeolocationPosition.cpp */, BC0E619612D6CD120012A72A /* WKGeolocationPosition.h */, + 5110AE0A133C16CB0072717A /* WKIconDatabase.cpp */, + 5110AE0B133C16CB0072717A /* WKIconDatabase.h */, 1C8E293812761E5B00BC7BD0 /* WKInspector.cpp */, 1C8E293712761E5B00BC7BD0 /* WKInspector.h */, 51A9E1081315CD18009E7031 /* WKKeyValueStorageManager.cpp */, 51A9E1091315CD18009E7031 /* WKKeyValueStorageManager.h */, + 33D3A3B31339600B00709BE4 /* WKMediaCacheManager.cpp */, + 33D3A3B41339600B00709BE4 /* WKMediaCacheManager.h */, C09AE5E8125257C20025825D /* WKNativeEvent.h */, BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */, BCF69FA71176D1CB00471A52 /* WKNavigationData.h */, @@ -2620,6 +2786,14 @@ path = CoreIPCSupport; sourceTree = "<group>"; }; + BC122FA51327085D00F7EAC1 /* PluginProcess */ = { + isa = PBXGroup; + children = ( + BC122FA61327087400F7EAC1 /* Info.plist */, + ); + name = PluginProcess; + sourceTree = "<group>"; + }; BC204EDF11C83E72008F3375 /* InjectedBundle */ = { isa = PBXGroup; children = ( @@ -2742,6 +2916,8 @@ BC4075D5124FEFFA0068F20A /* cf */ = { isa = PBXGroup; children = ( + BCFD5489132D82680055D816 /* WKErrorCF.cpp */, + BCFD548A132D82680055D816 /* WKErrorCF.h */, BC407611124FF0370068F20A /* WKStringCF.cpp */, BC407612124FF0370068F20A /* WKStringCF.h */, BC407613124FF0370068F20A /* WKURLCF.cpp */, @@ -2804,8 +2980,6 @@ 29CD55A8128E294F00133C85 /* AccessibilityWebPageObject.h */, 29CD55A9128E294F00133C85 /* AccessibilityWebPageObject.mm */, BC5F7BB8118237990052C02C /* ChunkedUpdateDrawingAreaMac.cpp */, - 1A690D1612F39E3300ECD289 /* LayerTreeHostMac.h */, - 1A18718412EF9877008E5F37 /* LayerTreeHostMac.mm */, 1C8E2DAD1278C5B200BC7BD0 /* WebInspectorMac.mm */, BC963D6D113DD1A500574BE2 /* WebPageMac.mm */, ); @@ -2824,17 +2998,23 @@ BCCF085C113F3B7500C650C5 /* mac */ = { isa = PBXGroup; children = ( + F6D632BA133D181B00743D77 /* WebCookieManagerProxyMac.mm */, 1A64292C12DE5F9800CAAE2C /* BackingStoreMac.mm */, BC2651F511825EF800243E12 /* ChunkedUpdateDrawingAreaProxyMac.mm */, + B878B613133428DC006888E9 /* CorrectionPanel.h */, + B878B614133428DC006888E9 /* CorrectionPanel.mm */, 1AA417ED12C00D87002BE67B /* TextCheckerMac.mm */, 1A1C648611F415B700553C19 /* WebContextMac.mm */, 51ACBB9E127A8F2C00D203B9 /* WebContextMenuProxyMac.h */, 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */, + CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */, 1CA8B935127C774E00576C2B /* WebInspectorProxyMac.mm */, BC857E8512B71EBB00EDEB2E /* WebPageProxyMac.mm */, BC5750951268F3C6006F0F12 /* WebPopupMenuProxyMac.h */, BC5750961268F3C6006F0F12 /* WebPopupMenuProxyMac.mm */, BC84EB1712A7100C0083F2DA /* WebPreferencesMac.mm */, + CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */, + CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */, ); path = mac; sourceTree = "<group>"; @@ -2925,6 +3105,24 @@ path = cg; sourceTree = "<group>"; }; + C03A136A133BEBF900D767D1 /* mac */ = { + isa = PBXGroup; + children = ( + C03A136B133BEBF900D767D1 /* LayerTreeHostCAMac.mm */, + ); + path = mac; + sourceTree = "<group>"; + }; + C098A052133BE1C500B199A4 /* ca */ = { + isa = PBXGroup; + children = ( + C03A136A133BEBF900D767D1 /* mac */, + C098A053133BE1C500B199A4 /* LayerTreeHostCA.h */, + C098A054133BE1C500B199A4 /* LayerTreeHostCA.cpp */, + ); + path = ca; + sourceTree = "<group>"; + }; C0CE729D1247E71D00BC0EC4 /* Derived Sources */ = { isa = PBXGroup; children = ( @@ -2960,10 +3158,18 @@ F62A76B312B1B25F0005F1B6 /* WebDatabaseManagerMessages.h */, F62A76B412B1B25F0005F1B6 /* WebDatabaseManagerProxyMessageReceiver.cpp */, F62A76B512B1B25F0005F1B6 /* WebDatabaseManagerProxyMessages.h */, + CD73BA48131ACD8E00EEDED2 /* WebFullScreenManagerMessageReceiver.cpp */, + CD73BA49131ACD8E00EEDED2 /* WebFullScreenManagerMessages.h */, + CD73BA4A131ACD8F00EEDED2 /* WebFullScreenManagerProxyMessages.h */, + CD73BA45131ACC8800EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp */, BC0E605F12D6BA910012A72A /* WebGeolocationManagerMessageReceiver.cpp */, BC0E606012D6BA910012A72A /* WebGeolocationManagerMessages.h */, BC0E618012D6CB1D0012A72A /* WebGeolocationManagerProxyMessageReceiver.cpp */, BC0E618112D6CB1D0012A72A /* WebGeolocationManagerProxyMessages.h */, + 51D02F63132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp */, + 51D02F67132EC73700BEAA96 /* WebIconDatabaseMessages.h */, + 51D02F68132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp */, + 51D02F69132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h */, 1C8E2A311277852400BC7BD0 /* WebInspectorMessageReceiver.cpp */, 1C8E2A321277852400BC7BD0 /* WebInspectorMessages.h */, 1CA8B943127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp */, @@ -2972,6 +3178,10 @@ 51A9E1251315ED35009E7031 /* WebKeyValueStorageManagerMessages.h */, 51A9E1261315ED35009E7031 /* WebKeyValueStorageManagerProxyMessageReceiver.cpp */, 51A9E1271315ED35009E7031 /* WebKeyValueStorageManagerProxyMessages.h */, + 33D3A3C41339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp */, + 33D3A3C51339617900709BE4 /* WebMediaCacheManagerMessages.h */, + 33D3A3C61339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp */, + 33D3A3C71339617900709BE4 /* WebMediaCacheManagerProxyMessages.h */, C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */, C0CE729F1247E71D00BC0EC4 /* WebPageMessages.h */, BCBD3912125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp */, @@ -3015,6 +3225,36 @@ path = webkit2; sourceTree = "<group>"; }; + CD73BA3D131A2A2100EEDED2 /* FullScreen */ = { + isa = PBXGroup; + children = ( + CDCA85E4132AD33000E961DF /* mac */, + CD73BA37131A29FE00EEDED2 /* WebFullScreenManager.cpp */, + CD73BA38131A29FE00EEDED2 /* WebFullScreenManager.h */, + CD73BA39131A29FE00EEDED2 /* WebFullScreenManager.messages.in */, + ); + name = FullScreen; + sourceTree = "<group>"; + }; + CDCA85E4132AD33000E961DF /* mac */ = { + isa = PBXGroup; + children = ( + CDCA85E5132AD33000E961DF /* WebFullScreenManagerMac.h */, + CDCA85E6132AD33000E961DF /* WebFullScreenManagerMac.mm */, + ); + name = mac; + path = FullScreen/mac; + sourceTree = "<group>"; + }; + F638955A133BF57D008941D5 /* mac */ = { + isa = PBXGroup; + children = ( + F6A90811133C1F3D0082C3F4 /* WebCookieManagerMac.mm */, + ); + name = mac; + path = Cookies/mac; + sourceTree = "<group>"; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -3362,7 +3602,6 @@ BFA6179F12F0B99D0033E0CA /* WKViewPrivate.h in Headers */, 1A9636BD12F348490078A062 /* ShareableSurface.h in Headers */, 1A9639F712F38ECD0078A062 /* CoreAnimationRenderer.h in Headers */, - 1A690D1712F39E3300ECD289 /* LayerTreeHostMac.h in Headers */, BC8147A912F64CDA007B2C32 /* InjectedBundlePagePolicyClient.h in Headers */, BC8147D512F66D31007B2C32 /* InjectedBundleNavigationAction.h in Headers */, BC7043CC12F75EE0006472B9 /* WKBundleNavigationAction.h in Headers */, @@ -3397,6 +3636,21 @@ 37C4E9F6131C6E7E0029BD5A /* config.h in Headers */, E1BB16A413201B9B00F49431 /* FullKeyboardAccessWatcher.h in Headers */, 33AA1067131F060000D4A575 /* WebCookieManagerProxyClient.h in Headers */, + CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */, + BCFD548C132D82680055D816 /* WKErrorCF.h in Headers */, + 511B24A7132E095700065A0C /* WebIconDatabaseProxy.h in Headers */, + 511B24AB132E097200065A0C /* WebIconDatabase.h in Headers */, + 51D02F6A132EC73700BEAA96 /* WebIconDatabaseMessages.h in Headers */, + 51D02F6C132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h in Headers */, + B878B615133428DC006888E9 /* CorrectionPanel.h in Headers */, + 33D3A3B61339600B00709BE4 /* WKMediaCacheManager.h in Headers */, + 33D3A3BB1339606200709BE4 /* WebMediaCacheManagerProxy.h in Headers */, + 33D3A3C2133960B000709BE4 /* WebMediaCacheManager.h in Headers */, + 33D3A3C91339617900709BE4 /* WebMediaCacheManagerMessages.h in Headers */, + 33D3A3CB1339617900709BE4 /* WebMediaCacheManagerProxyMessages.h in Headers */, + C064504A133BE709003470E2 /* LayerTreeHostCA.h in Headers */, + 5110AE0D133C16CB0072717A /* WKIconDatabase.h in Headers */, + 5123CF1C133D260A0056F800 /* WKIconDatabaseCG.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3409,12 +3663,10 @@ buildPhases = ( 1A50DB1A110A3BDC000D3FE5 /* Resources */, 1A50DB1B110A3BDC000D3FE5 /* Sources */, - 1AC25FDD12A4904500BD2671 /* Copy Plug-in Process Shim */, ); buildRules = ( ); dependencies = ( - 1AC25FD812A48FD500BD2671 /* PBXTargetDependency */, 1A50DB27110A3BEF000D3FE5 /* PBXTargetDependency */, ); name = WebProcess; @@ -3464,6 +3716,25 @@ productReference = 8DC2EF5B0486A6940098B216 /* WebKit2.framework */; productType = "com.apple.product-type.framework"; }; + BCDE093313272496001259FB /* PluginProcess */ = { + isa = PBXNativeTarget; + buildConfigurationList = BCDE093E13272496001259FB /* Build configuration list for PBXNativeTarget "PluginProcess" */; + buildPhases = ( + BCDE093813272496001259FB /* Resources */, + BCDE093A13272496001259FB /* Sources */, + BCDE093C13272496001259FB /* Copy Plug-in Process Shim */, + ); + buildRules = ( + ); + dependencies = ( + BCDE093413272496001259FB /* PBXTargetDependency */, + BCDE093613272496001259FB /* PBXTargetDependency */, + ); + name = PluginProcess; + productName = WebProcess; + productReference = BCDE094213272496001259FB /* PluginProcess.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -3487,6 +3758,7 @@ 1A50DB38110A3C13000D3FE5 /* All */, 8DC2EF4F0486A6940098B216 /* WebKit2 */, 1A50DB1D110A3BDC000D3FE5 /* WebProcess */, + BCDE093313272496001259FB /* PluginProcess */, C0CE72851247E66800BC0EC4 /* Derived Sources */, 1AC25FAF12A48EA700BD2671 /* PluginProcessShim */, ); @@ -3510,6 +3782,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BCDE093813272496001259FB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -3608,10 +3887,6 @@ buildActionMask = 2147483647; files = ( 1A6FA31111E3921E00DB1371 /* MainMac.cpp in Sources */, - 1A1FA285127A13BC0050E709 /* NPObjectProxy.cpp in Sources */, - 1A1FA35D127A45BF0050E709 /* NPObjectMessageReceiver.cpp in Sources */, - E18C92F512DB9E7A00CF2AEB /* PrintInfo.cpp in Sources */, - E18C92F612DB9E9400CF2AEB /* PrintInfoMac.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3619,7 +3894,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1AC25FC212A48F6000BD2671 /* PluginProcessShim.cpp in Sources */, + 1AC25FC212A48F6000BD2671 /* PluginProcessShim.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3934,7 +4209,6 @@ E134F01A12EA5D99004EC58D /* WKPrintingView.mm in Sources */, BC9585C812F095B800755821 /* WebGestureEvent.cpp in Sources */, 1A186EEB12EF7618008E5F37 /* LayerTreeHost.cpp in Sources */, - 1A18718512EF9877008E5F37 /* LayerTreeHostMac.mm in Sources */, 6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */, 1A9636BC12F348490078A062 /* ShareableSurface.cpp in Sources */, 1A9639F812F38ECD0078A062 /* CoreAnimationRenderer.mm in Sources */, @@ -3976,6 +4250,39 @@ BCE81D98131AE02100241910 /* DictionaryPopupInfo.cpp in Sources */, E1BB16A513201B9B00F49431 /* FullKeyboardAccessWatcher.mm in Sources */, 33AA1066131F060000D4A575 /* WebCookieManagerProxyClient.cpp in Sources */, + CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */, + CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */, + CD73BA53131B645B00EEDED2 /* WebFullScreenManager.cpp in Sources */, + CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */, + CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */, + CDCA85EE132AD70100E961DF /* WebFullScreenManagerProxyMac.mm in Sources */, + CDCA8603132ADC0500E961DF /* WebFullScreenManagerMac.mm in Sources */, + BCFD548B132D82680055D816 /* WKErrorCF.cpp in Sources */, + 511B24A6132E095700065A0C /* WebIconDatabaseProxy.cpp in Sources */, + 511B24AA132E097200065A0C /* WebIconDatabase.cpp in Sources */, + 51D02F64132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp in Sources */, + 51D02F6B132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp in Sources */, + B878B616133428DC006888E9 /* CorrectionPanel.mm in Sources */, + 33D3A3B51339600B00709BE4 /* WKMediaCacheManager.cpp in Sources */, + 33D3A3BA1339606200709BE4 /* WebMediaCacheManagerProxy.cpp in Sources */, + 33D3A3C1133960B000709BE4 /* WebMediaCacheManager.cpp in Sources */, + 33D3A3C81339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp in Sources */, + 33D3A3CA1339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp in Sources */, + 5160BFE113381DF900918999 /* Logging.mac.mm in Sources */, + C0D74DDE133BE2D90089CD44 /* LayerTreeHostCA.cpp in Sources */, + C03A136C133BEBF900D767D1 /* LayerTreeHostCAMac.mm in Sources */, + 5110AE0C133C16CB0072717A /* WKIconDatabase.cpp in Sources */, + 5123CF1B133D260A0056F800 /* WKIconDatabaseCG.cpp in Sources */, + F6A90813133C20510082C3F4 /* WebCookieManagerMac.mm in Sources */, + F6D632BC133D198200743D77 /* WebCookieManagerProxyMac.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BCDE093A13272496001259FB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BCDE093B13272496001259FB /* MainMac.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3992,16 +4299,26 @@ target = 1A50DB1D110A3BDC000D3FE5 /* WebProcess */; targetProxy = 1A50DB3B110A3C19000D3FE5 /* PBXContainerItemProxy */; }; - 1AC25FD812A48FD500BD2671 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 1AC25FAF12A48EA700BD2671 /* PluginProcessShim */; - targetProxy = 1AC25FD712A48FD500BD2671 /* PBXContainerItemProxy */; - }; 37F7407912721F740093869B /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = C0CE72851247E66800BC0EC4 /* Derived Sources */; targetProxy = 37F7407812721F740093869B /* PBXContainerItemProxy */; }; + BCDE093413272496001259FB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1AC25FAF12A48EA700BD2671 /* PluginProcessShim */; + targetProxy = BCDE093513272496001259FB /* PBXContainerItemProxy */; + }; + BCDE093613272496001259FB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8DC2EF4F0486A6940098B216 /* WebKit2 */; + targetProxy = BCDE093713272496001259FB /* PBXContainerItemProxy */; + }; + BCDE0AC113272712001259FB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BCDE093313272496001259FB /* PluginProcess */; + targetProxy = BCDE0AC013272712001259FB /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -4048,6 +4365,10 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1AC25FBB12A48EDA00BD2671 /* PluginProcessShim.xcconfig */; buildSettings = { + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS)", + "-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)", + ); }; name = Debug; }; @@ -4055,6 +4376,10 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1AC25FBB12A48EDA00BD2671 /* PluginProcessShim.xcconfig */; buildSettings = { + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS)", + "-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)", + ); }; name = Release; }; @@ -4062,6 +4387,10 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1AC25FBB12A48EDA00BD2671 /* PluginProcessShim.xcconfig */; buildSettings = { + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS)", + "-lWebKitSystemInterface", + ); }; name = Production; }; @@ -4137,6 +4466,27 @@ }; name = Production; }; + BCDE093F13272496001259FB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BC122FA3132707F300F7EAC1 /* PluginProcess.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + BCDE094013272496001259FB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BC122FA3132707F300F7EAC1 /* PluginProcess.xcconfig */; + buildSettings = { + }; + name = Release; + }; + BCDE094113272496001259FB /* Production */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BC122FA3132707F300F7EAC1 /* PluginProcess.xcconfig */; + buildSettings = { + }; + name = Production; + }; C0CE72861247E66800BC0EC4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4218,6 +4568,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Production; }; + BCDE093E13272496001259FB /* Build configuration list for PBXNativeTarget "PluginProcess" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BCDE093F13272496001259FB /* Debug */, + BCDE094013272496001259FB /* Release */, + BCDE094113272496001259FB /* Production */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Production; + }; C0CE72891247E68600BC0EC4 /* Build configuration list for PBXAggregateTarget "Derived Sources" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp b/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp index 71ae14f..4f91e3d 100644 --- a/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp +++ b/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp @@ -30,6 +30,7 @@ #include "SecurityOriginData.h" #include "WebApplicationCacheManagerProxyMessages.h" #include "WebProcess.h" +#include <WebCore/ApplicationCache.h> #include <WebCore/ApplicationCacheStorage.h> #include <WebCore/SecurityOrigin.h> #include <WebCore/SecurityOriginHash.h> @@ -78,6 +79,7 @@ void WebApplicationCacheManager::getApplicationCacheOrigins(uint64_t callbackID) } WebProcess::shared().connection()->send(Messages::WebApplicationCacheManagerProxy::DidGetApplicationCacheOrigins(identifiers, callbackID), 0); + WebProcess::shared().terminateIfPossible(); } void WebApplicationCacheManager::deleteEntriesForOrigin(const SecurityOriginData& originData) @@ -87,8 +89,9 @@ void WebApplicationCacheManager::deleteEntriesForOrigin(const SecurityOriginData if (!origin) return; - cacheStorage().deleteEntriesForOrigin(origin.get()); + ApplicationCache::deleteCacheForOrigin(origin.get()); #endif + WebProcess::shared().terminateIfPossible(); } void WebApplicationCacheManager::deleteAllEntries() @@ -96,6 +99,7 @@ void WebApplicationCacheManager::deleteAllEntries() #if ENABLE(OFFLINE_WEB_APPLICATIONS) cacheStorage().deleteAllEntries(); #endif + WebProcess::shared().terminateIfPossible(); } } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp b/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp index af35f75..e7550d0 100644 --- a/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp +++ b/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp @@ -26,6 +26,8 @@ #include "config.h" #include "AuthenticationManager.h" +#include "Download.h" +#include "DownloadProxyMessages.h" #include "MessageID.h" #include "WebCoreArgumentCoders.h" #include "WebFrame.h" @@ -35,6 +37,8 @@ #include <WebCore/AuthenticationChallenge.h> #include <WebCore/AuthenticationClient.h> +using namespace WebCore; + namespace WebKit { static uint64_t generateAuthenticationChallengeID() @@ -58,46 +62,64 @@ void AuthenticationManager::didReceiveMessage(CoreIPC::Connection* connection, C didReceiveAuthenticationManagerMessage(connection, messageID, arguments); } -void AuthenticationManager::didReceiveAuthenticationChallenge(WebFrame* frame, const WebCore::AuthenticationChallenge& authenticationChallenge) +void AuthenticationManager::didReceiveAuthenticationChallenge(WebFrame* frame, const AuthenticationChallenge& authenticationChallenge) { ASSERT(frame); ASSERT(frame->page()); - uint64_t id = generateAuthenticationChallengeID(); - m_challenges.set(id, authenticationChallenge); + uint64_t challengeID = generateAuthenticationChallengeID(); + m_challenges.set(challengeID, authenticationChallenge); - WebProcess::shared().connection()->send(Messages::WebPageProxy::DidReceiveAuthenticationChallenge(frame->frameID(), authenticationChallenge, id), frame->page()->pageID()); + WebProcess::shared().connection()->send(Messages::WebPageProxy::DidReceiveAuthenticationChallenge(frame->frameID(), authenticationChallenge, challengeID), frame->page()->pageID()); +} + +void AuthenticationManager::didReceiveAuthenticationChallenge(Download* download, const AuthenticationChallenge& authenticationChallenge) +{ + uint64_t challengeID = generateAuthenticationChallengeID(); + m_challenges.set(challengeID, authenticationChallenge); + + download->send(Messages::DownloadProxy::DidReceiveAuthenticationChallenge(authenticationChallenge, challengeID)); } -void AuthenticationManager::useCredentialForChallenge(uint64_t challengeID, const WebCore::Credential& credential) +void AuthenticationManager::useCredentialForChallenge(uint64_t challengeID, const Credential& credential) { - WebCore::AuthenticationChallenge challenge = m_challenges.take(challengeID); + AuthenticationChallenge challenge = m_challenges.take(challengeID); ASSERT(!challenge.isNull()); - WebCore::AuthenticationClient* coreClient = challenge.authenticationClient(); - if (!coreClient) + AuthenticationClient* coreClient = challenge.authenticationClient(); + if (!coreClient) { + // This authentication challenge comes from a download. + Download::receivedCredential(challenge, credential); return; + + } coreClient->receivedCredential(challenge, credential); } void AuthenticationManager::continueWithoutCredentialForChallenge(uint64_t challengeID) { - WebCore::AuthenticationChallenge challenge = m_challenges.take(challengeID); + AuthenticationChallenge challenge = m_challenges.take(challengeID); ASSERT(!challenge.isNull()); - WebCore::AuthenticationClient* coreClient = challenge.authenticationClient(); - if (!coreClient) + AuthenticationClient* coreClient = challenge.authenticationClient(); + if (!coreClient) { + // This authentication challenge comes from a download. + Download::receivedRequestToContinueWithoutCredential(challenge); return; + } coreClient->receivedRequestToContinueWithoutCredential(challenge); } void AuthenticationManager::cancelChallenge(uint64_t challengeID) { - WebCore::AuthenticationChallenge challenge = m_challenges.take(challengeID); + AuthenticationChallenge challenge = m_challenges.take(challengeID); ASSERT(!challenge.isNull()); - WebCore::AuthenticationClient* coreClient = challenge.authenticationClient(); - if (!coreClient) + AuthenticationClient* coreClient = challenge.authenticationClient(); + if (!coreClient) { + // This authentication challenge comes from a download. + Download::receivedCancellation(challenge); return; + } coreClient->receivedCancellation(challenge); } diff --git a/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h b/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h index ce5ff1c..2c67430 100644 --- a/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h +++ b/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h @@ -41,6 +41,7 @@ namespace WebCore { namespace WebKit { +class Download; class WebFrame; class AuthenticationManager { @@ -52,6 +53,7 @@ public: void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); void didReceiveAuthenticationChallenge(WebFrame*, const WebCore::AuthenticationChallenge&); + void didReceiveAuthenticationChallenge(Download*, const WebCore::AuthenticationChallenge&); void useCredentialForChallenge(uint64_t challengeID, const WebCore::Credential&); void continueWithoutCredentialForChallenge(uint64_t challengeID); diff --git a/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp b/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp index 1c88ee2..4181e14 100644 --- a/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp +++ b/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp @@ -62,21 +62,25 @@ void WebCookieManager::getHostnamesWithCookies(uint64_t callbackID) copyToVector(hostnames, hostnameList); WebProcess::shared().connection()->send(Messages::WebCookieManagerProxy::DidGetHostnamesWithCookies(hostnameList, callbackID), 0); + WebProcess::shared().terminateIfPossible(); } void WebCookieManager::deleteCookiesForHostname(const String& hostname) { WebCore::deleteCookiesForHostname(hostname); + WebProcess::shared().terminateIfPossible(); } void WebCookieManager::deleteAllCookies() { WebCore::deleteAllCookies(); + WebProcess::shared().terminateIfPossible(); } void WebCookieManager::startObservingCookieChanges() { WebCore::startObservingCookieChanges(); + WebProcess::shared().terminateIfPossible(); } void WebCookieManager::stopObservingCookieChanges() @@ -89,4 +93,16 @@ void WebCookieManager::dispatchCookiesDidChange() WebProcess::shared().connection()->send(Messages::WebCookieManagerProxy::CookiesDidChange(), 0); } +void WebCookieManager::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy) +{ + platformSetHTTPCookieAcceptPolicy(policy); + WebProcess::shared().terminateIfPossible(); +} + +void WebCookieManager::getHTTPCookieAcceptPolicy(uint64_t callbackID) +{ + WebProcess::shared().connection()->send(Messages::WebCookieManagerProxy::DidGetHTTPCookieAcceptPolicy(platformGetHTTPCookieAcceptPolicy(), callbackID), 0); + WebProcess::shared().terminateIfPossible(); +} + } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h b/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h index 911020c..c0bd1f3 100644 --- a/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h +++ b/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h @@ -26,6 +26,7 @@ #ifndef WebCookieManager_h #define WebCookieManager_h +#include "HTTPCookieAcceptPolicy.h" #include <wtf/Noncopyable.h> #include <wtf/text/WTFString.h> @@ -46,6 +47,8 @@ public: void dispatchCookiesDidChange(); + void setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy); + private: WebCookieManager(); @@ -53,6 +56,10 @@ private: void deleteCookiesForHostname(const String&); void deleteAllCookies(); + void platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy); + void getHTTPCookieAcceptPolicy(uint64_t callbackID); + HTTPCookieAcceptPolicy platformGetHTTPCookieAcceptPolicy(); + void startObservingCookieChanges(); void stopObservingCookieChanges(); diff --git a/Source/WebKit2/WebProcess/Cookies/WebCookieManager.messages.in b/Source/WebKit2/WebProcess/Cookies/WebCookieManager.messages.in index 470facb..15de9b6 100644 --- a/Source/WebKit2/WebProcess/Cookies/WebCookieManager.messages.in +++ b/Source/WebKit2/WebProcess/Cookies/WebCookieManager.messages.in @@ -27,6 +27,9 @@ void GetHostnamesWithCookies(uint64_t callbackID) void DeleteCookiesForHostname(WTF::String hostname) void DeleteAllCookies() + + void SetHTTPCookieAcceptPolicy(uint32_t policy) + void GetHTTPCookieAcceptPolicy(uint64_t callbackID) void StartObservingCookieChanges() void StopObservingCookieChanges() diff --git a/Source/WebKit2/WebProcess/Cookies/cf/WebCookieManagerCFNet.cpp b/Source/WebKit2/WebProcess/Cookies/cf/WebCookieManagerCFNet.cpp new file mode 100644 index 0000000..b0fb3d1 --- /dev/null +++ b/Source/WebKit2/WebProcess/Cookies/cf/WebCookieManagerCFNet.cpp @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebCookieManager.h" + +#include <CFNetwork/CFHTTPCookiesPriv.h> +#include <WebCore/CookieStorage.h> +#include <WebCore/CookieStorageCFNet.h> + +namespace WebKit { + +void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy) +{ + CFHTTPCookieStorageSetCookieAcceptPolicy(WebCore::defaultCookieStorage(), policy); + + CFHTTPCookieStorageRef privateBrowsingCookieStorage = WebCore::privateBrowsingCookieStorage(); + if (!privateBrowsingCookieStorage) + return; + CFHTTPCookieStorageSetCookieAcceptPolicy(privateBrowsingCookieStorage, policy); +} + +HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy() +{ + return CFHTTPCookieStorageGetCookieAcceptPolicy(WebCore::currentCookieStorage()); +} + +} // namespace WebKit diff --git a/Source/WebKit2/WebProcess/Cookies/curl/WebCookieManagerCurl.cpp b/Source/WebKit2/WebProcess/Cookies/curl/WebCookieManagerCurl.cpp new file mode 100644 index 0000000..505082d --- /dev/null +++ b/Source/WebKit2/WebProcess/Cookies/curl/WebCookieManagerCurl.cpp @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * Copyright (C) 2011 Brent Fulgham <bfulgham@webkit.org>. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebCookieManager.h" + +#include <WebCore/CookieStorage.h> +#include <WebCore/NotImplemented.h> + +namespace WebKit { + +void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy) +{ + // Fixme: To be implemented + notImplemented(); +} + +HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy() +{ + notImplemented(); + return HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain; +} + +} // namespace WebKit diff --git a/Source/WebKit2/WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp b/Source/WebKit2/WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp new file mode 100644 index 0000000..acdd608 --- /dev/null +++ b/Source/WebKit2/WebProcess/Cookies/gtk/WebCookieManagerGtk.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebCookieManager.h" + +namespace WebKit { + +void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy) +{ + // FIXME: Not implemented. +} + +HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy() +{ + // FIXME: Not implemented. + return HTTPCookieAcceptPolicyAlways; +} + +} // namespace WebKit diff --git a/Source/WebKit2/WebProcess/Cookies/mac/WebCookieManagerMac.mm b/Source/WebKit2/WebProcess/Cookies/mac/WebCookieManagerMac.mm new file mode 100644 index 0000000..cf73622 --- /dev/null +++ b/Source/WebKit2/WebProcess/Cookies/mac/WebCookieManagerMac.mm @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "config.h" +#import "WebCookieManager.h" + +namespace WebKit { + +void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy) +{ + [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:policy]; + +#if USE(CFURLSTORAGESESSIONS) + // FIXME: Also update the Private Browsing Storage Session's cookie storage. +#endif +} + +HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy() +{ + return [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookieAcceptPolicy]; +} + +} // namespace WebKit diff --git a/Source/WebKit2/WebProcess/Cookies/qt/WebCookieManagerQt.cpp b/Source/WebKit2/WebProcess/Cookies/qt/WebCookieManagerQt.cpp new file mode 100644 index 0000000..acdd608 --- /dev/null +++ b/Source/WebKit2/WebProcess/Cookies/qt/WebCookieManagerQt.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebCookieManager.h" + +namespace WebKit { + +void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy) +{ + // FIXME: Not implemented. +} + +HTTPCookieAcceptPolicy WebCookieManager::platformGetHTTPCookieAcceptPolicy() +{ + // FIXME: Not implemented. + return HTTPCookieAcceptPolicyAlways; +} + +} // namespace WebKit diff --git a/Source/WebKit2/WebProcess/Downloads/Download.cpp b/Source/WebKit2/WebProcess/Downloads/Download.cpp index 1c36df2..3fc87d9 100644 --- a/Source/WebKit2/WebProcess/Downloads/Download.cpp +++ b/Source/WebKit2/WebProcess/Downloads/Download.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "Download.h" +#include "AuthenticationManager.h" #include "Connection.h" #include "DataReference.h" #include "DownloadProxyMessages.h" @@ -68,6 +69,11 @@ void Download::didStart() send(Messages::DownloadProxy::DidStart(m_request)); } +void Download::didReceiveAuthenticationChallenge(const AuthenticationChallenge& authenticationChallenge) +{ + AuthenticationManager::shared().didReceiveAuthenticationChallenge(this, authenticationChallenge); +} + void Download::didReceiveResponse(const ResourceResponse& response) { send(Messages::DownloadProxy::DidReceiveResponse(response)); diff --git a/Source/WebKit2/WebProcess/Downloads/Download.h b/Source/WebKit2/WebProcess/Downloads/Download.h index 26d8f3d..780e8c2 100644 --- a/Source/WebKit2/WebProcess/Downloads/Download.h +++ b/Source/WebKit2/WebProcess/Downloads/Download.h @@ -47,6 +47,8 @@ namespace CoreIPC { } namespace WebCore { + class AuthenticationChallenge; + class Credential; class ResourceError; class ResourceHandle; class ResourceResponse; @@ -74,6 +76,7 @@ public: uint64_t downloadID() const { return m_downloadID; } void didStart(); + void didReceiveAuthenticationChallenge(const WebCore::AuthenticationChallenge&); void didReceiveResponse(const WebCore::ResourceResponse&); void didReceiveData(uint64_t length); bool shouldDecodeSourceDataOfMIMEType(const String& mimeType); @@ -89,6 +92,11 @@ public: const String& destination() const { return m_destination; } #endif + // Authentication + static void receivedCredential(const WebCore::AuthenticationChallenge&, const WebCore::Credential&); + static void receivedRequestToContinueWithoutCredential(const WebCore::AuthenticationChallenge&); + static void receivedCancellation(const WebCore::AuthenticationChallenge&); + private: Download(uint64_t downloadID, const WebCore::ResourceRequest&); @@ -105,10 +113,10 @@ private: RetainPtr<NSURLDownload> m_nsURLDownload; RetainPtr<WKDownloadAsDelegate> m_delegate; #endif -#if USE(CFNETWORK) bool m_allowOverwrite; String m_destination; String m_bundlePath; +#if USE(CFNETWORK) RetainPtr<CFURLDownloadRef> m_download; #endif }; diff --git a/Source/WebKit2/WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp b/Source/WebKit2/WebProcess/Downloads/cf/win/DownloadCFWin.cpp index 0dd6508..0dd6508 100644 --- a/Source/WebKit2/WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp +++ b/Source/WebKit2/WebProcess/Downloads/cf/win/DownloadCFWin.cpp diff --git a/Source/WebKit2/WebProcess/Downloads/cf/DownloadCFNet.cpp b/Source/WebKit2/WebProcess/Downloads/cfnet/DownloadCFNet.cpp index 3215039..170c6aa 100644 --- a/Source/WebKit2/WebProcess/Downloads/cf/DownloadCFNet.cpp +++ b/Source/WebKit2/WebProcess/Downloads/cfnet/DownloadCFNet.cpp @@ -70,6 +70,8 @@ void Download::start(WebPage*) CFURLDownloadScheduleWithCurrentMessageQueue(m_download.get()); CFURLDownloadScheduleDownloadWithRunLoop(m_download.get(), loaderRunLoop(), kCFRunLoopDefaultMode); + + CFURLDownloadStart(m_download.get()); } void Download::startWithHandle(WebPage*, ResourceHandle* handle, const ResourceRequest& initialRequest, const ResourceResponse& response) @@ -206,4 +208,19 @@ void didFailCallback(CFURLDownloadRef, CFErrorRef error, const void* clientInfo) downloadFromClientInfo(clientInfo)->didFail(ResourceError(error), dataReference); } +void Download::receivedCredential(const AuthenticationChallenge& authenticationChallenge, const Credential& credential) +{ + notImplemented(); +} + +void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge& authenticationChallenge) +{ + notImplemented(); +} + +void Download::receivedCancellation(const AuthenticationChallenge& authenticationChallenge) +{ + notImplemented(); +} + } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/Downloads/curl/DownloadCurl.cpp b/Source/WebKit2/WebProcess/Downloads/curl/DownloadCurl.cpp index 6ebce01..0466e7c 100644 --- a/Source/WebKit2/WebProcess/Downloads/curl/DownloadCurl.cpp +++ b/Source/WebKit2/WebProcess/Downloads/curl/DownloadCurl.cpp @@ -58,7 +58,17 @@ void Download::didDecideDestination(const String& destination, bool allowOverwri notImplemented(); } -void Download::platformDidFinish() +void Download::receivedCredential(const AuthenticationChallenge& authenticationChallenge, const Credential& credential) +{ + notImplemented(); +} + +void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge& authenticationChallenge) +{ + notImplemented(); +} + +void Download::receivedCancellation(const AuthenticationChallenge& authenticationChallenge) { notImplemented(); } diff --git a/Source/WebKit2/WebProcess/Downloads/mac/DownloadMac.mm b/Source/WebKit2/WebProcess/Downloads/mac/DownloadMac.mm index f7fe8dc..2d09612 100644 --- a/Source/WebKit2/WebProcess/Downloads/mac/DownloadMac.mm +++ b/Source/WebKit2/WebProcess/Downloads/mac/DownloadMac.mm @@ -26,6 +26,7 @@ #import "config.h" #import "Download.h" +#import <WebCore/AuthenticationMac.h> #import <WebCore/BackForwardController.h> #import <WebCore/HistoryItem.h> #import <WebCore/NotImplemented.h> @@ -177,6 +178,21 @@ void Download::platformDidFinish() { } +void Download::receivedCredential(const AuthenticationChallenge& authenticationChallenge, const Credential& credential) +{ + [authenticationChallenge.sender() useCredential:mac(credential) forAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()]; +} + +void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge& authenticationChallenge) +{ + [authenticationChallenge.sender() continueWithoutCredentialForAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()]; +} + +void Download::receivedCancellation(const AuthenticationChallenge& authenticationChallenge) +{ + [authenticationChallenge.sender() cancelAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()]; +} + } // namespace WebKit @implementation WKDownloadAsDelegate @@ -216,8 +232,8 @@ void Download::platformDidFinish() - (void)download:(NSURLDownload *)download didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { - // FIXME: Implement. - notImplemented(); + if (_download) + _download->didReceiveAuthenticationChallenge(core(challenge)); } - (void)download:(NSURLDownload *)download didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge @@ -228,9 +244,7 @@ void Download::platformDidFinish() - (BOOL)downloadShouldUseCredentialStorage:(NSURLDownload *)download { - // FIXME: Implement. - notImplemented(); - return YES; + return NO; } - (void)download:(NSURLDownload *)download didReceiveResponse:(NSURLResponse *)response diff --git a/Source/WebKit2/WebProcess/Downloads/qt/DownloadQt.cpp b/Source/WebKit2/WebProcess/Downloads/qt/DownloadQt.cpp index 19b86f0..ad5e7de 100644 --- a/Source/WebKit2/WebProcess/Downloads/qt/DownloadQt.cpp +++ b/Source/WebKit2/WebProcess/Downloads/qt/DownloadQt.cpp @@ -62,4 +62,19 @@ void Download::platformDidFinish() notImplemented(); } +void Download::receivedCredential(const AuthenticationChallenge& authenticationChallenge, const Credential& credential) +{ + notImplemented(); +} + +void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge& authenticationChallenge) +{ + notImplemented(); +} + +void Download::receivedCancellation(const AuthenticationChallenge& authenticationChallenge) +{ + notImplemented(); +} + } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp b/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp index f7c9440..a228916 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp +++ b/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp @@ -1,6 +1,6 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved. + * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. + * Copyright (C) 2010 Brent Fulgham <bfulgham@webkit.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,7 +25,7 @@ */ #include "config.h" -#include "NetscapePlugin.h" +#include "Download.h" #include <WebCore/NotImplemented.h> @@ -33,73 +33,49 @@ using namespace WebCore; namespace WebKit { -bool NetscapePlugin::platformPostInitialize() +void Download::start(WebPage* initiatingWebPage) { notImplemented(); - return true; } -void NetscapePlugin::platformDestroy() +void Download::startWithHandle(WebPage* initiatingPage, ResourceHandle*, const ResourceRequest& initialRequest, const ResourceResponse&) { notImplemented(); } -bool NetscapePlugin::platformInvalidate(const IntRect&) +void Download::cancel() { notImplemented(); - return false; } -void NetscapePlugin::platformGeometryDidChange() +void Download::platformInvalidate() { notImplemented(); } -void NetscapePlugin::platformPaint(GraphicsContext* context, const IntRect& dirtyRect, bool) +void Download::didDecideDestination(const String& destination, bool allowOverwrite) { notImplemented(); } -NPEvent toNP(const WebMouseEvent& event) +void Download::platformDidFinish() { - NPEvent npEvent = NPEvent(); notImplemented(); - return npEvent; } -bool NetscapePlugin::platformHandleMouseEvent(const WebMouseEvent& event) +void Download::receivedCredential(const AuthenticationChallenge& authenticationChallenge, const Credential& credential) { notImplemented(); - return true; } -bool NetscapePlugin::platformHandleWheelEvent(const WebWheelEvent&) +void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge& authenticationChallenge) { notImplemented(); - return false; } -void NetscapePlugin::platformSetFocus(bool) +void Download::receivedCancellation(const AuthenticationChallenge& authenticationChallenge) { notImplemented(); } -bool NetscapePlugin::platformHandleMouseEnterEvent(const WebMouseEvent& event) -{ - notImplemented(); - return true; -} - -bool NetscapePlugin::platformHandleMouseLeaveEvent(const WebMouseEvent& event) -{ - notImplemented(); - return true; -} - -bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent&) -{ - notImplemented(); - return false; -} - } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp new file mode 100644 index 0000000..e856876 --- /dev/null +++ b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "config.h" +#include "WebFullScreenManager.h" + +#if ENABLE(FULLSCREEN_API) + +#include "Connection.h" +#include "MessageID.h" +#include "WebCoreArgumentCoders.h" +#include "WebFullScreenManagerProxyMessages.h" +#include "WebPage.h" +#include "WebProcess.h" +#include <WebCore/Color.h> +#include <WebCore/Page.h> +#include <WebCore/Settings.h> + +using namespace WebCore; + +namespace WebKit { + +WebFullScreenManager::WebFullScreenManager(WebPage* page) + : m_page(page) +{ +} + +WebFullScreenManager::~WebFullScreenManager() +{ + +} + +WebCore::Element* WebFullScreenManager::element() +{ + return m_element.get(); +} + +void WebFullScreenManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) +{ + didReceiveWebFullScreenManagerMessage(connection, messageID, arguments); +} + +bool WebFullScreenManager::supportsFullScreen(bool withKeyboard) +{ + if (!m_page->corePage()->settings()->fullScreenEnabled()) + return false; + + bool supports = true; + m_page->sendSync(Messages::WebFullScreenManagerProxy::SupportsFullScreen(withKeyboard), supports); + return supports; +} + +void WebFullScreenManager::enterFullScreenForElement(WebCore::Element* element) +{ + ASSERT(element); + m_element = element; + m_initialFrame = m_element->screenRect(); + m_page->send(Messages::WebFullScreenManagerProxy::EnterFullScreen()); +} + +void WebFullScreenManager::exitFullScreenForElement(WebCore::Element* element) +{ + ASSERT(element); + ASSERT(m_element == element); + m_page->send(Messages::WebFullScreenManagerProxy::ExitFullScreen()); +} + +void WebFullScreenManager::beganEnterFullScreenAnimation() +{ + m_page->send(Messages::WebFullScreenManagerProxy::BeganEnterFullScreenAnimation()); +} + +void WebFullScreenManager::finishedEnterFullScreenAnimation(bool completed) +{ + m_page->send(Messages::WebFullScreenManagerProxy::FinishedEnterFullScreenAnimation(completed)); +} + +void WebFullScreenManager::beganExitFullScreenAnimation() +{ + m_page->send(Messages::WebFullScreenManagerProxy::BeganExitFullScreenAnimation()); +} + +void WebFullScreenManager::finishedExitFullScreenAnimation(bool completed) +{ + m_page->send(Messages::WebFullScreenManagerProxy::FinishedExitFullScreenAnimation(completed)); +} + +IntRect WebFullScreenManager::getFullScreenRect() +{ + IntRect rect; + m_page->sendSync(Messages::WebFullScreenManagerProxy::GetFullScreenRect(), Messages::WebFullScreenManagerProxy::GetFullScreenRect::Reply(rect)); + return rect; +} + +void WebFullScreenManager::willEnterFullScreen() +{ + ASSERT(m_element); + m_element->document()->webkitWillEnterFullScreenForElement(m_element.get()); + m_element->document()->setFullScreenRendererBackgroundColor(Color::transparent); +} + +void WebFullScreenManager::didEnterFullScreen() +{ + ASSERT(m_element); + m_element->document()->webkitDidEnterFullScreenForElement(m_element.get()); + m_element->document()->setFullScreenRendererBackgroundColor(Color::black); +} + +void WebFullScreenManager::willExitFullScreen() +{ + ASSERT(m_element); + m_element->document()->webkitWillExitFullScreenForElement(m_element.get()); + m_element->document()->setFullScreenRendererBackgroundColor(Color::transparent); +} + +void WebFullScreenManager::didExitFullScreen() +{ + ASSERT(m_element); + m_element->document()->webkitDidExitFullScreenForElement(m_element.get()); + m_element->document()->setFullScreenRendererBackgroundColor(Color::black); +} + + +} // namespace WebKit + +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h new file mode 100644 index 0000000..d4ec15d --- /dev/null +++ b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef WebFullScreenManager_h +#define WebFullScreenManager_h + +#if ENABLE(FULLSCREEN_API) + +#include <WebCore/IntRect.h> +#include <wtf/RefCounted.h> +#include <wtf/RefPtr.h> + +namespace CoreIPC { +class ArgumentDecoder; +class Connection; +class MessageID; +} + +namespace WebCore { +class IntRect; +class Element; +class GraphicsLayer; +} + +namespace WebKit { + +class WebPage; + +class WebFullScreenManager : public RefCounted<WebFullScreenManager> { +public: + static PassRefPtr<WebFullScreenManager> create(WebPage*); + virtual ~WebFullScreenManager(); + + void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + + bool supportsFullScreen(bool withKeyboard); + void enterFullScreenForElement(WebCore::Element*); + void exitFullScreenForElement(WebCore::Element*); + void beganEnterFullScreenAnimation(); + void finishedEnterFullScreenAnimation(bool completed); + void beganExitFullScreenAnimation(); + void finishedExitFullScreenAnimation(bool completed); + virtual void setRootFullScreenLayer(WebCore::GraphicsLayer*) = 0; + + WebCore::Element* element(); + +protected: + WebFullScreenManager(WebPage*); + + void willEnterFullScreen(); + void didEnterFullScreen(); + void willExitFullScreen(); + void didExitFullScreen(); + virtual void beginEnterFullScreenAnimation(float duration) = 0; + virtual void beginExitFullScreenAnimation(float duration) = 0; + WebCore::IntRect getFullScreenRect(); + + void didReceiveWebFullScreenManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + + WebCore::IntRect m_initialFrame; + RefPtr<WebPage> m_page; + RefPtr<WebCore::Element> m_element; +}; + +} // namespace WebKit + +#endif // ENABLE(FULLSCREEN_API) + +#endif // WebFullScreenManager_h diff --git a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.messages.in b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.messages.in new file mode 100644 index 0000000..d53f9d5 --- /dev/null +++ b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.messages.in @@ -0,0 +1,32 @@ +# Copyright (C) 2011 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#if ENABLE(FULLSCREEN_API) +messages -> WebFullScreenManager { + WillEnterFullScreen() + DidEnterFullScreen() + WillExitFullScreen() + DidExitFullScreen() + BeginEnterFullScreenAnimation(float duration) + BeginExitFullScreenAnimation(float duration) +} +#endif diff --git a/Source/WebKit2/WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.cpp b/Source/WebKit2/WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.cpp new file mode 100644 index 0000000..5c4e697 --- /dev/null +++ b/Source/WebKit2/WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 Igalia S.L. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" +#include "WebFullScreenManagerGtk.h" + +#if ENABLE(FULLSCREEN_API) + +#include <WebCore/NotImplemented.h> + +namespace WebKit { + +WebFullScreenManagerGtk::WebFullScreenManagerGtk(WebPage* page) + : WebFullScreenManager(page) +{ +} + +PassRefPtr<WebFullScreenManager> WebFullScreenManager::create(WebPage* page) +{ + return adoptRef(new WebFullScreenManagerGtk(page)); +} + +void WebFullScreenManagerGtk::setRootFullScreenLayer(WebCore::GraphicsLayer* layer) +{ + notImplemented(); +} + +void WebFullScreenManagerGtk::beginEnterFullScreenAnimation(float duration) +{ + notImplemented(); +} + +void WebFullScreenManagerGtk::beginExitFullScreenAnimation(float duration) +{ + notImplemented(); +} + +} // namespace WebKit + +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit2/WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.h b/Source/WebKit2/WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.h new file mode 100644 index 0000000..51f5527 --- /dev/null +++ b/Source/WebKit2/WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebFullScreenManagerGtk_h +#define WebFullScreenManagerGtk_h + +#if ENABLE(FULLSCREEN_API) + +#include "WebFullScreenManager.h" + +namespace WebKit { + +class WebFullScreenManagerGtk : public WebFullScreenManager { +public: + WebFullScreenManagerGtk(WebPage*); + virtual void setRootFullScreenLayer(WebCore::GraphicsLayer*); + +private: + virtual void beginEnterFullScreenAnimation(float duration); + virtual void beginExitFullScreenAnimation(float duration); + +}; + +} + +#endif // ENABLE(FULLSCREEN_API) + +#endif // WebFullScreenManagerGtk_h diff --git a/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.h b/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.h new file mode 100644 index 0000000..e247eb5 --- /dev/null +++ b/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebFullScreenManagerMac_h +#define WebFullScreenManagerMac_h + +#if ENABLE(FULLSCREEN_API) + +#import "LayerTreeContext.h" +#import "WebFullScreenManager.h" + +#import <WebCore/IntRect.h> +#import <wtf/RetainPtr.h> + +typedef struct __WKCARemoteLayerClientRef* WKCARemoteLayerClientRef; +OBJC_CLASS WebFullScreenManagerAnimationListener; + +namespace WebKit { + +class WebFullScreenManagerMac : public WebFullScreenManager { +public: + static PassRefPtr<WebFullScreenManagerMac> create(WebPage*); + + virtual void setRootFullScreenLayer(WebCore::GraphicsLayer*); + +private: + WebFullScreenManagerMac(WebPage*); + virtual ~WebFullScreenManagerMac(); + + virtual void beginEnterFullScreenAnimation(float duration); + virtual void beginExitFullScreenAnimation(float duration); + + OwnPtr<WebCore::GraphicsLayer> m_rootLayer; + WebCore::GraphicsLayer* m_fullScreenRootLayer; + LayerTreeContext m_layerTreeContext; + RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient; + RetainPtr<id> m_enterFullScreenListener; + RetainPtr<id> m_exitFullScreenListener; +}; + +} + +#endif // ENABLE(FULLSCREEN_API) + +#endif // WebFullScreenManagerMac_h diff --git a/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm b/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm new file mode 100644 index 0000000..66243c5 --- /dev/null +++ b/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm @@ -0,0 +1,277 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ +#import "config.h" +#import "WebFullScreenManagerMac.h" + +#if ENABLE(FULLSCREEN_API) + +#import "Connection.h" +#import "LayerTreeContext.h" +#import "MessageID.h" +#import "WebFullScreenManagerProxyMessages.h" +#import "WebPage.h" +#import "WebProcess.h" +#import <QuartzCore/QuartzCore.h> +#import <WebCore/Frame.h> +#import <WebCore/FrameView.h> +#import <WebCore/GraphicsLayer.h> +#import <WebCore/Page.h> +#import <WebCore/Settings.h> +#import <WebKitSystemInterface.h> + +using namespace WebCore; + +typedef void (WebKit::WebFullScreenManager::*AnimationBeganFunction)(); +typedef void (WebKit::WebFullScreenManager::*AnimationFinishedFunction)(bool); + +#if defined(BUILDING_ON_LEOPARD) +@interface CATransaction(SnowLeopardConvenienceFunctions) ++ (void)setDisableActions:(BOOL)flag; +@end + +@implementation CATransaction(SnowLeopardConvenienceFunctions) ++ (void)setDisableActions:(BOOL)flag +{ + [self setValue:[NSNumber numberWithBool:flag] forKey:kCATransactionDisableActions]; +} +@end +#endif + +@interface WebFullScreenManagerAnimationListener : NSObject { + WebKit::WebFullScreenManager* _manager; + AnimationBeganFunction _began; + AnimationFinishedFunction _finished; +} +- (id)initWithManager:(WebKit::WebFullScreenManager*)manager began:(AnimationBeganFunction)began finished:(AnimationFinishedFunction)finished; +- (void)animationDidStart:(CAAnimation *)anim; +- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag; +- (void)invalidate; +@end + +@implementation WebFullScreenManagerAnimationListener +- (id)initWithManager:(WebKit::WebFullScreenManager*)manager began:(AnimationBeganFunction)began finished:(AnimationFinishedFunction)finished +{ + self = [super init]; + if (!self) + return nil; + + _manager = manager; + _began = began; + _finished = finished; + return self; +} + +- (void)animationDidStart:(CAAnimation *)anim +{ + if (_manager && _began) + (_manager->*_began)(); +} + +- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag +{ + if (_manager && _finished) + (_manager->*_finished)(flag); +} + +- (void)invalidate +{ + _manager = 0; + _began = 0; + _finished = 0; +} +@end + +namespace WebKit { + +PassRefPtr<WebFullScreenManager> WebFullScreenManager::create(WebPage* page) +{ + return WebFullScreenManagerMac::create(page); +} + +PassRefPtr<WebFullScreenManagerMac> WebFullScreenManagerMac::create(WebPage* page) +{ + return adoptRef(new WebFullScreenManagerMac(page)); +} + +WebFullScreenManagerMac::WebFullScreenManagerMac(WebPage* page) + : WebFullScreenManager(page) +{ + m_enterFullScreenListener.adoptNS([[WebFullScreenManagerAnimationListener alloc] initWithManager:this began:&WebFullScreenManagerMac::beganEnterFullScreenAnimation finished:&WebFullScreenManagerMac::finishedEnterFullScreenAnimation]); + m_exitFullScreenListener.adoptNS([[WebFullScreenManagerAnimationListener alloc] initWithManager:this began:&WebFullScreenManagerMac::beganExitFullScreenAnimation finished:&WebFullScreenManagerMac::finishedExitFullScreenAnimation]); +} + +WebFullScreenManagerMac::~WebFullScreenManagerMac() +{ + m_page->send(Messages::WebFullScreenManagerProxy::ExitAcceleratedCompositingMode()); + [m_enterFullScreenListener.get() invalidate]; + [m_exitFullScreenListener.get() invalidate]; +} + +void WebFullScreenManagerMac::setRootFullScreenLayer(WebCore::GraphicsLayer* layer) +{ + if (m_fullScreenRootLayer == layer) + return; + m_fullScreenRootLayer = layer; + + if (!m_fullScreenRootLayer) { + m_page->send(Messages::WebFullScreenManagerProxy::ExitAcceleratedCompositingMode()); + if (m_rootLayer) { + m_rootLayer->removeAllChildren(); + m_rootLayer = 0; + } + return; + } + + if (!m_rootLayer) { + mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort(); + m_remoteLayerClient = WKCARemoteLayerClientMakeWithServerPort(serverPort); + + m_rootLayer = GraphicsLayer::create(NULL); +#ifndef NDEBUG + m_rootLayer->setName("Full screen root layer"); +#endif + m_rootLayer->setDrawsContent(false); + m_rootLayer->setSize(getFullScreenRect().size()); + + [m_rootLayer->platformLayer() setGeometryFlipped:YES]; + WKCARemoteLayerClientSetLayer(m_remoteLayerClient.get(), m_rootLayer->platformLayer()); + m_layerTreeContext.contextID = WKCARemoteLayerClientGetClientId(m_remoteLayerClient.get()); + m_page->send(Messages::WebFullScreenManagerProxy::EnterAcceleratedCompositingMode(m_layerTreeContext)); + } + + m_rootLayer->removeAllChildren(); + + if (m_fullScreenRootLayer) + m_rootLayer->addChild(m_fullScreenRootLayer); + + m_rootLayer->syncCompositingStateForThisLayerOnly(); + m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes(); +} + +void WebFullScreenManagerMac::beginEnterFullScreenAnimation(float duration) +{ + ASSERT(m_element); + ASSERT(m_fullScreenRootLayer); + + IntRect destinationFrame = getFullScreenRect(); + m_element->document()->setFullScreenRendererSize(destinationFrame.size()); + m_rootLayer->syncCompositingStateForThisLayerOnly(); + m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes(); + + // FIXME: Once we gain the ability to do native WebKit animations of generated + // content, this can change to use them. Meanwhile, we'll have to animate the + // CALayer directly: + CALayer* caLayer = m_fullScreenRootLayer->platformLayer(); + + // Create a transformation matrix that will transform the renderer layer such that + // the fullscreen element appears to move from its starting position and size to its + // final one. + CGPoint destinationPosition = [caLayer position]; + CGPoint layerAnchor = [caLayer anchorPoint]; + CGPoint initialPosition = CGPointMake( + m_initialFrame.x() + m_initialFrame.width() * layerAnchor.x, + m_initialFrame.y() + m_initialFrame.height() * layerAnchor.y); + CATransform3D shrinkTransform = CATransform3DMakeScale( + static_cast<CGFloat>(m_initialFrame.width()) / destinationFrame.width(), + static_cast<CGFloat>(m_initialFrame.height()) / destinationFrame.height(), 1); + CATransform3D shiftTransform = CATransform3DMakeTranslation( + initialPosition.x - destinationPosition.x, + // Drawing is flipped here, and so much be the translation transformation + destinationPosition.y - initialPosition.y, 0); + CATransform3D finalTransform = CATransform3DConcat(shrinkTransform, shiftTransform); + + // Use a CABasicAnimation here for the zoom effect. We want to be notified that the animation has + // completed by way of the CAAnimation delegate. + CABasicAnimation* zoomAnimation = [CABasicAnimation animationWithKeyPath:@"transform"]; + [zoomAnimation setFromValue:[NSValue valueWithCATransform3D:finalTransform]]; + [zoomAnimation setToValue:[NSValue valueWithCATransform3D:CATransform3DIdentity]]; + [zoomAnimation setDelegate:m_enterFullScreenListener.get()]; + [zoomAnimation setDuration:duration]; + [zoomAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; + [zoomAnimation setFillMode:kCAFillModeForwards]; + + // Disable implicit animations and set the layer's transformation matrix to its final state. + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + [caLayer addAnimation:zoomAnimation forKey:@"zoom"]; + [CATransaction commit]; +} + +void WebFullScreenManagerMac::beginExitFullScreenAnimation(float duration) +{ + ASSERT(m_element); + ASSERT(m_fullScreenRootLayer); + + IntRect destinationFrame = getFullScreenRect(); + m_element->document()->setFullScreenRendererSize(destinationFrame.size()); + m_rootLayer->syncCompositingStateForThisLayerOnly(); + m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes(); + + // FIXME: Once we gain the ability to do native WebKit animations of generated + // content, this can change to use them. Meanwhile, we'll have to animate the + // CALayer directly: + CALayer* caLayer = m_fullScreenRootLayer->platformLayer(); + + // Create a transformation matrix that will transform the renderer layer such that + // the fullscreen element appears to move from its starting position and size to its + // final one. + CGPoint destinationPosition = [(CALayer*)[caLayer presentationLayer] position]; + CGRect destinationBounds = NSRectToCGRect([[caLayer presentationLayer] bounds]); + CGPoint layerAnchor = [caLayer anchorPoint]; + CGPoint initialPosition = CGPointMake( + m_initialFrame.x() + m_initialFrame.width() * layerAnchor.x, + m_initialFrame.y() + m_initialFrame.height() * layerAnchor.y); + CATransform3D shrinkTransform = CATransform3DMakeScale( + static_cast<CGFloat>(m_initialFrame.width()) / destinationBounds.size.width, + static_cast<CGFloat>(m_initialFrame.height()) / destinationBounds.size.height, 1); + CATransform3D shiftTransform = CATransform3DMakeTranslation( + initialPosition.x - destinationPosition.x, + // Drawing is flipped here, and so must be the translation transformation + destinationPosition.y - initialPosition.y, 0); + CATransform3D finalTransform = CATransform3DConcat(shrinkTransform, shiftTransform); + + CATransform3D initialTransform = [(CALayer*)[caLayer presentationLayer] transform]; + + // Use a CABasicAnimation here for the zoom effect. We want to be notified that the animation has + // completed by way of the CAAnimation delegate. + CABasicAnimation* zoomAnimation = [CABasicAnimation animationWithKeyPath:@"transform"]; + [zoomAnimation setFromValue:[NSValue valueWithCATransform3D:initialTransform]]; + [zoomAnimation setToValue:[NSValue valueWithCATransform3D:finalTransform]]; + [zoomAnimation setDelegate:m_exitFullScreenListener.get()]; + [zoomAnimation setDuration:duration]; + [zoomAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; + [zoomAnimation setFillMode:kCAFillModeForwards]; + + // Disable implicit animations and set the layer's transformation matrix to its final state. + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + [caLayer addAnimation:zoomAnimation forKey:@"zoom"]; + [caLayer setTransform:finalTransform]; + [CATransaction commit]; +} + +} // namespace WebKit + +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp new file mode 100644 index 0000000..0207791 --- /dev/null +++ b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.cpp @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebIconDatabaseProxy.h" + +#include "DataReference.h" +#include "MessageID.h" +#include "WebIconDatabaseMessages.h" +#include "WebProcess.h" +#include <WebCore/SharedBuffer.h> +#include <wtf/text/WTFString.h> + +using namespace WebCore; + +namespace WebKit { + +WebIconDatabaseProxy::~WebIconDatabaseProxy() +{ +} + +WebIconDatabaseProxy::WebIconDatabaseProxy(WebProcess* process) + : m_isEnabled(false) + , m_process(process) +{ +} + +bool WebIconDatabaseProxy::isEnabled() const +{ + return m_isEnabled; +} + +void WebIconDatabaseProxy::setEnabled(bool enabled) +{ + if (enabled == m_isEnabled) + return; + + m_isEnabled = enabled; + setGlobalIconDatabase(enabled ? this : 0); +} + + +void WebIconDatabaseProxy::retainIconForPageURL(const String& pageURL) +{ + m_process->connection()->send(Messages::WebIconDatabase::RetainIconForPageURL(pageURL), 0); +} + +void WebIconDatabaseProxy::releaseIconForPageURL(const String& pageURL) +{ + m_process->connection()->send(Messages::WebIconDatabase::ReleaseIconForPageURL(pageURL), 0); +} + +Image* WebIconDatabaseProxy::synchronousIconForPageURL(const String& pageURL, const IntSize& size) +{ + CoreIPC::DataReference result; + if (!m_process->connection()->sendSync(Messages::WebIconDatabase::SynchronousIconDataForPageURL(pageURL), Messages::WebIconDatabase::SynchronousIconDataForPageURL::Reply(result), 0)) + return 0; + + // FIXME: Return Image created with the above data. + return 0; +} + + +String WebIconDatabaseProxy::synchronousIconURLForPageURL(const String& pageURL) +{ + // FIXME: This needs to ask the UI process for the iconURL, but it can't do so synchronously because it will slow down page loading. + // The parts in WebCore that need this data will have to be changed to work asycnchronously. + return String(); +} + +bool WebIconDatabaseProxy::synchronousIconDataKnownForIconURL(const String& iconURL) +{ + // FIXME: This needs to ask the UI process for the iconURL, but it can't do so synchronously because it will slow down page loading. + // The parts in WebCore that need this data will have to be changed to work asycnchronously. + return false; +} + +IconLoadDecision WebIconDatabaseProxy::synchronousLoadDecisionForIconURL(const String& iconURL, DocumentLoader* documentLoader) +{ + // FIXME: This needs to ask the UI process for the iconURL, but it can't do so synchronously because it will slow down page loading. + // The parts in WebCore that need this data will have to be changed to work asycnchronously. + return IconLoadNo; +} + +bool WebIconDatabaseProxy::supportsAsynchronousMode() +{ + return true; +} + +void WebIconDatabaseProxy::loadDecisionForIconURL(const String& iconURL, PassRefPtr<WebCore::IconLoadDecisionCallback> callback) +{ + uint64_t id = callback->callbackID(); + m_iconLoadDecisionCallbacks.add(id, callback); + + m_process->connection()->send(Messages::WebIconDatabase::GetLoadDecisionForIconURL(iconURL, id), 0); +} + +void WebIconDatabaseProxy::receivedIconLoadDecision(int decision, uint64_t callbackID) +{ + RefPtr<WebCore::IconLoadDecisionCallback> callback = m_iconLoadDecisionCallbacks.take(callbackID); + if (callback) + callback->performCallback(static_cast<WebCore::IconLoadDecision>(decision)); +} + +void WebIconDatabaseProxy::iconDataForIconURL(const String& iconURL, PassRefPtr<WebCore::IconDataCallback> callback) +{ +} + +void WebIconDatabaseProxy::setIconURLForPageURL(const String& iconURL, const String& pageURL) +{ + m_process->connection()->send(Messages::WebIconDatabase::SetIconURLForPageURL(iconURL, pageURL), 0); +} + +void WebIconDatabaseProxy::setIconDataForIconURL(PassRefPtr<SharedBuffer> iconData, const String& iconURL) +{ + CoreIPC::DataReference data(reinterpret_cast<const uint8_t*>(iconData ? iconData->data() : 0), iconData ? iconData->size() : 0); + m_process->connection()->send(Messages::WebIconDatabase::SetIconDataForIconURL(data, iconURL), 0); +} + +void WebIconDatabaseProxy::urlImportFinished() +{ +} + +void WebIconDatabaseProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) +{ + didReceiveWebIconDatabaseProxyMessage(connection, messageID, arguments); +} + +} // namespace WebKit diff --git a/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h new file mode 100644 index 0000000..2096aba --- /dev/null +++ b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.h @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebIconDatabaseProxy_h +#define WebIconDatabaseProxy_h + +#include "APIObject.h" + +#include <WebCore/IconDatabaseBase.h> + +#include <wtf/HashMap.h> +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> +#include <wtf/Vector.h> + +namespace CoreIPC { +class ArgumentDecoder; +class Connection; +class MessageID; +} + +namespace WebKit { + +class WebProcess; + +class WebIconDatabaseProxy : public WebCore::IconDatabaseBase { +public: + explicit WebIconDatabaseProxy(WebProcess*); + virtual ~WebIconDatabaseProxy(); + + virtual bool isEnabled() const; + void setEnabled(bool); + + + virtual void retainIconForPageURL(const String&); + virtual void releaseIconForPageURL(const String&); + virtual void setIconURLForPageURL(const String&, const String&); + virtual void setIconDataForIconURL(PassRefPtr<WebCore::SharedBuffer>, const String&); + + virtual String synchronousIconURLForPageURL(const String&); + virtual bool synchronousIconDataKnownForIconURL(const String&); + virtual WebCore::IconLoadDecision synchronousLoadDecisionForIconURL(const String&, WebCore::DocumentLoader*); + virtual WebCore::Image* synchronousIconForPageURL(const String&, const WebCore::IntSize&); + + // Asynchronous calls we should use to replace the above when supported. + virtual bool supportsAsynchronousMode(); + virtual void loadDecisionForIconURL(const String&, PassRefPtr<WebCore::IconLoadDecisionCallback>); + void receivedIconLoadDecision(int decision, uint64_t callbackID); + virtual void iconDataForIconURL(const String&, PassRefPtr<WebCore::IconDataCallback>); + + void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + +private: + void didReceiveWebIconDatabaseProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + + // Callbacks from the UIProcess + void urlImportFinished(); + + bool m_isEnabled; + WebProcess* m_process; + + HashMap<uint64_t, RefPtr<WebCore::IconLoadDecisionCallback> > m_iconLoadDecisionCallbacks; +}; + +} // namespace WebKit + +#endif // WebIconDatabaseProxy_h diff --git a/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in new file mode 100644 index 0000000..049a0d9 --- /dev/null +++ b/Source/WebKit2/WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in @@ -0,0 +1,26 @@ +# Copyright (C) 2011 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +messages -> WebIconDatabaseProxy { + URLImportFinished() + ReceivedIconLoadDecision(int loadDecision, uint64_t callbackID) +} diff --git a/Source/WebKit2/WebProcess/Info.plist b/Source/WebKit2/WebProcess/Info.plist index 1fa2672..dabaf1f 100644 --- a/Source/WebKit2/WebProcess/Info.plist +++ b/Source/WebKit2/WebProcess/Info.plist @@ -2,10 +2,6 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>LSFileQuarantineEnabled</key> - <true/> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> <key>CFBundleExecutable</key> <string>${PRODUCT_NAME}</string> <key>CFBundleGetInfoString</key> @@ -22,11 +18,13 @@ <string>${SHORT_VERSION_STRING}</string> <key>CFBundleVersion</key> <string>${BUNDLE_VERSION}</string> + <key>LSFileQuarantineEnabled</key> + <true/> <key>LSMinimumSystemVersion</key> <string>${MACOSX_DEPLOYMENT_TARGET}</string> - <key>NSPrincipalClass</key> - <string>NSApplication</string> <key>LSUIElement</key> <true/> + <key>NSPrincipalClass</key> + <string>NSApplication</string> </dict> </plist> diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp index a58dbda..587968c 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp @@ -128,6 +128,11 @@ void WKBundleOverrideXSSAuditorEnabledForTestRunner(WKBundleRef bundleRef, WKBun toImpl(bundleRef)->overrideXSSAuditorEnabledForTestRunner(toImpl(pageGroupRef), enabled); } +void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled) +{ + toImpl(bundleRef)->overrideAllowUniversalAccessFromFileURLsForTestRunner(toImpl(pageGroupRef), enabled); +} + void WKBundleReportException(JSContextRef context, JSValueRef exception) { InjectedBundle::reportException(context, exception); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp index 0e91d8e..6bed7a4 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp @@ -76,6 +76,16 @@ void WKBundleNodeHandleSetHTMLInputElementAutofilled(WKBundleNodeHandleRef htmlI toImpl(htmlInputElementHandleRef)->setHTMLInputElementAutofilled(filled); } +bool WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit(WKBundleNodeHandleRef htmlInputElementHandleRef) +{ + return toImpl(htmlInputElementHandleRef)->htmlInputElementLastChangeWasUserEdit(); +} + +bool WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit(WKBundleNodeHandleRef htmlTextAreaElementHandleRef) +{ + return toImpl(htmlTextAreaElementHandleRef)->htmlTextAreaElementLastChangeWasUserEdit(); +} + WKBundleNodeHandleRef WKBundleNodeHandleCopyHTMLTableCellElementCellAbove(WKBundleNodeHandleRef htmlTableCellElementHandleRef) { RefPtr<InjectedBundleNodeHandle> nodeHandle = toImpl(htmlTableCellElementHandleRef)->htmlTableCellElementCellAbove(); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h index aaa95e6..6006596 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h @@ -50,7 +50,11 @@ WK_EXPORT WKRect WKBundleNodeHandleGetRenderRect(WKBundleNodeHandleRef nodeHandl WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementValueForUser(WKBundleNodeHandleRef htmlInputElementHandle, WKStringRef value); WK_EXPORT bool WKBundleNodeHandleGetHTMLInputElementAutofilled(WKBundleNodeHandleRef htmlInputElementHandle); WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementAutofilled(WKBundleNodeHandleRef htmlInputElementHandle, bool filled); +WK_EXPORT bool WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit(WKBundleNodeHandleRef htmlInputElementHandle); +/* HTMLTextAreaElement Specific Operations */ +WK_EXPORT bool WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit(WKBundleNodeHandleRef htmlTextAreaElementHandle); + /* HTMLTableCellElement Specific Operations */ WK_EXPORT WKBundleNodeHandleRef WKBundleNodeHandleCopyHTMLTableCellElementCellAbove(WKBundleNodeHandleRef htmlTableCellElementHandle); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h index 4be67d5..e01f51f 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h @@ -168,6 +168,7 @@ typedef void (*WKBundlePageWillRunJavaScriptPromptCallback)(WKBundlePageRef page typedef void (*WKBundlePageMouseDidMoveOverElementCallback)(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef* userData, const void *clientInfo); typedef void (*WKBundlePageDidScrollCallback)(WKBundlePageRef page, const void *clientInfo); typedef void (*WKBundlePagePaintCustomOverhangAreaCallback)(WKBundlePageRef page, WKGraphicsContextRef graphicsContext, WKRect horizontalOverhang, WKRect verticalOverhang, WKRect dirtyRect, const void* clientInfo); +typedef WKStringRef (*WKBundlePageGenerateFileForUploadCallback)(WKBundlePageRef page, WKStringRef originalFilePath, const void* clientInfo); struct WKBundlePageUIClient { int version; @@ -180,6 +181,8 @@ struct WKBundlePageUIClient { WKBundlePageMouseDidMoveOverElementCallback mouseDidMoveOverElement; WKBundlePageDidScrollCallback pageDidScroll; WKBundlePagePaintCustomOverhangAreaCallback paintCustomOverhangArea; + WKBundlePageGenerateFileForUploadCallback shouldGenerateFileForUpload; + WKBundlePageGenerateFileForUploadCallback generateFileForUpload; }; typedef struct WKBundlePageUIClient WKBundlePageUIClient; diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h index bb0bd9f..79c796a 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h @@ -65,6 +65,7 @@ WK_EXPORT void WKBundleRemoveAllUserContent(WKBundleRef bundle, WKBundlePageGrou // Will make WebProcess ignore this preference until a preferences change notification, only for WebKitTestRunner use. WK_EXPORT void WKBundleOverrideXSSAuditorEnabledForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); +WK_EXPORT void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); #ifdef __cplusplus } diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp new file mode 100644 index 0000000..d97784e --- /dev/null +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WKBundlePrivateWin.h" + +#include "InjectedBundle.h" +#include "WKAPICast.h" +#include "WKBundleAPICast.h" + +using namespace WebKit; + +void WKBundleSetHostAllowsAnyHTTPSCertificate(WKBundleRef bundleRef, WKStringRef host) +{ + toImpl(bundleRef)->setHostAllowsAnyHTTPSCertificate(toWTFString(host)); +} + +void WKBundleSetClientCertificate(WKBundleRef bundleRef, WKStringRef host, WKCertificateInfoRef certificateInfoRef) +{ + toImpl(bundleRef)->setClientCertificate(toWTFString(host), toImpl(certificateInfoRef)); +} diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h new file mode 100644 index 0000000..e404ec8 --- /dev/null +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WKBundlePrivateWin_h +#define WKBundlePrivateWin_h + +#include <WebKit2/WKBase.h> + +#ifdef __cplusplus +extern "C" { +#endif + +WK_EXPORT void WKBundleSetHostAllowsAnyHTTPSCertificate(WKBundleRef bundle, WKStringRef host); +WK_EXPORT void WKBundleSetClientCertificate(WKBundleRef bundle, WKStringRef host, WKCertificateInfoRef certificateInfo); + +#ifdef __cplusplus +} +#endif + +#endif /* WKBundlePrivateWin_h */ diff --git a/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp index 858941e..5e15872 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp @@ -30,12 +30,13 @@ #include "WebFrameLoaderClient.h" #include <JavaScriptCore/APICast.h> #include <WebCore/Document.h> +#include <WebCore/Frame.h> #include <WebCore/HTMLFrameElement.h> #include <WebCore/HTMLIFrameElement.h> -#include <WebCore/Frame.h> #include <WebCore/HTMLInputElement.h> #include <WebCore/HTMLNames.h> #include <WebCore/HTMLTableCellElement.h> +#include <WebCore/HTMLTextAreaElement.h> #include <WebCore/IntRect.h> #include <WebCore/JSNode.h> #include <WebCore/Node.h> @@ -132,7 +133,6 @@ bool InjectedBundleNodeHandle::isHTMLInputElementAutofilled() const return static_cast<HTMLInputElement*>(m_node.get())->isAutofilled(); } - void InjectedBundleNodeHandle::setHTMLInputElementAutofilled(bool filled) { if (!m_node->hasTagName(inputTag)) @@ -141,6 +141,22 @@ void InjectedBundleNodeHandle::setHTMLInputElementAutofilled(bool filled) static_cast<HTMLInputElement*>(m_node.get())->setAutofilled(filled); } +bool InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit() +{ + if (!m_node->hasTagName(inputTag)) + return false; + + return static_cast<HTMLInputElement*>(m_node.get())->lastChangeWasUserEdit(); +} + +bool InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit() +{ + if (!m_node->hasTagName(textareaTag)) + return false; + + return static_cast<HTMLTextAreaElement*>(m_node.get())->lastChangeWasUserEdit(); +} + PassRefPtr<InjectedBundleNodeHandle> InjectedBundleNodeHandle::htmlTableCellElementCellAbove() { if (!m_node->hasTagName(tdTag)) diff --git a/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h b/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h index 0dcebf6..e4a5ab9 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h @@ -63,6 +63,9 @@ public: void setHTMLInputElementValueForUser(const String&); bool isHTMLInputElementAutofilled() const; void setHTMLInputElementAutofilled(bool); + bool htmlInputElementLastChangeWasUserEdit(); + bool htmlTextAreaElementLastChangeWasUserEdit(); + PassRefPtr<InjectedBundleNodeHandle> htmlTableCellElementCellAbove(); PassRefPtr<WebFrame> documentFrame(); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp index b887374..24dc7f9 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp @@ -108,6 +108,16 @@ void InjectedBundle::overrideXSSAuditorEnabledForTestRunner(WebPageGroupProxy* p (*iter)->settings()->setXSSAuditorEnabled(enabled); } +void InjectedBundle::overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPageGroupProxy* pageGroup, bool enabled) +{ + // Override the preference for all future pages. + WebPreferencesStore::overrideAllowUniversalAccessFromFileURLsForTestRunner(enabled); + + // Change the setting for existing ones. + const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages(); + for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter) + (*iter)->settings()->setAllowUniversalAccessFromFileURLs(enabled); +} static PassOwnPtr<Vector<String> > toStringVector(ImmutableArray* patterns) { diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h index cf844c9..6896669 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h @@ -59,6 +59,7 @@ typedef void* PlatformBundle; class ImmutableArray; class InjectedBundleScriptWorld; +class WebCertificateInfo; class WebPage; class WebPageGroupProxy; @@ -79,12 +80,17 @@ public: void initializeClient(WKBundleClient*); void postMessage(const String&, APIObject*); void postSynchronousMessage(const String&, APIObject*, RefPtr<APIObject>& returnData); +#if PLATFORM(WIN) + void setHostAllowsAnyHTTPSCertificate(const String&); + void setClientCertificate(const String&, const WebCertificateInfo*); +#endif // TestRunner only SPI void setShouldTrackVisitedLinks(bool); void removeAllVisitedLinks(); void activateMacFontAscentHack(); void overrideXSSAuditorEnabledForTestRunner(WebPageGroupProxy* pageGroup, bool enabled); + void overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPageGroupProxy*, bool); // UserContent API void addUserScript(WebPageGroupProxy*, InjectedBundleScriptWorld*, const String& source, const String& url, ImmutableArray* whitelist, ImmutableArray* blacklist, WebCore::UserScriptInjectionTime, WebCore::UserContentInjectedFrames); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp index 7bb4f89..532d058 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp @@ -99,4 +99,20 @@ void InjectedBundlePageUIClient::paintCustomOverhangArea(WebPage* page, Graphics m_client.paintCustomOverhangArea(toAPI(page), toAPI(context.get()), toAPI(horizontalOverhangArea), toAPI(verticalOverhangArea), toAPI(dirtyRect), m_client.clientInfo); } +String InjectedBundlePageUIClient::shouldGenerateFileForUpload(WebPage* page, const String& originalFilePath) +{ + if (!m_client.shouldGenerateFileForUpload) + return String(); + RefPtr<WebString> generatedFilePath = adoptRef(toImpl(m_client.shouldGenerateFileForUpload(toAPI(page), toAPI(originalFilePath.impl()), m_client.clientInfo))); + return generatedFilePath ? generatedFilePath->string() : String(); +} + +String InjectedBundlePageUIClient::generateFileForUpload(WebPage* page, const String& originalFilePath) +{ + if (!m_client.shouldGenerateFileForUpload) + return String(); + RefPtr<WebString> generatedFilePath = adoptRef(toImpl(m_client.generateFileForUpload(toAPI(page), toAPI(originalFilePath.impl()), m_client.clientInfo))); + return generatedFilePath ? generatedFilePath->string() : String(); +} + } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h index 94925b7..47a5ca8 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h @@ -55,6 +55,9 @@ public: bool shouldPaintCustomOverhangArea(); void paintCustomOverhangArea(WebPage*, WebCore::GraphicsContext*, const WebCore::IntRect&, const WebCore::IntRect&, const WebCore::IntRect&); + + String shouldGenerateFileForUpload(WebPage*, const String& originalFilePath); + String generateFileForUpload(WebPage*, const String& originalFilePath); }; } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp b/Source/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp index 1e593fc..4b415a4 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp @@ -28,6 +28,8 @@ #include "WKBundleAPICast.h" #include "WKBundleInitialize.h" +#include "WebCertificateInfo.h" +#include <WebCore/ResourceHandle.h> #include <WebCore/SimpleFontData.h> #include <windows.h> @@ -35,6 +37,10 @@ #include <shlobj.h> #include <shlwapi.h> +#if USE(CFNETWORK) +#include <WebCore/CertificateCFWin.h> +#endif + using namespace WebCore; namespace WebKit { @@ -86,4 +92,27 @@ void InjectedBundle::activateMacFontAscentHack() SimpleFontData::setShouldApplyMacAscentHack(true); } +void InjectedBundle::setHostAllowsAnyHTTPSCertificate(const String& host) +{ +#if USE(CFNETWORK) + ResourceHandle::setHostAllowsAnyHTTPSCertificate(host); +#endif +} + +void InjectedBundle::setClientCertificate(const String& host, const WebCertificateInfo* certificateInfo) +{ +#if USE(CFNETWORK) + ASSERT(certificateInfo); + if (!certificateInfo) + return; + + const Vector<PCCERT_CONTEXT> certificateChain = certificateInfo->platformCertificateInfo().certificateChain(); + ASSERT(certificateChain.size() == 1); + if (certificateChain.size() != 1) + return; + + ResourceHandle::setClientCertificate(host, WebCore::copyCertificateToData(certificateChain.first()).get()); +#endif +} + } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp b/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp index 5ee1419..45431c3 100644 --- a/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp +++ b/Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp @@ -34,6 +34,7 @@ #include <WebCore/NotImplemented.h> #include <WebCore/SecurityOrigin.h> #include <WebCore/SecurityOriginHash.h> +#include <WebCore/StorageTracker.h> using namespace WebCore; @@ -56,39 +57,42 @@ void WebKeyValueStorageManager::didReceiveMessage(CoreIPC::Connection* connectio void WebKeyValueStorageManager::getKeyValueStorageOrigins(uint64_t callbackID) { - HashSet<RefPtr<SecurityOrigin>, SecurityOriginHash> origins; + Vector<RefPtr<SecurityOrigin> > coreOrigins; - // FIXME: <rdar://problem/8762095> and https://bugs.webkit.org/show_bug.cgi?id=55172 - Actually get the origins from WebCore once https://bugs.webkit.org/show_bug.cgi?id=51878 is resolved. + StorageTracker::tracker().origins(coreOrigins); + size_t size = coreOrigins.size(); Vector<SecurityOriginData> identifiers; - identifiers.reserveCapacity(origins.size()); + identifiers.reserveCapacity(size); - HashSet<RefPtr<SecurityOrigin>, SecurityOriginHash>::iterator end = origins.end(); - HashSet<RefPtr<SecurityOrigin>, SecurityOriginHash>::iterator i = origins.begin(); - for (; i != end; ++i) { - RefPtr<SecurityOrigin> origin = *i; - + for (size_t i = 0; i < size; ++i) { SecurityOriginData originData; - originData.protocol = origin->protocol(); - originData.host = origin->host(); - originData.port = origin->port(); + + originData.protocol = coreOrigins[i]->protocol(); + originData.host = coreOrigins[i]->host(); + originData.port = coreOrigins[i]->port(); identifiers.uncheckedAppend(originData); } WebProcess::shared().connection()->send(Messages::WebKeyValueStorageManagerProxy::DidGetKeyValueStorageOrigins(identifiers, callbackID), 0); + WebProcess::shared().terminateIfPossible(); } void WebKeyValueStorageManager::deleteEntriesForOrigin(const SecurityOriginData& originData) { - // FIXME: <rdar://problem/8762095> and https://bugs.webkit.org/show_bug.cgi?id=55172 - Implement once https://bugs.webkit.org/show_bug.cgi?id=51878 is resolved. - notImplemented(); + RefPtr<SecurityOrigin> origin = SecurityOrigin::create(originData.protocol, originData.host, originData.port); + if (!origin) + return; + + StorageTracker::tracker().deleteOrigin(origin.get()); + WebProcess::shared().terminateIfPossible(); } void WebKeyValueStorageManager::deleteAllEntries() { - // FIXME: <rdar://problem/8762095> and https://bugs.webkit.org/show_bug.cgi?id=55172 - Implement once https://bugs.webkit.org/show_bug.cgi?id=51878 is resolved. - notImplemented(); + StorageTracker::tracker().deleteAllOrigins(); + WebProcess::shared().terminateIfPossible(); } } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp new file mode 100644 index 0000000..6baf6d9 --- /dev/null +++ b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebMediaCacheManager.h" + +#include "MessageID.h" +#include "SecurityOriginData.h" +#include "WebMediaCacheManagerProxyMessages.h" +#include "WebProcess.h" +#include <WebCore/HTMLMediaElement.h> + +using namespace WebCore; + +namespace WebKit { + +WebMediaCacheManager& WebMediaCacheManager::shared() +{ + static WebMediaCacheManager& shared = *new WebMediaCacheManager; + return shared; +} + +WebMediaCacheManager::WebMediaCacheManager() +{ +} + +void WebMediaCacheManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) +{ + didReceiveWebMediaCacheManagerMessage(connection, messageID, arguments); +} + +void WebMediaCacheManager::getHostnamesWithMediaCache(uint64_t callbackID) +{ + Vector<String> mediaCacheHostnames; + +#if ENABLE(VIDEO) + HTMLMediaElement::getSitesInMediaCache(mediaCacheHostnames); +#endif + + WebProcess::shared().connection()->send(Messages::WebMediaCacheManagerProxy::DidGetHostnamesWithMediaCache(mediaCacheHostnames, callbackID), 0); + WebProcess::shared().terminateIfPossible(); +} + +void WebMediaCacheManager::clearCacheForHostname(const String& hostname) +{ +#if ENABLE(VIDEO) + HTMLMediaElement::clearMediaCacheForSite(hostname); +#endif + WebProcess::shared().terminateIfPossible(); +} + +void WebMediaCacheManager::clearCacheForAllHostnames() +{ +#if ENABLE(VIDEO) + HTMLMediaElement::clearMediaCache(); +#endif + WebProcess::shared().terminateIfPossible(); +} + +} // namespace WebKit diff --git a/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h new file mode 100644 index 0000000..909be97 --- /dev/null +++ b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebMediaCacheManager_h +#define WebMediaCacheManager_h + +#include <wtf/Noncopyable.h> +#include <wtf/text/WTFString.h> + +namespace CoreIPC { + class ArgumentDecoder; + class Connection; + class MessageID; +} + +namespace WebKit { + +class WebMediaCacheManager { + WTF_MAKE_NONCOPYABLE(WebMediaCacheManager); + +public: + static WebMediaCacheManager& shared(); + + void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); + +private: + WebMediaCacheManager(); + + void getHostnamesWithMediaCache(uint64_t callbackID); + void clearCacheForHostname(const String&); + void clearCacheForAllHostnames(); + + void didReceiveWebMediaCacheManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); +}; + +} // namespace WebKit + +#endif // WebMediaCacheManager_h diff --git a/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.messages.in b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.messages.in new file mode 100644 index 0000000..5eee8cc --- /dev/null +++ b/Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.messages.in @@ -0,0 +1,27 @@ +# Copyright (C) 2011 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +messages -> WebMediaCacheManager { + void GetHostnamesWithMediaCache(uint64_t callbackID) + void ClearCacheForHostname(WTF::String hostname) + void ClearCacheForAllHostnames() +} diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp index fc73519..8b36d1d 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp @@ -42,7 +42,7 @@ namespace WebKit { const ClassInfo JSNPMethod::s_info = { "NPMethod", &InternalFunction::s_info, 0, 0 }; JSNPMethod::JSNPMethod(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, NPIdentifier npIdentifier) - : InternalFunction(&exec->globalData(), globalObject, createStructure(globalObject->functionPrototype()), name) + : InternalFunction(&exec->globalData(), globalObject, createStructure(exec->globalData(), globalObject->functionPrototype()), name) , m_npIdentifier(npIdentifier) { ASSERT(inherits(&s_info)); diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h index a913a99..f0c2424 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h @@ -42,9 +42,9 @@ public: NPIdentifier npIdentifier() const { return m_npIdentifier; } private: - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } virtual JSC::CallType getCallData(JSC::CallData&); diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp index 2724f0d..93f9fc5 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp @@ -50,7 +50,7 @@ static NPIdentifier npIdentifierFromIdentifier(const Identifier& identifier) const ClassInfo JSNPObject::s_info = { "NPObject", &JSObjectWithGlobalObject::s_info, 0, 0 }; JSNPObject::JSNPObject(JSGlobalObject* globalObject, NPRuntimeObjectMap* objectMap, NPObject* npObject) - : JSObjectWithGlobalObject(globalObject, createStructure(globalObject->objectPrototype())) + : JSObjectWithGlobalObject(globalObject, createStructure(globalObject->globalData(), globalObject->objectPrototype())) , m_objectMap(objectMap) , m_npObject(npObject) { diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h index adaffa7..e8a08da 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h @@ -55,9 +55,9 @@ public: private: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | JSObject::StructureFlags; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) + static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { - return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } virtual JSC::CallType getCallData(JSC::CallData&); diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp index 679de6f..a548fd6 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp @@ -35,6 +35,12 @@ #include <WebCore/SharedBuffer.h> #include <utility> +#if PLATFORM(QT) +#include <QX11Info> +#elif PLATFORM(GTK) +#include <gdk/gdkx.h> +#endif + using namespace WebCore; using namespace std; @@ -484,17 +490,33 @@ static NPError NPN_GetValue(NPP npp, NPNVariable variable, void *value) *(NPBool*)value = true; break; #elif PLUGIN_ARCHITECTURE(X11) + case NPNVxDisplay: +#if PLATFORM(QT) + *reinterpret_cast<Display**>(value) = QX11Info::display(); + break; +#elif PLATFORM(GTK) + *reinterpret_cast<Display**>(value) = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); + break; +#else + goto default; +#endif + case NPNVSupportsXEmbedBool: + *static_cast<NPBool*>(value) = true; + break; + case NPNVSupportsWindowless: + *static_cast<NPBool*>(value) = true; + break; + case NPNVToolkit: { const uint32_t expectedGTKToolKitVersion = 2; RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp); - if (plugin->quirks().contains(PluginQuirks::RequiresGTKToolKit)) { - *reinterpret_cast<uint32_t*>(value) = expectedGTKToolKitVersion; - break; - } - - return NPERR_GENERIC_ERROR; + *reinterpret_cast<uint32_t*>(value) = plugin->quirks().contains(PluginQuirks::RequiresGTKToolKit) ? + expectedGTKToolKitVersion : 0; + break; } + + // TODO: implement NPNVnetscapeWindow once we want to support windowed plugins. #endif default: notImplemented(); @@ -529,7 +551,12 @@ static NPError NPN_SetValue(NPP npp, NPPVariable variable, void *value) return NPERR_NO_ERROR; } - case NPPVpluginTransparentBool: + case NPPVpluginTransparentBool: { + RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp); + plugin->setIsTransparent(value); + return NPERR_NO_ERROR; + } + default: notImplemented(); return NPERR_GENERIC_ERROR; diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp index 7e9b059..7d00219 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp @@ -64,6 +64,7 @@ NetscapePlugin::NetscapePlugin(PassRefPtr<NetscapePluginModule> pluginModule) #else , m_isWindowed(true) #endif + , m_isTransparent(false) , m_inNPPNew(false) , m_loadManually(false) #if PLATFORM(MAC) @@ -75,20 +76,23 @@ NetscapePlugin::NetscapePlugin(PassRefPtr<NetscapePluginModule> pluginModule) #ifndef NP_NO_CARBON , m_nullEventTimer(RunLoop::main(), this, &NetscapePlugin::nullEventTimerFired) , m_npCGContext() -#endif +#endif +#elif PLUGIN_ARCHITECTURE(X11) + , m_drawable(0) + , m_pluginDisplay(0) #endif { m_npp.ndata = this; m_npp.pdata = 0; - m_pluginModule->pluginCreated(); + m_pluginModule->incrementLoadCount(); } NetscapePlugin::~NetscapePlugin() { ASSERT(!m_isStarted); - m_pluginModule->pluginDestroyed(); + m_pluginModule->decrementLoadCount(); } PassRefPtr<NetscapePlugin> NetscapePlugin::fromNPP(NPP npp) @@ -189,6 +193,11 @@ void NetscapePlugin::setIsWindowed(bool isWindowed) m_isWindowed = isWindowed; } +void NetscapePlugin::setIsTransparent(bool isTransparent) +{ + m_isTransparent = isTransparent; +} + void NetscapePlugin::setStatusbarText(const String& statusbarText) { m_pluginController->setStatusbarText(statusbarText); @@ -347,8 +356,14 @@ NPError NetscapePlugin::NPP_SetValue(NPNVariable variable, void *value) void NetscapePlugin::callSetWindow() { +#if PLUGIN_ARCHITECTURE(X11) + // We use a backing store as the painting area for the plugin. + m_npWindow.x = 0; + m_npWindow.y = 0; +#else m_npWindow.x = m_frameRect.x(); m_npWindow.y = m_frameRect.y(); +#endif m_npWindow.width = m_frameRect.width(); m_npWindow.height = m_frameRect.height(); m_npWindow.clipRect.top = m_clipRect.y(); @@ -427,6 +442,17 @@ bool NetscapePlugin::initialize(PluginController* pluginController, const Parame values.append(paramValues[i].data()); } +#if PLATFORM(MAC) + if (m_pluginModule->pluginQuirks().contains(PluginQuirks::MakeTransparentIfBackgroundAttributeExists)) { + for (size_t i = 0; i < parameters.names.size(); ++i) { + if (equalIgnoringCase(parameters.names[i], "background")) { + setIsTransparent(true); + break; + } + } + } +#endif + NetscapePlugin* previousNPPNewPlugin = currentNPPNewPlugin; m_inNPPNew = true; @@ -487,7 +513,7 @@ PassRefPtr<ShareableBitmap> NetscapePlugin::snapshot() ASSERT(m_isStarted); - RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(m_frameRect.size()); + RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(m_frameRect.size(), ShareableBitmap::SupportsAlpha); OwnPtr<GraphicsContext> context = bitmap->createGraphicsContext(); context->translate(-m_frameRect.x(), -m_frameRect.y()); @@ -497,6 +523,11 @@ PassRefPtr<ShareableBitmap> NetscapePlugin::snapshot() return bitmap.release(); } +bool NetscapePlugin::isTransparent() +{ + return m_isTransparent; +} + void NetscapePlugin::geometryDidChange(const IntRect& frameRect, const IntRect& clipRect) { ASSERT(m_isStarted); diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h index e865d93..7cf9ead 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h @@ -78,6 +78,7 @@ public: const Vector<uint8_t>& httpBody, bool sendNotification, void* notificationData); NPError destroyStream(NPStream*, NPReason); void setIsWindowed(bool); + void setIsTransparent(bool); void setStatusbarText(const String&); static void setException(const String&); bool evaluate(NPObject*, const String&scriptString, NPVariant* result); @@ -145,6 +146,7 @@ private: #if PLATFORM(MAC) virtual PlatformLayer* pluginLayer(); #endif + virtual bool isTransparent(); virtual void geometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect); virtual void frameDidFinishLoading(uint64_t requestID); virtual void frameDidFail(uint64_t requestID, bool wasCancelled); @@ -203,12 +205,13 @@ private: bool m_isStarted; bool m_isWindowed; + bool m_isTransparent; bool m_inNPPNew; bool m_loadManually; RefPtr<NetscapePluginStream> m_manualStream; Vector<bool, 8> m_popupEnabledStates; -#if PLATFORM(MAC) +#if PLUGIN_ARCHITECTURE(MAC) NPDrawingModel m_drawingModel; NPEventModel m_eventModel; RetainPtr<PlatformLayer> m_pluginLayer; @@ -229,8 +232,11 @@ private: RunLoop::Timer<NetscapePlugin> m_nullEventTimer; NP_CGContext m_npCGContext; #endif -#elif PLATFORM(WIN) +#elif PLUGIN_ARCHITECTURE(WIN) HWND m_window; +#elif PLUGIN_ARCHITECTURE(X11) + Pixmap m_drawable; + Display* m_pluginDisplay; #endif }; diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp index 9450317..cf5affc 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp @@ -304,7 +304,7 @@ void NetscapePluginStream::stop(NPReason reason) ASSERT(!m_filePath.isNull()); - m_plugin->NPP_StreamAsFile(&m_npStream, m_filePath.data()); + m_plugin->NPP_StreamAsFile(&m_npStream, m_filePath.utf8().data()); } else { // Just close the file. if (m_fileHandle != invalidPlatformFileHandle) @@ -315,8 +315,8 @@ void NetscapePluginStream::stop(NPReason reason) // to delete the file here -- NPP_StreamAsFile() is always called immediately before NPP_DestroyStream() // (the stream destruction function), so there can be no expectation that a plugin will read the stream // file asynchronously after NPP_StreamAsFile() is called. - deleteFile(String::fromUTF8(m_filePath.data())); - m_filePath = CString(); + deleteFile(m_filePath); + m_filePath = String(); // NPP_StreamAsFile could call NPN_DestroyStream and destroy the stream. if (!m_isStarted) diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h index 7757001..f22ab61 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h @@ -88,7 +88,7 @@ private: uint16_t m_transferMode; int32_t m_offset; - CString m_filePath; + String m_filePath; WebCore::PlatformFileHandle m_fileHandle; // Whether NPP_NewStream has successfully been called. diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm b/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm index 2a33008..14ac070 100644 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm @@ -221,7 +221,8 @@ bool NetscapePlugin::platformPostInitialize() #ifndef NP_NO_QUICKDRAW // Right now we don't support the QuickDraw drawing model at all - if (m_drawingModel == NPDrawingModelQuickDraw) + if (m_drawingModel == NPDrawingModelQuickDraw && + !m_pluginModule->pluginQuirks().contains(PluginQuirks::AllowHalfBakedQuickDrawSupport)) return false; #endif @@ -230,7 +231,17 @@ bool NetscapePlugin::platformPostInitialize() // Get the Core Animation layer. if (NPP_GetValue(NPPVpluginCoreAnimationLayer, &value) == NPERR_NO_ERROR && value) { ASSERT(!m_pluginLayer); - m_pluginLayer = reinterpret_cast<CALayer *>(value); + + CALayer *realPluginLayer = reinterpret_cast<CALayer *>(value); + + // Create a layer with flipped geometry and add the real plug-in layer as a sublayer + // so the coordinate system will match the event coordinate system. + m_pluginLayer.adoptNS([[CALayer alloc] init]); + [m_pluginLayer.get() setBounds:[realPluginLayer bounds]]; + [m_pluginLayer.get() setGeometryFlipped:YES]; + + [realPluginLayer setAutoresizingMask:kCALayerWidthSizable | kCALayerHeightSizable]; + [m_pluginLayer.get() addSublayer:realPluginLayer]; } } @@ -277,6 +288,10 @@ void NetscapePlugin::platformDestroy() bool NetscapePlugin::platformInvalidate(const IntRect&) { + // NPN_InvalidateRect is just a no-op in the Core Animation drawing model. + if (m_drawingModel == NPDrawingModelCoreAnimation) + return true; + return false; } diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp deleted file mode 100644 index 581dcf3..0000000 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * Copyright (C) 2010 University of Szeged - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "NetscapePlugin.h" - -#include "WebEvent.h" -#include <WebCore/GraphicsContext.h> -#include <WebCore/NotImplemented.h> - -using namespace WebCore; - -namespace WebKit { - -bool NetscapePlugin::platformPostInitialize() -{ - notImplemented(); - return true; -} - -void NetscapePlugin::platformDestroy() -{ - notImplemented(); -} - -bool NetscapePlugin::platformInvalidate(const IntRect&) -{ - notImplemented(); - return false; -} - -void NetscapePlugin::platformGeometryDidChange() -{ - notImplemented(); -} - -void NetscapePlugin::platformPaint(GraphicsContext* context, const IntRect& dirtyRect, bool) -{ - notImplemented(); -} - -NPEvent toNP(const WebMouseEvent& event) -{ -#if OS(SYMBIAN) - NPEvent npEvent = QEvent(QEvent::None); -#else - NPEvent npEvent = NPEvent(); -#endif - - notImplemented(); - - return npEvent; -} - -bool NetscapePlugin::platformHandleMouseEvent(const WebMouseEvent& event) -{ - if (m_isWindowed) - return false; - - NPEvent npEvent = toNP(event); - NPP_HandleEvent(&npEvent); - return true; -} - -bool NetscapePlugin::platformHandleWheelEvent(const WebWheelEvent&) -{ - notImplemented(); - return false; -} - -void NetscapePlugin::platformSetFocus(bool) -{ - notImplemented(); -} - -bool NetscapePlugin::platformHandleMouseEnterEvent(const WebMouseEvent& event) -{ - if (m_isWindowed) - return false; - - NPEvent npEvent = toNP(event); - NPP_HandleEvent(&npEvent); - return true; -} - -bool NetscapePlugin::platformHandleMouseLeaveEvent(const WebMouseEvent& event) -{ - if (m_isWindowed) - return false; - - NPEvent npEvent = toNP(event); - NPP_HandleEvent(&npEvent); - return true; -} - -bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent&) -{ - notImplemented(); - return false; -} - -} // namespace WebKit diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp new file mode 100644 index 0000000..27e694b --- /dev/null +++ b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp @@ -0,0 +1,425 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010 University of Szeged + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "NetscapePlugin.h" + +#include "WebEvent.h" +#include <WebCore/GraphicsContext.h> +#include <WebCore/NotImplemented.h> + +#if PLATFORM(QT) +#include <QApplication> +#include <QDesktopWidget> +#include <QPixmap> +#include <QX11Info> +#elif PLATFORM(GTK) +#include <gdk/gdkx.h> +#endif + +using namespace WebCore; + +namespace WebKit { + +static Display *getPluginDisplay() +{ +#if PLATFORM(QT) + // At the moment, we only support gdk based plugins (like Flash) that use a different X connection. + // The code below has the same effect as this one: + // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default()); + + QLibrary library(QLatin1String("libgdk-x11-2.0"), 0); + if (!library.load()) + return 0; + + typedef void *(*gdk_display_get_default_ptr)(); + gdk_display_get_default_ptr gdk_display_get_default = (gdk_display_get_default_ptr)library.resolve("gdk_display_get_default"); + if (!gdk_display_get_default) + return 0; + + typedef void *(*gdk_x11_display_get_xdisplay_ptr)(void *); + gdk_x11_display_get_xdisplay_ptr gdk_x11_display_get_xdisplay = (gdk_x11_display_get_xdisplay_ptr)library.resolve("gdk_x11_display_get_xdisplay"); + if (!gdk_x11_display_get_xdisplay) + return 0; + + return (Display*)gdk_x11_display_get_xdisplay(gdk_display_get_default()); +#elif PLATFORM(GTK) + // Since we're a gdk/gtk app, we'll (probably?) have the same X connection as any gdk-based + // plugins, so we can return that. We might want to add other implementations here later. + return GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); +#else + return 0; +#endif +} + +static inline Display* x11Display() +{ +#if PLATFORM(QT) + return QX11Info::display(); +#elif PLATFORM(GTK) + return GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); +#else + return 0; +#endif +} + +static inline int displayDepth() +{ +#if PLATFORM(QT) + return QApplication::desktop()->x11Info().depth(); +#elif PLATFORM(GTK) + return gdk_visual_get_depth(gdk_screen_get_system_visual(gdk_screen_get_default())); +#else + return 0; +#endif +} + +static inline unsigned long rootWindowID() +{ +#if PLATFORM(QT) + return QX11Info::appRootWindow(); +#elif PLATFORM(GTK) + return GDK_ROOT_WINDOW(); +#else + return 0; +#endif +} + +static inline int x11Screen() +{ +#if PLATFORM(QT) + return QX11Info::appScreen(); +#elif PLATFORM(GTK) + return gdk_screen_get_number(gdk_screen_get_default()); +#else + return 0; +#endif +} + +bool NetscapePlugin::platformPostInitialize() +{ + if (m_isWindowed) + return false; + + if (!(m_pluginDisplay = getPluginDisplay())) + return false; + + NPSetWindowCallbackStruct* callbackStruct = new NPSetWindowCallbackStruct; + callbackStruct->type = 0; + Display* display = x11Display(); + int depth = displayDepth(); + callbackStruct->display = display; + callbackStruct->depth = depth; + + XVisualInfo visualTemplate; + visualTemplate.screen = x11Screen(); + visualTemplate.depth = depth; + visualTemplate.c_class = TrueColor; + int numMatching; + XVisualInfo* visualInfo = XGetVisualInfo(display, VisualScreenMask | VisualDepthMask | VisualClassMask, + &visualTemplate, &numMatching); + ASSERT(visualInfo); + Visual* visual = visualInfo[0].visual; + ASSERT(visual); + XFree(visualInfo); + + callbackStruct->visual = visual; + callbackStruct->colormap = XCreateColormap(display, rootWindowID(), visual, AllocNone); + + m_npWindow.type = NPWindowTypeDrawable; + m_npWindow.window = 0; + m_npWindow.ws_info = callbackStruct; + + callSetWindow(); + + return true; +} + +void NetscapePlugin::platformDestroy() +{ + delete static_cast<NPSetWindowCallbackStruct*>(m_npWindow.ws_info); + + if (m_drawable) { + XFreePixmap(x11Display(), m_drawable); + m_drawable = 0; + } +} + +bool NetscapePlugin::platformInvalidate(const IntRect&) +{ + notImplemented(); + return false; +} + +void NetscapePlugin::platformGeometryDidChange() +{ + if (m_isWindowed) { + notImplemented(); + return; + } + + Display* display = x11Display(); + if (m_drawable) + XFreePixmap(display, m_drawable); + + m_drawable = XCreatePixmap(display, rootWindowID(), m_frameRect.width(), m_frameRect.height(), displayDepth()); + + XSync(display, false); // Make sure that the server knows about the Drawable. +} + +void NetscapePlugin::platformPaint(GraphicsContext* context, const IntRect& dirtyRect, bool /*isSnapshot*/) +{ + if (m_isWindowed) { + notImplemented(); + return; + } + + if (!m_isStarted) { + // FIXME: we should paint a missing plugin icon. + return; + } + + if (context->paintingDisabled()) + return; + + ASSERT(m_drawable); + +#if PLATFORM(QT) + QPainter* painter = context->platformContext(); + painter->translate(m_frameRect.x(), m_frameRect.y()); +#else + notImplemented(); + return; +#endif + + XEvent xevent; + memset(&xevent, 0, sizeof(XEvent)); + XGraphicsExposeEvent& exposeEvent = xevent.xgraphicsexpose; + exposeEvent.type = GraphicsExpose; + exposeEvent.display = x11Display(); + exposeEvent.drawable = m_drawable; + + IntRect exposedRect(dirtyRect); + exposedRect.intersect(m_frameRect); + exposedRect.move(-m_frameRect.x(), -m_frameRect.y()); + exposeEvent.x = exposedRect.x(); + exposeEvent.y = exposedRect.y(); + + // Note: in transparent mode Flash thinks width is the right and height is the bottom. + // We should take it into account if we want to support transparency. + exposeEvent.width = exposedRect.width(); + exposeEvent.height = exposedRect.height(); + + NPP_HandleEvent(&xevent); + + if (m_pluginDisplay != x11Display()) + XSync(m_pluginDisplay, false); + +#if PLATFORM(QT) + QPixmap qtDrawable = QPixmap::fromX11Pixmap(m_drawable, QPixmap::ExplicitlyShared); + ASSERT(qtDrawable.depth() == static_cast<NPSetWindowCallbackStruct*>(m_npWindow.ws_info)->depth); + painter->drawPixmap(QPoint(exposedRect.x(), exposedRect.y()), qtDrawable, exposedRect); + + painter->translate(-m_frameRect.x(), -m_frameRect.y()); +#endif +} + +static inline void initializeXEvent(XEvent& event) +{ + memset(&event, 0, sizeof(XEvent)); + event.xany.serial = 0; + event.xany.send_event = false; + event.xany.display = x11Display(); + event.xany.window = 0; +} + +static inline uint64_t xTimeStamp(double timestampInSeconds) +{ + return timestampInSeconds * 1000; +} + +static inline unsigned xKeyModifiers(const WebEvent& event) +{ + unsigned xModifiers = 0; + if (event.controlKey()) + xModifiers |= ControlMask; + if (event.shiftKey()) + xModifiers |= ShiftMask; + if (event.altKey()) + xModifiers |= Mod1Mask; + if (event.metaKey()) + xModifiers |= Mod4Mask; + + return xModifiers; +} + +template <typename XEventType> +static inline void setCommonMouseEventFields(XEventType& xEvent, const WebMouseEvent& webEvent, const WebCore::IntPoint& pluginLocation) +{ + xEvent.root = rootWindowID(); + xEvent.subwindow = 0; + xEvent.time = xTimeStamp(webEvent.timestamp()); + xEvent.x = webEvent.position().x() - pluginLocation.x(); + xEvent.y = webEvent.position().y() - pluginLocation.y(); + xEvent.x_root = webEvent.globalPosition().x(); + xEvent.y_root = webEvent.globalPosition().y(); + xEvent.state = xKeyModifiers(webEvent); + xEvent.same_screen = true; +} + +static inline void setXMotionEventFields(XEvent& xEvent, const WebMouseEvent& webEvent, const WebCore::IntPoint& pluginLocation) +{ + XMotionEvent& xMotion = xEvent.xmotion; + setCommonMouseEventFields(xMotion, webEvent, pluginLocation); + xMotion.type = MotionNotify; +} + +static inline void setXButtonEventFields(XEvent& xEvent, const WebMouseEvent& webEvent, const WebCore::IntPoint& pluginLocation) +{ + XButtonEvent& xButton = xEvent.xbutton; + setCommonMouseEventFields(xButton, webEvent, pluginLocation); + + xButton.type = (webEvent.type() == WebEvent::MouseDown) ? ButtonPress : ButtonRelease; + switch (webEvent.button()) { + case WebMouseEvent::LeftButton: + xButton.button = Button1; + break; + case WebMouseEvent::MiddleButton: + xButton.button = Button2; + break; + case WebMouseEvent::RightButton: + xButton.button = Button3; + break; + } +} + +static inline void setXCrossingEventFields(XEvent& xEvent, const WebMouseEvent& webEvent, const WebCore::IntPoint& pluginLocation, int type) +{ + XCrossingEvent& xCrossing = xEvent.xcrossing; + setCommonMouseEventFields(xCrossing, webEvent, pluginLocation); + + xCrossing.type = type; + xCrossing.mode = NotifyNormal; + xCrossing.detail = NotifyDetailNone; + xCrossing.focus = false; +} + +bool NetscapePlugin::platformHandleMouseEvent(const WebMouseEvent& event) +{ + if (m_isWindowed) + return false; + + XEvent xEvent; + initializeXEvent(xEvent); + + switch (event.type()) { + case WebEvent::MouseDown: + case WebEvent::MouseUp: + setXButtonEventFields(xEvent, event, m_frameRect.location()); + break; + case WebEvent::MouseMove: + setXMotionEventFields(xEvent, event, m_frameRect.location()); + break; + } + + return NPP_HandleEvent(&xEvent); +} + +// We undefine these constants in npruntime_internal.h to avoid collision +// with WebKit and platform headers. Values are defined in X.h. +const int kKeyPressType = 2; +const int kKeyReleaseType = 3; +const int kFocusInType = 9; +const int kFocusOutType = 10; + +bool NetscapePlugin::platformHandleWheelEvent(const WebWheelEvent&) +{ + notImplemented(); + return false; +} + +void NetscapePlugin::platformSetFocus(bool) +{ + notImplemented(); +} + +bool NetscapePlugin::platformHandleMouseEnterEvent(const WebMouseEvent& event) +{ + if (m_isWindowed) + return false; + + XEvent xEvent; + initializeXEvent(xEvent); + setXCrossingEventFields(xEvent, event, m_frameRect.location(), EnterNotify); + + return NPP_HandleEvent(&xEvent); +} + +bool NetscapePlugin::platformHandleMouseLeaveEvent(const WebMouseEvent& event) +{ + if (m_isWindowed) + return false; + + XEvent xEvent; + initializeXEvent(xEvent); + setXCrossingEventFields(xEvent, event, m_frameRect.location(), LeaveNotify); + + return NPP_HandleEvent(&xEvent); +} + +static inline void setXKeyEventFields(XEvent& xEvent, const WebKeyboardEvent& webEvent) +{ + xEvent.xany.type = (webEvent.type() == WebEvent::KeyDown) ? kKeyPressType : kKeyReleaseType; + XKeyEvent& xKey = xEvent.xkey; + xKey.root = rootWindowID(); + xKey.subwindow = 0; + xKey.time = xTimeStamp(webEvent.timestamp()); + xKey.state = xKeyModifiers(webEvent); + xKey.keycode = webEvent.nativeVirtualKeyCode(); + + xKey.same_screen = true; + + // Key events propagated to the plugin does not need to have position. + // source: https://developer.mozilla.org/en/NPEvent + xKey.x = 0; + xKey.y = 0; + xKey.x_root = 0; + xKey.y_root = 0; +} + +bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent& event) +{ + // We don't generate other types of keyboard events via WebEventFactory. + ASSERT(event.type() == WebEvent::KeyDown || event.type() == WebEvent::KeyUp); + + XEvent xEvent; + initializeXEvent(xEvent); + setXKeyEventFields(xEvent, event); + + return NPP_HandleEvent(&xEvent); +} + +} // namespace WebKit diff --git a/Source/WebKit2/WebProcess/Plugins/Plugin.h b/Source/WebKit2/WebProcess/Plugins/Plugin.h index 6afeb5c..83a0ff1 100644 --- a/Source/WebKit2/WebProcess/Plugins/Plugin.h +++ b/Source/WebKit2/WebProcess/Plugins/Plugin.h @@ -84,6 +84,9 @@ public: // If a plug-in is using the Core Animation drawing model, this returns its plug-in layer. virtual PlatformLayer* pluginLayer() = 0; #endif + + // Returns whether the plug-in is transparent or not. + virtual bool isTransparent() = 0; // Tells the plug-in that either the plug-ins frame rect or its clip rect has changed. Both rects are in window coordinates. virtual void geometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect) = 0; diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp b/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp index ef931c8..3d007a6 100644 --- a/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp +++ b/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp @@ -62,13 +62,14 @@ void PluginProcessConnection::removePluginProxy(PluginProxy* plugin) ASSERT(m_plugins.contains(plugin->pluginInstanceID())); m_plugins.remove(plugin->pluginInstanceID()); + // Invalidate all objects related to this plug-in. + m_npRemoteObjectMap->pluginDestroyed(plugin); + if (!m_plugins.isEmpty()) return; - // Invalidate our remote object map. - m_npRemoteObjectMap->invalidate(); - m_npRemoteObjectMap = 0; - + m_npRemoteObjectMap = nullptr; + // We have no more plug-ins, invalidate the connection to the plug-in process. ASSERT(m_connection); m_connection->invalidate(); diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp b/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp index f267d9e..fc8f552 100644 --- a/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp +++ b/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp @@ -132,7 +132,8 @@ void PluginProxy::paint(GraphicsContext* graphicsContext, const IntRect& dirtyRe // Blit the plug-in backing store into our own backing store. OwnPtr<WebCore::GraphicsContext> graphicsContext = m_backingStore->createGraphicsContext(); - + graphicsContext->setCompositeOperation(CompositeCopy); + m_pluginBackingStore->paint(*graphicsContext, IntPoint(), IntRect(0, 0, m_frameRect.width(), m_frameRect.height())); m_pluginBackingStoreContainsValidData = true; @@ -152,14 +153,20 @@ void PluginProxy::paint(GraphicsContext* graphicsContext, const IntRect& dirtyRe PassRefPtr<ShareableBitmap> PluginProxy::snapshot() { - IntSize bufferSize; - SharedMemory::Handle snapshotStoreHandle; - m_connection->connection()->sendSync(Messages::PluginControllerProxy::Snapshot(), Messages::PluginControllerProxy::Snapshot::Reply(bufferSize, snapshotStoreHandle), m_pluginInstanceID); + ShareableBitmap::Handle snapshotStoreHandle; + m_connection->connection()->sendSync(Messages::PluginControllerProxy::Snapshot(), Messages::PluginControllerProxy::Snapshot::Reply(snapshotStoreHandle), m_pluginInstanceID); - RefPtr<ShareableBitmap> snapshotBuffer = ShareableBitmap::create(bufferSize, snapshotStoreHandle); + RefPtr<ShareableBitmap> snapshotBuffer = ShareableBitmap::create(snapshotStoreHandle); return snapshotBuffer.release(); } +bool PluginProxy::isTransparent() +{ + // This should never be called from the web process. + ASSERT_NOT_REACHED(); + return false; +} + void PluginProxy::geometryDidChange(const IntRect& frameRect, const IntRect& clipRect) { ASSERT(m_isStarted); @@ -167,14 +174,14 @@ void PluginProxy::geometryDidChange(const IntRect& frameRect, const IntRect& cli m_frameRect = frameRect; if (!needsBackingStore()) { - SharedMemory::Handle pluginBackingStoreHandle; - m_connection->connection()->send(Messages::PluginControllerProxy::GeometryDidChange(frameRect, clipRect, pluginBackingStoreHandle), m_pluginInstanceID); + ShareableBitmap::Handle pluginBackingStoreHandle; + m_connection->connection()->send(Messages::PluginControllerProxy::GeometryDidChange(frameRect, clipRect, pluginBackingStoreHandle), m_pluginInstanceID, CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply); return; } bool didUpdateBackingStore = false; if (!m_backingStore) { - m_backingStore = ShareableBitmap::create(frameRect.size()); + m_backingStore = ShareableBitmap::create(frameRect.size(), ShareableBitmap::SupportsAlpha); didUpdateBackingStore = true; } else if (frameRect.size() != m_backingStore->size()) { // The backing store already exists, just resize it. @@ -184,24 +191,24 @@ void PluginProxy::geometryDidChange(const IntRect& frameRect, const IntRect& cli didUpdateBackingStore = true; } - SharedMemory::Handle pluginBackingStoreHandle; + ShareableBitmap::Handle pluginBackingStoreHandle; if (didUpdateBackingStore) { // Create a new plug-in backing store. - m_pluginBackingStore = ShareableBitmap::createShareable(frameRect.size()); + m_pluginBackingStore = ShareableBitmap::createShareable(frameRect.size(), ShareableBitmap::SupportsAlpha); if (!m_pluginBackingStore) return; // Create a handle to the plug-in backing store so we can send it over. if (!m_pluginBackingStore->createHandle(pluginBackingStoreHandle)) { - m_pluginBackingStore.clear(); + m_pluginBackingStore = nullptr; return; } m_pluginBackingStoreContainsValidData = false; } - m_connection->connection()->send(Messages::PluginControllerProxy::GeometryDidChange(frameRect, clipRect, pluginBackingStoreHandle), m_pluginInstanceID); + m_connection->connection()->send(Messages::PluginControllerProxy::GeometryDidChange(frameRect, clipRect, pluginBackingStoreHandle), m_pluginInstanceID, CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply); } void PluginProxy::frameDidFinishLoading(uint64_t requestID) @@ -319,7 +326,7 @@ NPObject* PluginProxy::pluginScriptableNPObject() if (!pluginScriptableNPObjectID) return 0; - return m_connection->npRemoteObjectMap()->createNPObjectProxy(pluginScriptableNPObjectID); + return m_connection->npRemoteObjectMap()->createNPObjectProxy(pluginScriptableNPObjectID, this); } #if PLATFORM(MAC) @@ -388,7 +395,7 @@ void PluginProxy::getWindowScriptNPObject(uint64_t& windowScriptNPObjectID) return; } - windowScriptNPObjectID = m_connection->npRemoteObjectMap()->registerNPObject(windowScriptNPObject); + windowScriptNPObjectID = m_connection->npRemoteObjectMap()->registerNPObject(windowScriptNPObject, this); releaseNPObject(windowScriptNPObject); } @@ -400,7 +407,7 @@ void PluginProxy::getPluginElementNPObject(uint64_t& pluginElementNPObjectID) return; } - pluginElementNPObjectID = m_connection->npRemoteObjectMap()->registerNPObject(pluginElementNPObject); + pluginElementNPObjectID = m_connection->npRemoteObjectMap()->registerNPObject(pluginElementNPObject, this); releaseNPObject(pluginElementNPObject); } @@ -408,16 +415,19 @@ void PluginProxy::evaluate(const NPVariantData& npObjectAsVariantData, const Str { PluginController::PluginDestructionProtector protector(m_pluginController); - NPVariant npObjectAsVariant = m_connection->npRemoteObjectMap()->npVariantDataToNPVariant(npObjectAsVariantData); - ASSERT(NPVARIANT_IS_OBJECT(npObjectAsVariant)); - + NPVariant npObjectAsVariant = m_connection->npRemoteObjectMap()->npVariantDataToNPVariant(npObjectAsVariantData, this); + if (!NPVARIANT_IS_OBJECT(npObjectAsVariant) || !(NPVARIANT_TO_OBJECT(npObjectAsVariant))) { + returnValue = false; + return; + } + NPVariant result; returnValue = m_pluginController->evaluate(NPVARIANT_TO_OBJECT(npObjectAsVariant), scriptString, &result, allowPopups); if (!returnValue) return; // Convert the NPVariant to an NPVariantData. - resultData = m_connection->npRemoteObjectMap()->npVariantToNPVariantData(result); + resultData = m_connection->npRemoteObjectMap()->npVariantToNPVariantData(result, this); // And release the result. releaseNPVariantValue(&result); @@ -458,7 +468,7 @@ void PluginProxy::update(const IntRect& paintedRect) if (m_backingStore) { // Blit the plug-in backing store into our own backing store. OwnPtr<GraphicsContext> graphicsContext = m_backingStore->createGraphicsContext(); - + graphicsContext->setCompositeOperation(CompositeCopy); m_pluginBackingStore->paint(*graphicsContext, paintedRectPluginCoordinates.location(), paintedRectPluginCoordinates); } diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProxy.h b/Source/WebKit2/WebProcess/Plugins/PluginProxy.h index 4fe99a7..bd55a9e 100644 --- a/Source/WebKit2/WebProcess/Plugins/PluginProxy.h +++ b/Source/WebKit2/WebProcess/Plugins/PluginProxy.h @@ -68,6 +68,7 @@ private: #if PLATFORM(MAC) virtual PlatformLayer* pluginLayer(); #endif + virtual bool isTransparent(); virtual void geometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect); virtual void frameDidFinishLoading(uint64_t requestID); virtual void frameDidFail(uint64_t requestID, bool wasCancelled); diff --git a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp index 3b1629d..ec770ec 100644 --- a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp +++ b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp @@ -825,6 +825,11 @@ void PluginView::invalidateRect(const IntRect& dirtyRect) if (!parent() || !m_plugin || !m_isInitialized) return; +#if PLATFORM(MAC) + if (m_plugin->pluginLayer()) + return; +#endif + IntRect dirtyRectInWindowCoordinates = convertToContainingWindow(dirtyRect); parent()->hostWindow()->invalidateContentsAndWindow(intersection(dirtyRectInWindowCoordinates, clipRectInWindowCoordinates()), false); @@ -926,11 +931,12 @@ NPObject* PluginView::pluginElementNPObject() bool PluginView::evaluate(NPObject* npObject, const String& scriptString, NPVariant* result, bool allowPopups) { - if (!frame()) + RefPtr<Frame> frame = m_pluginElement->document()->frame(); + if (!frame) return false; - bool oldAllowPopups = frame()->script()->allowPopupsFromPlugin(); - frame()->script()->setAllowPopupsFromPlugin(allowPopups); + bool oldAllowPopups = frame->script()->allowPopupsFromPlugin(); + frame->script()->setAllowPopupsFromPlugin(allowPopups); // Calling evaluate will run JavaScript that can potentially remove the plug-in element, so we need to // protect the plug-in view from destruction. @@ -938,7 +944,7 @@ bool PluginView::evaluate(NPObject* npObject, const String& scriptString, NPVari bool returnValue = m_npRuntimeObjectMap.evaluate(npObject, scriptString, result); - frame()->script()->setAllowPopupsFromPlugin(oldAllowPopups); + frame->script()->setAllowPopupsFromPlugin(oldAllowPopups); return returnValue; } diff --git a/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp b/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp index dad2791..1596319 100644 --- a/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp +++ b/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp @@ -93,6 +93,7 @@ void WebResourceCacheManager::getCacheOrigins(uint64_t callbackID) const } WebProcess::shared().connection()->send(Messages::WebResourceCacheManagerProxy::DidGetCacheOrigins(identifiers, callbackID), 0); + WebProcess::shared().terminateIfPossible(); } void WebResourceCacheManager::clearCacheForOrigin(SecurityOriginData originData) const @@ -110,11 +111,13 @@ void WebResourceCacheManager::clearCacheForOrigin(SecurityOriginData originData) clearCFURLCacheForHostNames(hostArray.get()); #endif + WebProcess::shared().terminateIfPossible(); } void WebResourceCacheManager::clearCacheForAllOrigins() const { WebProcess::shared().clearResourceCaches(); + WebProcess::shared().terminateIfPossible(); } } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp index d4c357d..becf48f 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp @@ -34,6 +34,7 @@ #include "WebCoreArgumentCoders.h" #include "WebFrame.h" #include "WebFrameLoaderClient.h" +#include "WebFullScreenManager.h" #include "WebOpenPanelParameters.h" #include "WebOpenPanelResultListener.h" #include "WebPage.h" @@ -51,6 +52,7 @@ #include <WebCore/FrameView.h> #include <WebCore/HTMLNames.h> #include <WebCore/HTMLPlugInImageElement.h> +#include <WebCore/Icon.h> #include <WebCore/NotImplemented.h> #include <WebCore/Page.h> #include <WebCore/SecurityOrigin.h> @@ -115,18 +117,17 @@ FloatRect WebChromeClient::pageRect() float WebChromeClient::scaleFactor() { - notImplemented(); - return 1.0; + return m_page->userSpaceScaleFactor(); } void WebChromeClient::focus() { - notImplemented(); + m_page->send(Messages::WebPageProxy::SetFocus(true)); } void WebChromeClient::unfocus() { - notImplemented(); + m_page->send(Messages::WebPageProxy::SetFocus(false)); } bool WebChromeClient::canTakeFocus(FocusDirection) @@ -373,7 +374,7 @@ void WebChromeClient::scroll(const IntSize& scrollOffset, const IntRect& scrollR } #if ENABLE(TILED_BACKING_STORE) -void WebChromeClient::delegatedScrollRequested(const IntSize& scrollOffset) +void WebChromeClient::delegatedScrollRequested(const IntPoint& scrollOffset) { m_page->pageDidRequestScroll(scrollOffset); } @@ -385,10 +386,9 @@ IntPoint WebChromeClient::screenToWindow(const IntPoint&) const return IntPoint(); } -IntRect WebChromeClient::windowToScreen(const IntRect&) const +IntRect WebChromeClient::windowToScreen(const IntRect& rect) const { - notImplemented(); - return IntRect(); + return m_page->windowToScreen(rect); } PlatformPageClient WebChromeClient::platformPageClient() const @@ -545,14 +545,13 @@ void WebChromeClient::paintCustomHighlight(Node*, const AtomicString& type, cons bool WebChromeClient::shouldReplaceWithGeneratedFileForUpload(const String& path, String& generatedFilename) { - notImplemented(); - return false; + generatedFilename = m_page->injectedBundleUIClient().shouldGenerateFileForUpload(m_page, path); + return !generatedFilename.isNull(); } String WebChromeClient::generateReplacementFile(const String& path) { - notImplemented(); - return String(); + return m_page->injectedBundleUIClient().generateFileForUpload(m_page, path); } bool WebChromeClient::paintCustomScrollbar(GraphicsContext*, const FloatRect&, ScrollbarControlSize, @@ -610,9 +609,9 @@ void WebChromeClient::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFile m_page->send(Messages::WebPageProxy::RunOpenPanel(static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame()->frameID(), parameters)); } -void WebChromeClient::chooseIconForFiles(const Vector<String>&, FileChooser*) +void WebChromeClient::chooseIconForFiles(const Vector<String>& filenames, FileChooser* chooser) { - notImplemented(); + chooser->iconLoaded(Icon::createIconForFiles(filenames)); } void WebChromeClient::setCursor(const WebCore::Cursor& cursor) @@ -639,12 +638,20 @@ void WebChromeClient::formDidBlur(const Node*) bool WebChromeClient::selectItemWritingDirectionIsNatural() { +#if PLATFORM(WIN) + return true; +#else return false; +#endif } bool WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection() { +#if PLATFORM(WIN) + return false; +#else return true; +#endif } PassRefPtr<WebCore::PopupMenu> WebChromeClient::createPopupMenu(WebCore::PopupMenuClient* client) const @@ -705,6 +712,29 @@ void WebChromeClient::setLastSetCursorToCurrentCursor() } #endif +#if ENABLE(FULLSCREEN_API) +bool WebChromeClient::supportsFullScreenForElement(const WebCore::Element* element, bool withKeyboard) +{ + return m_page->fullScreenManager()->supportsFullScreen(withKeyboard); +} + +void WebChromeClient::enterFullScreenForElement(WebCore::Element* element) +{ + m_page->fullScreenManager()->enterFullScreenForElement(element); +} + +void WebChromeClient::exitFullScreenForElement(WebCore::Element* element) +{ + m_page->fullScreenManager()->exitFullScreenForElement(element); +} + +void WebChromeClient::setRootFullScreenLayer(GraphicsLayer* layer) +{ + m_page->fullScreenManager()->setRootFullScreenLayer(layer); +} + +#endif + void WebChromeClient::dispatchViewportDataDidChange(const ViewportArguments& args) const { m_page->send(Messages::WebPageProxy::DidChangeViewportData(args)); diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h index 96da752..57e98c5 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h @@ -113,7 +113,7 @@ private: virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool); virtual void scroll(const WebCore::IntSize& scrollOffset, const WebCore::IntRect& scrollRect, const WebCore::IntRect& clipRect); #if ENABLE(TILED_BACKING_STORE) - virtual void delegatedScrollRequested(const WebCore::IntSize& scrollOffset); + virtual void delegatedScrollRequested(const WebCore::IntPoint& scrollOffset); #endif virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const; virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const; @@ -205,6 +205,13 @@ private: virtual void setLastSetCursorToCurrentCursor(); #endif +#if ENABLE(FULLSCREEN_API) + virtual bool supportsFullScreenForElement(const WebCore::Element*, bool withKeyboard); + virtual void enterFullScreenForElement(WebCore::Element*); + virtual void exitFullScreenForElement(WebCore::Element*); + virtual void setRootFullScreenLayer(WebCore::GraphicsLayer*); +#endif + virtual void dispatchViewportDataDidChange(const WebCore::ViewportArguments&) const; virtual void didCompleteRubberBandForMainFrame(const WebCore::IntSize&) const; diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp index caa6eda..825a448 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp @@ -105,6 +105,7 @@ void WebDatabaseManager::getDatabasesByOrigin(uint64_t callbackID) const } WebProcess::shared().connection()->send(Messages::WebDatabaseManagerProxy::DidGetDatabasesByOrigin(originAndDatabasesVector, callbackID), 0); + WebProcess::shared().terminateIfPossible(); } void WebDatabaseManager::getDatabaseOrigins(uint64_t callbackID) const @@ -118,6 +119,7 @@ void WebDatabaseManager::getDatabaseOrigins(uint64_t callbackID) const for (size_t i = 0; i < numOrigins; ++i) identifiers[i] = origins[i]->databaseIdentifier(); WebProcess::shared().connection()->send(Messages::WebDatabaseManagerProxy::DidGetDatabaseOrigins(identifiers, callbackID), 0); + WebProcess::shared().terminateIfPossible(); } void WebDatabaseManager::deleteDatabaseWithNameForOrigin(const String& databaseIdentifier, const String& originIdentifier) const @@ -127,6 +129,7 @@ void WebDatabaseManager::deleteDatabaseWithNameForOrigin(const String& databaseI return; DatabaseTracker::tracker().deleteDatabase(origin.get(), databaseIdentifier); + WebProcess::shared().terminateIfPossible(); } void WebDatabaseManager::deleteDatabasesForOrigin(const String& originIdentifier) const @@ -136,11 +139,13 @@ void WebDatabaseManager::deleteDatabasesForOrigin(const String& originIdentifier return; DatabaseTracker::tracker().deleteOrigin(origin.get()); + WebProcess::shared().terminateIfPossible(); } void WebDatabaseManager::deleteAllDatabases() const { DatabaseTracker::tracker().deleteAllDatabases(); + WebProcess::shared().terminateIfPossible(); } void WebDatabaseManager::setQuotaForOrigin(const String& originIdentifier, unsigned long long quota) const @@ -154,6 +159,7 @@ void WebDatabaseManager::setQuotaForOrigin(const String& originIdentifier, unsig return; DatabaseTracker::tracker().setQuota(origin.get(), quota); + WebProcess::shared().terminateIfPossible(); } void WebDatabaseManager::dispatchDidModifyOrigin(SecurityOrigin* origin) diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h index fa8426a..9200af0 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h @@ -141,11 +141,11 @@ private: virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&); -#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) - virtual void showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings, WebCore::Editor*); +#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) + virtual void showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings); virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel); - virtual bool isShowingCorrectionPanel(); - virtual void recordAutocorrectionResponse(AutocorrectionResponseType, const WTF::String& replacedString, const WTF::String& replacementString); + virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingCorrectionPanel); + virtual void recordAutocorrectionResponse(AutocorrectionResponseType, const String& replacedString, const String& replacementString); #endif WebPage* m_page; }; diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp index 3770ca6..fa3cdce 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -386,8 +386,10 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad() WebPage* webPage = m_frame->page(); if (!webPage) return; + webPage->findController().hideFindUI(); - + webPage->sandboxExtensionTracker().didStartProvisionalLoad(m_frame); + DocumentLoader* provisionalLoader = m_frame->coreFrame()->loader()->provisionalDocumentLoader(); const String& url = provisionalLoader->url().string(); RefPtr<APIObject> userData; @@ -395,12 +397,10 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad() // Notify the bundle client. webPage->injectedBundleLoaderClient().didStartProvisionalLoadForFrame(webPage, m_frame, userData); - bool loadingSubstituteDataForUnreachableURL = !provisionalLoader->unreachableURL().isNull(); - - webPage->sandboxExtensionTracker().didStartProvisionalLoad(m_frame); + String unreachableURL = provisionalLoader->unreachableURL().string(); // Notify the UIProcess. - webPage->send(Messages::WebPageProxy::DidStartProvisionalLoadForFrame(m_frame->frameID(), url, loadingSubstituteDataForUnreachableURL, InjectedBundleUserMessageEncoder(userData.get()))); + webPage->send(Messages::WebPageProxy::DidStartProvisionalLoadForFrame(m_frame->frameID(), url, unreachableURL, InjectedBundleUserMessageEncoder(userData.get()))); } void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title) @@ -653,7 +653,7 @@ void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFu (m_frame->coreFrame()->loader()->policyChecker()->*function)(PolicyUse); return; } - + uint64_t listenerID = m_frame->setUpPolicyListener(function); bool receivedPolicyAction; uint64_t policyAction; @@ -1086,6 +1086,11 @@ void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame*) void WebFrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame*) { + WebPage* webPage = m_frame->page(); + bool isMainFrame = webPage->mainFrame() == m_frame; + + const String& mimeType = m_frame->coreFrame()->loader()->documentLoader()->response().mimeType(); + m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForMIMEType(mimeType); } void WebFrameLoaderClient::transitionToCommittedForNewPage() @@ -1217,6 +1222,19 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugIn parameters.names[i] = paramNames[i].lower(); } +#if PLUGIN_ARCHITECTURE(X11) + if (equalIgnoringCase(mimeType, "application/x-shockwave-flash")) { + // Currently we don't support transparency and windowed mode. + // Inject wmode=opaque to make Flash work in these conditions. + size_t wmodeIndex = parameters.names.find("wmode"); + if (wmodeIndex == -1) { + parameters.names.append("wmode"); + parameters.values.append("opaque"); + } else if (equalIgnoringCase(parameters.values[wmodeIndex], "window")) + parameters.values[wmodeIndex] = "opaque"; + } +#endif + RefPtr<Plugin> plugin = webPage->createPlugin(parameters); if (!plugin) return 0; @@ -1237,27 +1255,58 @@ PassRefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& p return createPlugin(pluginSize, appletElement, KURL(), paramNames, paramValues, "application/x-java-applet", false); } -ObjectContentType WebFrameLoaderClient::objectContentType(const KURL& url, const String& mimeTypeIn) +static bool pluginSupportsExtension(PluginData* pluginData, const String& extension) +{ + ASSERT(extension.lower() == extension); + + for (size_t i = 0; i < pluginData->mimes().size(); ++i) { + const MimeClassInfo& mimeClassInfo = pluginData->mimes()[i]; + + if (mimeClassInfo.extensions.contains(extension)) + return true; + } + return false; +} + +ObjectContentType WebFrameLoaderClient::objectContentType(const KURL& url, const String& mimeTypeIn, bool shouldPreferPlugInsForImages) { // FIXME: This should be merged with WebCore::FrameLoader::defaultObjectContentType when the plugin code // is consolidated. String mimeType = mimeTypeIn; - if (mimeType.isEmpty()) - mimeType = MIMETypeRegistry::getMIMETypeForExtension(url.path().substring(url.path().reverseFind('.') + 1)); + if (mimeType.isEmpty()) { + String extension = url.path().substring(url.path().reverseFind('.') + 1).lower(); + + // Try to guess the MIME type from the extension. + mimeType = MIMETypeRegistry::getMIMETypeForExtension(extension); + + if (mimeType.isEmpty()) { + // Check if there's a plug-in around that can handle the extension. + if (WebPage* webPage = m_frame->page()) { + if (PluginData* pluginData = webPage->corePage()->pluginData()) { + if (pluginSupportsExtension(pluginData, extension)) + return ObjectContentNetscapePlugin; + } + } + } + } if (mimeType.isEmpty()) return ObjectContentFrame; - if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType)) - return WebCore::ObjectContentImage; - + bool plugInSupportsMIMEType = false; if (WebPage* webPage = m_frame->page()) { if (PluginData* pluginData = webPage->corePage()->pluginData()) { if (pluginData->supportsMimeType(mimeType)) - return ObjectContentNetscapePlugin; + plugInSupportsMIMEType = true; } } + + if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType)) + return shouldPreferPlugInsForImages && plugInSupportsMIMEType ? ObjectContentNetscapePlugin : ObjectContentImage; + + if (plugInSupportsMIMEType) + return ObjectContentNetscapePlugin; if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)) return ObjectContentFrame; diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h index 9ca9a75..1948541 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -191,7 +191,7 @@ private: virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues); - virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const String& mimeType); + virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL&, const String& mimeType, bool shouldPreferPlugInsForImages); virtual String overrideMediaType() const; virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*); diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp index 7e14701..9cb6bec 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp @@ -33,60 +33,16 @@ #include "WebCookieManager.h" #include "WebCoreArgumentCoders.h" #include "WebProcess.h" -#include <WebCore/LocalizedStrings.h> -#include <WebCore/NotImplemented.h> #include <WebCore/Page.h> -#include <WebCore/PageGroup.h> -#include <wtf/MathExtras.h> -#include <wtf/text/CString.h> #if USE(CF) #include <wtf/RetainPtr.h> #endif -#if PLATFORM(MAC) - -#define UI_STRING(string, description) localizedString(string) -#define UI_STRING_KEY(string, key, description) localizedString(key) - -#else - -#define UI_STRING(string, description) String::fromUTF8(string, strlen(string)) -#define UI_STRING_KEY(string, key, description) String::fromUTF8(string, strlen(string)) - -#endif - using namespace WebCore; namespace WebKit { -// We can't use String::format for two reasons: -// 1) It doesn't handle non-ASCII characters in the format string. -// 2) It doesn't handle the %2$d syntax. -// Note that because |format| is used as the second parameter to va_start, it cannot be a reference -// type according to section 18.7/3 of the C++ N1905 standard. -static String formatLocalizedString(String format, ...) -{ -#if USE(CF) - va_list arguments; - va_start(arguments, format); - RetainPtr<CFStringRef> formatCFString(AdoptCF, format.createCFString()); - RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormatAndArguments(0, 0, formatCFString.get(), arguments)); - va_end(arguments); - return result.get(); -#elif PLATFORM(QT) - va_list arguments; - va_start(arguments, format); - QString result; - result.vsprintf(format.latin1().data(), arguments); - va_end(arguments); - return result; -#else - notImplemented(); - return format; -#endif -} - void WebPlatformStrategies::initialize() { DEFINE_STATIC_LOCAL(WebPlatformStrategies, platformStrategies, ()); @@ -109,11 +65,6 @@ PluginStrategy* WebPlatformStrategies::createPluginStrategy() return this; } -LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy() -{ - return this; -} - VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy() { return this; @@ -128,25 +79,6 @@ void WebPlatformStrategies::notifyCookiesChanged() // PluginStrategy -void WebPlatformStrategies::populatePluginCache() -{ - if (m_pluginCacheIsPopulated) - return; - - ASSERT(m_cachedPlugins.isEmpty()); - - Vector<PluginInfo> plugins; - - // FIXME: Should we do something in case of error here? - WebProcess::shared().connection()->sendSync(Messages::WebContext::GetPlugins(m_shouldRefreshPlugins), - Messages::WebContext::GetPlugins::Reply(plugins), 0); - - m_cachedPlugins.swap(plugins); - - m_shouldRefreshPlugins = false; - m_pluginCacheIsPopulated = true; -} - void WebPlatformStrategies::refreshPlugins() { m_cachedPlugins.clear(); @@ -162,777 +94,27 @@ void WebPlatformStrategies::getPluginInfo(const WebCore::Page*, Vector<WebCore:: plugins = m_cachedPlugins; } -// LocalizationStrategy - -String WebPlatformStrategies::inputElementAltText() -{ - return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value"); -} - -String WebPlatformStrategies::resetButtonDefaultLabel() -{ - return UI_STRING("Reset", "default label for Reset buttons in forms on web pages"); -} - -String WebPlatformStrategies::searchableIndexIntroduction() -{ - return UI_STRING("This is a searchable index. Enter search keywords: ", - "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'"); -} - -String WebPlatformStrategies::submitButtonDefaultLabel() -{ - return UI_STRING("Submit", "default label for Submit buttons in forms on web pages"); -} - -String WebPlatformStrategies::fileButtonChooseFileLabel() -{ - return UI_STRING("Choose File", "title for file button used in HTML forms"); -} - -String WebPlatformStrategies::fileButtonNoFileSelectedLabel() -{ - return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected"); -} - -String WebPlatformStrategies::defaultDetailsSummaryText() -{ - return UI_STRING("Details", "text to display in <details> tag when it has no <summary> child"); -} - -#if PLATFORM(MAC) -String WebPlatformStrategies::copyImageUnknownFileLabel() -{ - return UI_STRING("unknown", "Unknown filename"); -} -#endif - -#if ENABLE(CONTEXT_MENUS) - -String WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow() -{ - return UI_STRING("Open Link in New Window", "Open in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk() -{ - return UI_STRING("Download Linked File", "Download Linked File context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard() -{ - return UI_STRING("Copy Link", "Copy Link context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow() -{ - return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk() -{ - return UI_STRING("Download Image", "Download Image context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard() -{ - return UI_STRING("Copy Image", "Copy Image context menu item"); -} - -#if PLATFORM(QT) -String WebPlatformStrategies::contextMenuItemTagCopyImageUrlToClipboard() -{ - return UI_STRING("Copy Image Address", "Copy Image Address menu item"); -} -#endif - -String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow() -{ - return UI_STRING("Open Video in New Window", "Open Video in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow() -{ - return UI_STRING("Open Audio in New Window", "Open Audio in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard() -{ - return UI_STRING("Copy Video Address", "Copy Video Address Location context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard() -{ - return UI_STRING("Copy Audio Address", "Copy Audio Address Location context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagToggleMediaControls() -{ - return UI_STRING("Controls", "Media Controls context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagToggleMediaLoop() -{ - return UI_STRING("Loop", "Media Loop context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen() -{ - return UI_STRING("Enter Fullscreen", "Video Enter Fullscreen context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMediaPlay() -{ - return UI_STRING("Play", "Media Play context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMediaPause() -{ - return UI_STRING("Pause", "Media Pause context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMediaMute() -{ - return UI_STRING("Mute", "Media Mute context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow() -{ - return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopy() -{ - return UI_STRING("Copy", "Copy context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagGoBack() -{ - return UI_STRING("Back", "Back context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagGoForward() -{ - return UI_STRING("Forward", "Forward context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagStop() -{ - return UI_STRING("Stop", "Stop context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagReload() -{ - return UI_STRING("Reload", "Reload context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCut() -{ - return UI_STRING("Cut", "Cut context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagPaste() -{ - return UI_STRING("Paste", "Paste context menu item"); -} - -#if PLATFORM(GTK) - -String WebPlatformStrategies::contextMenuItemTagDelete() -{ - notImplemented(); - return "Delete"; -} - -String WebPlatformStrategies::contextMenuItemTagInputMethods() -{ - notImplemented(); - return "Input Methods"; -} - -String WebPlatformStrategies::contextMenuItemTagUnicode() -{ - notImplemented(); - return "Unicode"; -} - -#endif - -#if PLATFORM(GTK) || PLATFORM(QT) - -String WebPlatformStrategies::contextMenuItemTagSelectAll() -{ - notImplemented(); - return "Select All"; -} - -#endif - -String WebPlatformStrategies::contextMenuItemTagNoGuessesFound() -{ - return UI_STRING("No Guesses Found", "No Guesses Found context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagIgnoreSpelling() -{ - return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagLearnSpelling() -{ - return UI_STRING("Learn Spelling", "Learn Spelling context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSearchWeb() -{ - return UI_STRING("Search in Google", "Search in Google context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagLookUpInDictionary() -{ - return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenLink() -{ - return UI_STRING("Open Link", "Open Link context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagIgnoreGrammar() -{ - return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSpellingMenu() -{ - return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagShowSpellingPanel(bool show) -{ - if (show) - return UI_STRING("Show Spelling and Grammar", "menu item title"); - return UI_STRING("Hide Spelling and Grammar", "menu item title"); -} - -String WebPlatformStrategies::contextMenuItemTagCheckSpelling() -{ - return UI_STRING("Check Document Now", "Check spelling context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping() -{ - return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling() -{ - return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagFontMenu() -{ - return UI_STRING("Font", "Font context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagBold() -{ - return UI_STRING("Bold", "Bold context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagItalic() -{ - return UI_STRING("Italic", "Italic context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagUnderline() -{ - return UI_STRING("Underline", "Underline context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOutline() -{ - return UI_STRING("Outline", "Outline context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu() -{ - return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagTextDirectionMenu() -{ - return UI_STRING("Selection Direction", "Selection direction context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagDefaultDirection() -{ - return UI_STRING("Default", "Default writing direction context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagLeftToRight() -{ - return UI_STRING("Left to Right", "Left to Right context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagRightToLeft() -{ - return UI_STRING("Right to Left", "Right to Left context menu item"); -} - -#if PLATFORM(MAC) - -String WebPlatformStrategies::contextMenuItemTagSearchInSpotlight() -{ - return UI_STRING("Search in Spotlight", "Search in Spotlight context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagShowFonts() -{ - return UI_STRING("Show Fonts", "Show fonts context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagStyles() -{ - return UI_STRING("Styles...", "Styles context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagShowColors() -{ - return UI_STRING("Show Colors", "Show colors context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSpeechMenu() -{ - return UI_STRING("Speech", "Speech context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagStartSpeaking() -{ - return UI_STRING("Start Speaking", "Start speaking context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagStopSpeaking() -{ - return UI_STRING("Stop Speaking", "Stop speaking context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCorrectSpellingAutomatically() -{ - return UI_STRING("Correct Spelling Automatically", "Correct Spelling Automatically context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSubstitutionsMenu() -{ - return UI_STRING("Substitutions", "Substitutions context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagShowSubstitutions(bool show) -{ - if (show) - return UI_STRING("Show Substitutions", "menu item title"); - return UI_STRING("Hide Substitutions", "menu item title"); -} - -String WebPlatformStrategies::contextMenuItemTagSmartCopyPaste() -{ - return UI_STRING("Smart Copy/Paste", "Smart Copy/Paste context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSmartQuotes() -{ - return UI_STRING("Smart Quotes", "Smart Quotes context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSmartDashes() -{ - return UI_STRING("Smart Dashes", "Smart Dashes context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSmartLinks() -{ - return UI_STRING("Smart Links", "Smart Links context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagTextReplacement() -{ - return UI_STRING("Text Replacement", "Text Replacement context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagTransformationsMenu() -{ - return UI_STRING("Transformations", "Transformations context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMakeUpperCase() -{ - return UI_STRING("Make Upper Case", "Make Upper Case context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMakeLowerCase() -{ - return UI_STRING("Make Lower Case", "Make Lower Case context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCapitalize() -{ - return UI_STRING("Capitalize", "Capitalize context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagChangeBack(const String& replacedString) -{ - notImplemented(); - return replacedString; -} - -#endif - -String WebPlatformStrategies::contextMenuItemTagInspectElement() -{ - return UI_STRING("Inspect Element", "Inspect Element context menu item"); -} - -#endif // ENABLE(CONTEXT_MENUS) - -String WebPlatformStrategies::searchMenuNoRecentSearchesText() -{ - return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed"); -} - -String WebPlatformStrategies::searchMenuRecentSearchesText() -{ - return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title"); -} - -String WebPlatformStrategies::searchMenuClearRecentSearchesText() -{ - return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents"); -} - -String WebPlatformStrategies::AXWebAreaText() -{ - return UI_STRING("HTML content", "accessibility role description for web area"); -} - -String WebPlatformStrategies::AXLinkText() -{ - return UI_STRING("link", "accessibility role description for link"); -} - -String WebPlatformStrategies::AXListMarkerText() -{ - return UI_STRING("list marker", "accessibility role description for list marker"); -} - -String WebPlatformStrategies::AXImageMapText() -{ - return UI_STRING("image map", "accessibility role description for image map"); -} - -String WebPlatformStrategies::AXHeadingText() -{ - return UI_STRING("heading", "accessibility role description for headings"); -} - -String WebPlatformStrategies::AXDefinitionListTermText() -{ - return UI_STRING("term", "term word of a definition"); -} - -String WebPlatformStrategies::AXDefinitionListDefinitionText() -{ - return UI_STRING("definition", "definition phrase"); -} - -#if PLATFORM(MAC) -String WebPlatformStrategies::AXARIAContentGroupText(const String& ariaType) -{ - if (ariaType == "ARIAApplicationAlert") - return UI_STRING("alert", "An ARIA accessibility group that acts as an alert."); - if (ariaType == "ARIAApplicationAlertDialog") - return UI_STRING("alert dialog", "An ARIA accessibility group that acts as an alert dialog."); - if (ariaType == "ARIAApplicationDialog") - return UI_STRING("dialog", "An ARIA accessibility group that acts as an dialog."); - if (ariaType == "ARIAApplicationLog") - return UI_STRING("log", "An ARIA accessibility group that acts as a console log."); - if (ariaType == "ARIAApplicationMarquee") - return UI_STRING("marquee", "An ARIA accessibility group that acts as a marquee."); - if (ariaType == "ARIAApplicationStatus") - return UI_STRING("application status", "An ARIA accessibility group that acts as a status update."); - if (ariaType == "ARIAApplicationTimer") - return UI_STRING("timer", "An ARIA accessibility group that acts as an updating timer."); - if (ariaType == "ARIADocument") - return UI_STRING("document", "An ARIA accessibility group that acts as a document."); - if (ariaType == "ARIADocumentArticle") - return UI_STRING("article", "An ARIA accessibility group that acts as an article."); - if (ariaType == "ARIADocumentNote") - return UI_STRING("note", "An ARIA accessibility group that acts as a note in a document."); - if (ariaType == "ARIADocumentRegion") - return UI_STRING("region", "An ARIA accessibility group that acts as a distinct region in a document."); - if (ariaType == "ARIALandmarkApplication") - return UI_STRING("application", "An ARIA accessibility group that acts as an application."); - if (ariaType == "ARIALandmarkBanner") - return UI_STRING("banner", "An ARIA accessibility group that acts as a banner."); - if (ariaType == "ARIALandmarkComplementary") - return UI_STRING("complementary", "An ARIA accessibility group that acts as a region of complementary information."); - if (ariaType == "ARIALandmarkContentInfo") - return UI_STRING("content", "An ARIA accessibility group that contains content."); - if (ariaType == "ARIALandmarkMain") - return UI_STRING("main", "An ARIA accessibility group that is the main portion of the website."); - if (ariaType == "ARIALandmarkNavigation") - return UI_STRING("navigation", "An ARIA accessibility group that contains the main navigation elements of a website."); - if (ariaType == "ARIALandmarkSearch") - return UI_STRING("search", "An ARIA accessibility group that contains a search feature of a website."); - if (ariaType == "ARIAUserInterfaceTooltip") - return UI_STRING("tooltip", "An ARIA accessibility group that acts as a tooltip."); - if (ariaType == "ARIATabPanel") - return UI_STRING("tab panel", "An ARIA accessibility group that contains the content of a tab."); - if (ariaType == "ARIADocumentMath") - return UI_STRING("math", "An ARIA accessibility group that contains mathematical symbols."); - return String(); -} -#endif - -String WebPlatformStrategies::AXButtonActionVerb() -{ - return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility"); -} - -String WebPlatformStrategies::AXRadioButtonActionVerb() -{ - return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::AXTextFieldActionVerb() -{ - return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility"); -} - -String WebPlatformStrategies::AXCheckedCheckBoxActionVerb() -{ - return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::AXUncheckedCheckBoxActionVerb() -{ - return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::AXMenuListActionVerb() -{ - notImplemented(); - return "select"; -} - -String WebPlatformStrategies::AXMenuListPopupActionVerb() -{ - notImplemented(); - return "select"; -} - -String WebPlatformStrategies::AXLinkActionVerb() -{ - return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::missingPluginText() -{ - return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing"); -} - -String WebPlatformStrategies::crashedPluginText() -{ - return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed"); -} - -String WebPlatformStrategies::multipleFileUploadText(unsigned numberOfFiles) -{ - return formatLocalizedString(UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles); -} - -String WebPlatformStrategies::unknownFileSizeText() -{ - return UI_STRING("Unknown", "Unknown filesize FTP directory listing item"); -} - -#if PLATFORM(WIN) - -String WebPlatformStrategies::uploadFileText() -{ - notImplemented(); - return "upload"; -} - -String WebPlatformStrategies::allFilesText() -{ - notImplemented(); - return "all files"; -} - -#endif - -String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size) -{ - // FIXME: This should format the numbers correctly. In Mac WebKit, we used +[NSNumberFormatter localizedStringFromNumber:numberStyle:]. - return formatLocalizedString(UI_STRING("<filename> %d×%d pixels", "window title suffix for a standalone image (uses multiplication symbol, not x)"), size.width(), size.height()).replace("<filename>", filename); -} - -String WebPlatformStrategies::mediaElementLoadingStateText() -{ - return UI_STRING("Loading...", "Media controller status message when the media is loading"); -} - -String WebPlatformStrategies::mediaElementLiveBroadcastStateText() -{ - return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast"); -} - -String WebPlatformStrategies::localizedMediaControlElementString(const String& name) -{ - if (name == "AudioElement") - return UI_STRING("audio element controller", "accessibility role description for audio element controller"); - if (name == "VideoElement") - return UI_STRING("video element controller", "accessibility role description for video element controller"); - if (name == "MuteButton") - return UI_STRING("mute", "accessibility role description for mute button"); - if (name == "UnMuteButton") - return UI_STRING("unmute", "accessibility role description for turn mute off button"); - if (name == "PlayButton") - return UI_STRING("play", "accessibility role description for play button"); - if (name == "PauseButton") - return UI_STRING("pause", "accessibility role description for pause button"); - if (name == "Slider") - return UI_STRING("movie time", "accessibility role description for timeline slider"); - if (name == "SliderThumb") - return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb"); - if (name == "RewindButton") - return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button"); - if (name == "ReturnToRealtimeButton") - return UI_STRING("return to realtime", "accessibility role description for return to real time button"); - if (name == "CurrentTimeDisplay") - return UI_STRING("elapsed time", "accessibility role description for elapsed time display"); - if (name == "TimeRemainingDisplay") - return UI_STRING("remaining time", "accessibility role description for time remaining display"); - if (name == "StatusDisplay") - return UI_STRING("status", "accessibility role description for movie status"); - if (name == "FullscreenButton") - return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button"); - if (name == "SeekForwardButton") - return UI_STRING("fast forward", "accessibility role description for fast forward button"); - if (name == "SeekBackButton") - return UI_STRING("fast reverse", "accessibility role description for fast reverse button"); - if (name == "ShowClosedCaptionsButton") - return UI_STRING("show closed captions", "accessibility role description for show closed captions button"); - if (name == "HideClosedCaptionsButton") - return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button"); - - // FIXME: the ControlsPanel container should never be visible in the accessibility hierarchy. - if (name == "ControlsPanel") - return String(); - - ASSERT_NOT_REACHED(); - return String(); -} - -String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name) -{ - if (name == "AudioElement") - return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller"); - if (name == "VideoElement") - return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller"); - if (name == "MuteButton") - return UI_STRING("mute audio tracks", "accessibility help text for mute button"); - if (name == "UnMuteButton") - return UI_STRING("unmute audio tracks", "accessibility help text for un mute button"); - if (name == "PlayButton") - return UI_STRING("begin playback", "accessibility help text for play button"); - if (name == "PauseButton") - return UI_STRING("pause playback", "accessibility help text for pause button"); - if (name == "Slider") - return UI_STRING("movie time scrubber", "accessibility help text for timeline slider"); - if (name == "SliderThumb") - return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb"); - if (name == "RewindButton") - return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button"); - if (name == "ReturnToRealtimeButton") - return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button"); - if (name == "CurrentTimeDisplay") - return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display"); - if (name == "TimeRemainingDisplay") - return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display"); - if (name == "StatusDisplay") - return UI_STRING("current movie status", "accessibility help text for movie status display"); - if (name == "SeekBackButton") - return UI_STRING("seek quickly back", "accessibility help text for fast rewind button"); - if (name == "SeekForwardButton") - return UI_STRING("seek quickly forward", "accessibility help text for fast forward button"); - if (name == "FullscreenButton") - return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button"); - if (name == "ShowClosedCaptionsButton") - return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button"); - if (name == "HideClosedCaptionsButton") - return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button"); - - ASSERT_NOT_REACHED(); - return String(); -} - -String WebPlatformStrategies::localizedMediaTimeDescription(float time) -{ - if (!isfinite(time)) - return UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value"); - - int seconds = static_cast<int>(fabsf(time)); - int days = seconds / (60 * 60 * 24); - int hours = seconds / (60 * 60); - int minutes = (seconds / 60) % 60; - seconds %= 60; - - if (days) - return formatLocalizedString(UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds); - if (hours) - return formatLocalizedString(UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds); - if (minutes) - return formatLocalizedString(UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds); - return formatLocalizedString(UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds); -} - -String WebPlatformStrategies::validationMessageValueMissingText() -{ - return UI_STRING("value missing", "Validation message for required form control elements that have no value"); -} - -String WebPlatformStrategies::validationMessageTypeMismatchText() -{ - return UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type"); -} - -String WebPlatformStrategies::validationMessagePatternMismatchText() -{ - return UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern"); -} - -String WebPlatformStrategies::validationMessageTooLongText() -{ - return UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length"); -} - -String WebPlatformStrategies::validationMessageRangeUnderflowText() +void WebPlatformStrategies::populatePluginCache() { - return UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum"); -} + if (m_pluginCacheIsPopulated) + return; -String WebPlatformStrategies::validationMessageRangeOverflowText() -{ - return UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum"); -} + ASSERT(m_cachedPlugins.isEmpty()); + + Vector<PluginInfo> plugins; + + // FIXME: Should we do something in case of error here? + WebProcess::shared().connection()->sendSync(Messages::WebContext::GetPlugins(m_shouldRefreshPlugins), + Messages::WebContext::GetPlugins::Reply(plugins), 0); -String WebPlatformStrategies::validationMessageStepMismatchText() -{ - return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute"); + m_cachedPlugins.swap(plugins); + + m_shouldRefreshPlugins = false; + m_pluginCacheIsPopulated = true; } // VisitedLinkStrategy + bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash linkHash) { return WebProcess::shared().isLinkVisited(linkHash); diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h index 92f8236..55285de 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h @@ -31,12 +31,11 @@ #include <WebCore/CookiesStrategy.h> #include <WebCore/PlatformStrategies.h> #include <WebCore/PluginStrategy.h> -#include <WebCore/LocalizationStrategy.h> #include <WebCore/VisitedLinkStrategy.h> namespace WebKit { -class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy { +class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::VisitedLinkStrategy { public: static void initialize(); @@ -46,7 +45,6 @@ private: // WebCore::PlatformStrategies virtual WebCore::CookiesStrategy* createCookiesStrategy(); virtual WebCore::PluginStrategy* createPluginStrategy(); - virtual WebCore::LocalizationStrategy* createLocalizationStrategy(); virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy(); // WebCore::CookiesStrategy @@ -55,152 +53,15 @@ private: // WebCore::PluginStrategy virtual void refreshPlugins(); virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&); - - // WebCore::LocalizationStrategy - virtual String inputElementAltText(); - virtual String resetButtonDefaultLabel(); - virtual String searchableIndexIntroduction(); - virtual String submitButtonDefaultLabel(); - virtual String fileButtonChooseFileLabel(); - virtual String fileButtonNoFileSelectedLabel(); - virtual String defaultDetailsSummaryText(); -#if PLATFORM(MAC) - virtual String copyImageUnknownFileLabel(); -#endif -#if ENABLE(CONTEXT_MENUS) - virtual String contextMenuItemTagOpenLinkInNewWindow(); - virtual String contextMenuItemTagDownloadLinkToDisk(); - virtual String contextMenuItemTagCopyLinkToClipboard(); - virtual String contextMenuItemTagOpenImageInNewWindow(); - virtual String contextMenuItemTagDownloadImageToDisk(); - virtual String contextMenuItemTagCopyImageToClipboard(); -#if PLATFORM(QT) - virtual String contextMenuItemTagCopyImageUrlToClipboard(); -#endif - virtual String contextMenuItemTagOpenFrameInNewWindow(); - virtual String contextMenuItemTagCopy(); - virtual String contextMenuItemTagGoBack(); - virtual String contextMenuItemTagGoForward(); - virtual String contextMenuItemTagStop(); - virtual String contextMenuItemTagReload(); - virtual String contextMenuItemTagCut(); - virtual String contextMenuItemTagPaste(); -#if PLATFORM(GTK) - virtual String contextMenuItemTagDelete(); - virtual String contextMenuItemTagInputMethods(); - virtual String contextMenuItemTagUnicode(); -#endif -#if PLATFORM(GTK) || PLATFORM(QT) - virtual String contextMenuItemTagSelectAll(); -#endif - virtual String contextMenuItemTagNoGuessesFound(); - virtual String contextMenuItemTagIgnoreSpelling(); - virtual String contextMenuItemTagLearnSpelling(); - virtual String contextMenuItemTagSearchWeb(); - virtual String contextMenuItemTagLookUpInDictionary(); - virtual String contextMenuItemTagOpenLink(); - virtual String contextMenuItemTagIgnoreGrammar(); - virtual String contextMenuItemTagSpellingMenu(); - virtual String contextMenuItemTagShowSpellingPanel(bool show); - virtual String contextMenuItemTagCheckSpelling(); - virtual String contextMenuItemTagCheckSpellingWhileTyping(); - virtual String contextMenuItemTagCheckGrammarWithSpelling(); - virtual String contextMenuItemTagFontMenu(); - virtual String contextMenuItemTagBold(); - virtual String contextMenuItemTagItalic(); - virtual String contextMenuItemTagUnderline(); - virtual String contextMenuItemTagOutline(); - virtual String contextMenuItemTagWritingDirectionMenu(); - virtual String contextMenuItemTagTextDirectionMenu(); - virtual String contextMenuItemTagDefaultDirection(); - virtual String contextMenuItemTagLeftToRight(); - virtual String contextMenuItemTagRightToLeft(); -#if PLATFORM(MAC) - virtual String contextMenuItemTagSearchInSpotlight(); - virtual String contextMenuItemTagShowFonts(); - virtual String contextMenuItemTagStyles(); - virtual String contextMenuItemTagShowColors(); - virtual String contextMenuItemTagSpeechMenu(); - virtual String contextMenuItemTagStartSpeaking(); - virtual String contextMenuItemTagStopSpeaking(); - virtual String contextMenuItemTagCorrectSpellingAutomatically(); - virtual String contextMenuItemTagSubstitutionsMenu(); - virtual String contextMenuItemTagShowSubstitutions(bool show); - virtual String contextMenuItemTagSmartCopyPaste(); - virtual String contextMenuItemTagSmartQuotes(); - virtual String contextMenuItemTagSmartDashes(); - virtual String contextMenuItemTagSmartLinks(); - virtual String contextMenuItemTagTextReplacement(); - virtual String contextMenuItemTagTransformationsMenu(); - virtual String contextMenuItemTagMakeUpperCase(); - virtual String contextMenuItemTagMakeLowerCase(); - virtual String contextMenuItemTagCapitalize(); - virtual String contextMenuItemTagChangeBack(const String& replacedString); -#endif - virtual String contextMenuItemTagInspectElement(); - virtual String contextMenuItemTagOpenVideoInNewWindow(); - virtual String contextMenuItemTagOpenAudioInNewWindow(); - virtual String contextMenuItemTagCopyVideoLinkToClipboard(); - virtual String contextMenuItemTagCopyAudioLinkToClipboard(); - virtual String contextMenuItemTagToggleMediaControls(); - virtual String contextMenuItemTagToggleMediaLoop(); - virtual String contextMenuItemTagEnterVideoFullscreen(); - virtual String contextMenuItemTagMediaPlay(); - virtual String contextMenuItemTagMediaPause(); - virtual String contextMenuItemTagMediaMute(); -#endif // ENABLE(CONTEXT_MENUS) - virtual String searchMenuNoRecentSearchesText(); - virtual String searchMenuRecentSearchesText(); - virtual String searchMenuClearRecentSearchesText(); - virtual String AXWebAreaText(); - virtual String AXLinkText(); - virtual String AXListMarkerText(); - virtual String AXImageMapText(); - virtual String AXHeadingText(); - virtual String AXDefinitionListTermText(); - virtual String AXDefinitionListDefinitionText(); -#if PLATFORM(MAC) - virtual String AXARIAContentGroupText(const String& ariaType); -#endif - virtual String AXButtonActionVerb(); - virtual String AXRadioButtonActionVerb(); - virtual String AXTextFieldActionVerb(); - virtual String AXCheckedCheckBoxActionVerb(); - virtual String AXUncheckedCheckBoxActionVerb(); - virtual String AXMenuListActionVerb(); - virtual String AXMenuListPopupActionVerb(); - virtual String AXLinkActionVerb(); - virtual String missingPluginText(); - virtual String crashedPluginText(); - virtual String multipleFileUploadText(unsigned numberOfFiles); - virtual String unknownFileSizeText(); -#if PLATFORM(WIN) - virtual String uploadFileText(); - virtual String allFilesText(); -#endif - virtual String imageTitle(const String& filename, const WebCore::IntSize& size); - virtual String mediaElementLoadingStateText(); - virtual String mediaElementLiveBroadcastStateText(); - virtual String localizedMediaControlElementString(const String&); - virtual String localizedMediaControlElementHelpText(const String&); - virtual String localizedMediaTimeDescription(float); - virtual String validationMessageValueMissingText(); - virtual String validationMessageTypeMismatchText(); - virtual String validationMessagePatternMismatchText(); - virtual String validationMessageTooLongText(); - virtual String validationMessageRangeUnderflowText(); - virtual String validationMessageRangeOverflowText(); - virtual String validationMessageStepMismatchText(); - void populatePluginCache(); - bool m_pluginCacheIsPopulated; - bool m_shouldRefreshPlugins; - Vector<WebCore::PluginInfo> m_cachedPlugins; - // WebCore::VisitedLinkStrategy virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash); virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash); + + bool m_pluginCacheIsPopulated; + bool m_shouldRefreshPlugins; + Vector<WebCore::PluginInfo> m_cachedPlugins; }; } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm index 7d91c56..6aa83f8 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm +++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm @@ -41,11 +41,7 @@ namespace WebKit { void WebContextMenuClient::lookUpInDictionary(Frame* frame) { - RefPtr<Range> selectedRange = frame->selection()->selection().toNormalizedRange(); - if (!selectedRange) - return; - - m_page->performDictionaryLookupForRange(DictionaryPopupInfo::ContextMenu, frame, selectedRange.get()); + m_page->performDictionaryLookupForSelection(DictionaryPopupInfo::ContextMenu, frame, frame->selection()->selection()); } bool WebContextMenuClient::isSpeaking() diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm index ae9cec3..75d92e2 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm +++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm @@ -32,134 +32,273 @@ #import "WebPage.h" #import "WebPageProxyMessages.h" #import <WebCore/CachedImage.h> -#import <WebCore/DOMPrivate.h> #import <WebCore/DOMElementInternal.h> +#import <WebCore/DOMPrivate.h> +#import <WebCore/DragController.h> #import <WebCore/FrameView.h> #import <WebCore/GraphicsContext.h> #import <WebCore/LegacyWebArchive.h> #import <WebCore/RenderImage.h> +#import <WebCore/ResourceHandle.h> #import <WebCore/StringTruncator.h> -#import <wtf/StdLibExtras.h> +#import <WebKit/WebArchive.h> #import <WebKit/WebKitNSStringExtras.h> +#import <WebKit/WebNSFileManagerExtras.h> +#import <WebKit/WebNSPasteboardExtras.h> #import <WebKit/WebNSURLExtras.h> +#import <WebKitSystemInterface.h> +#import <wtf/StdLibExtras.h> using namespace WebCore; +using namespace WebKit; + +// Internal AppKit class. If the pasteboard handling was in the same process +// that called the dragImage method, this would be created automatically. +// Create it explicitly because dragImage is called in the UI process. +@interface NSFilePromiseDragSource : NSObject +{ + char _unknownFields[256]; +} +- (id)initWithSource:(id)dragSource; +- (void)setTypes:(NSArray *)types onPasteboard:(NSPasteboard *)pasteboard; +@end + +@interface WKPasteboardFilePromiseOwner : NSFilePromiseDragSource +@end + +@interface WKPasteboardOwner : NSObject +{ + CachedResourceHandle<CachedImage> _image; +} +- (id)initWithImage:(CachedImage*)image; +@end namespace WebKit { -using namespace WebCore; - -void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& at, const IntPoint& eventPos, Clipboard* clipboard, Frame* frame, bool linkDrag) +static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image) { - if (!frame) - return; - ASSERT(clipboard); - - NSImage *dragNSImage = dragImage.get(); - RefPtr<ShareableBitmap> dragShareableImage = ShareableBitmap::createShareable(IntSize([dragNSImage size])); - OwnPtr<GraphicsContext> graphicsContext = dragShareableImage->createGraphicsContext(); + RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(IntSize([image size]), ShareableBitmap::SupportsAlpha); + OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext(); - [NSGraphicsContext saveGraphicsState]; - NSGraphicsContext* bitmapContext = [NSGraphicsContext graphicsContextWithGraphicsPort:graphicsContext->platformContext() flipped:YES]; - [NSGraphicsContext setCurrentContext: bitmapContext]; - - [dragNSImage drawInRect:NSMakeRect(0, 0, [dragNSImage size].width , [dragNSImage size].height) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1 respectFlipped:YES hints:nil]; - [NSGraphicsContext restoreGraphicsState]; - - SharedMemory::Handle handle; - if (!dragShareableImage->createHandle(handle)) + RetainPtr<NSGraphicsContext> savedContext = [NSGraphicsContext currentContext]; + + [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:graphicsContext->platformContext() flipped:YES]]; + [image drawInRect:NSMakeRect(0, 0, bitmap->size().width(), bitmap->size().height()) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1 respectFlipped:YES hints:nil]; + + [NSGraphicsContext setCurrentContext:savedContext.get()]; + + return bitmap.release(); +} + +void WebDragClient::startDrag(RetainPtr<NSImage> image, const IntPoint& point, const IntPoint&, Clipboard*, Frame* frame, bool linkDrag) +{ + RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get()); + ShareableBitmap::Handle handle; + if (!bitmap->createHandle(handle)) return; - IntPoint clientPoint(at); - m_page->send(Messages::WebPageProxy::SetDragImage(clientPoint, IntSize([dragNSImage size]), handle, linkDrag)); + + // FIXME: Seems this message should be named StartDrag, not SetDragImage. + m_page->send(Messages::WebPageProxy::SetDragImage(frame->view()->contentsToWindow(point), handle, linkDrag)); } -static void writeURL(NSPasteboard* pasteboard, NSURL* URL, NSString* title, NSArray* types) +static CachedImage* cachedImage(Element* element) { - ASSERT(URL); - + RenderObject* renderer = element->renderer(); + if (!renderer) + return 0; + if (!renderer->isRenderImage()) + return 0; + CachedImage* image = toRenderImage(renderer)->cachedImage(); + if (!image || image->errorOccurred()) + return 0; + return image; +} + +static NSArray *arrayForURLsWithTitles(NSURL *URL, NSString *title) +{ + return [NSArray arrayWithObjects:[NSArray arrayWithObject:[URL _web_originalDataAsString]], + [NSArray arrayWithObject:[title _webkit_stringByTrimmingWhitespace]], nil]; +} + +void WebDragClient::declareAndWriteDragImage(NSPasteboard *pasteboard, DOMElement *element, NSURL *URL, NSString *title, WebCore::Frame*) +{ + ASSERT(element); + ASSERT(pasteboard && pasteboard == [NSPasteboard pasteboardWithName:NSDragPboard]); + + Element* coreElement = core(element); + + CachedImage* image = cachedImage(coreElement); + + NSString *extension = @""; + if (image) { + extension = image->image()->filenameExtension(); + if (![extension length]) + return; + } + if (![title length]) { title = [[URL path] lastPathComponent]; if (![title length]) title = [URL _web_userVisibleString]; } - - if ([types containsObject:NSURLPboardType]) - [URL writeToPasteboard:pasteboard]; - if ([types containsObject:PasteboardTypes::WebURLPboardType]) - [pasteboard setString:[URL _web_originalDataAsString] forType:PasteboardTypes::WebURLPboardType]; - if ([types containsObject:PasteboardTypes::WebURLNamePboardType]) - [pasteboard setString:title forType:PasteboardTypes::WebURLNamePboardType]; - if ([types containsObject:NSStringPboardType]) - [pasteboard setString:[URL _web_userVisibleString] forType:NSStringPboardType]; - if ([types containsObject:PasteboardTypes::WebURLsWithTitlesPboardType]) { - NSArray* URLs = [NSArray arrayWithObject:URL]; - unsigned count = [URLs count]; - - if (!count || [pasteboard availableTypeFromArray:[NSArray arrayWithObject:PasteboardTypes::WebURLsWithTitlesPboardType]] == nil) - return; - NSArray* titles = [NSArray arrayWithObject:title]; - - if (count != [titles count]) - titles = nil; - - NSMutableArray* URLStrings = [NSMutableArray arrayWithCapacity:count]; - NSMutableArray* titlesOrEmptyStrings = [NSMutableArray arrayWithCapacity:count]; - for (unsigned index = 0; index < count; ++index) { - [URLStrings addObject:[[URLs objectAtIndex:index] _web_originalDataAsString]]; - [titlesOrEmptyStrings addObject:(titles == nil) ? @"" : [[titles objectAtIndex:index] _webkit_stringByTrimmingWhitespace]]; + RefPtr<LegacyWebArchive> archive = LegacyWebArchive::create(coreElement); + + RetainPtr<NSMutableArray> types(AdoptNS, [[NSMutableArray alloc] initWithObjects:NSFilesPromisePboardType, nil]); + [types.get() addObjectsFromArray:archive ? PasteboardTypes::forImagesWithArchive() : PasteboardTypes::forImages()]; + + RetainPtr<WKPasteboardOwner> pasteboardOwner(AdoptNS, [[WKPasteboardOwner alloc] initWithImage:image]); + + RetainPtr<WKPasteboardFilePromiseOwner> filePromiseOwner(AdoptNS, [(WKPasteboardFilePromiseOwner *)[WKPasteboardFilePromiseOwner alloc] initWithSource:pasteboardOwner.get()]); + m_page->setDragSource(filePromiseOwner.get()); + + [pasteboard declareTypes:types.get() owner:pasteboardOwner.get()]; + + [pasteboard setPropertyList:[NSArray arrayWithObject:extension] forType:NSFilesPromisePboardType]; + + [filePromiseOwner.get() setTypes:[pasteboard propertyListForType:NSFilesPromisePboardType] onPasteboard:pasteboard]; + + [URL writeToPasteboard:pasteboard]; + + [pasteboard setString:[URL _web_originalDataAsString] forType:PasteboardTypes::WebURLPboardType]; + + [pasteboard setString:title forType:PasteboardTypes::WebURLNamePboardType]; + + [pasteboard setString:[URL _web_userVisibleString] forType:NSStringPboardType]; + + [pasteboard setPropertyList:arrayForURLsWithTitles(URL, title) forType:PasteboardTypes::WebURLsWithTitlesPboardType]; + + if (archive) + [pasteboard setData:(NSData *)archive->rawDataRepresentation().get() forType:PasteboardTypes::WebArchivePboardType]; +} + +} // namespace WebKit + +@implementation WKPasteboardFilePromiseOwner + +// The AppKit implementation of copyDropDirectory gets the current pasteboard in +// a way that only works in the process where the drag is initiated. We supply +// an implementation that gets the pasteboard by name instead. +- (CFURLRef)copyDropDirectory +{ + PasteboardRef pasteboard; + OSStatus status = PasteboardCreate((CFStringRef)NSDragPboard, &pasteboard); + if (status != noErr || !pasteboard) + return 0; + CFURLRef location = 0; + status = PasteboardCopyPasteLocation(pasteboard, &location); + CFRelease(pasteboard); + if (status != noErr || !location) + return 0; + CFMakeCollectable(location); + return location; +} + +@end + +@implementation WKPasteboardOwner + +static CachedResourceClient* promisedDataClient() +{ + static CachedResourceClient* client = new CachedResourceClient; + return client; +} + +- (void)clearImage +{ + if (!_image) + return; + _image->removeClient(promisedDataClient()); + _image = 0; +} + +- (id)initWithImage:(CachedImage*)image +{ + self = [super init]; + if (!self) + return nil; + + _image = image; + if (image) + image->addClient(promisedDataClient()); + return self; +} + +- (void)dealloc +{ + [self clearImage]; + [super dealloc]; +} + +- (void)finalize +{ + [self clearImage]; + [super finalize]; +} + +- (void)pasteboard:(NSPasteboard *)pasteboard provideDataForType:(NSString *)type +{ + if ([type isEqual:NSTIFFPboardType]) { + if (_image) { + if (Image* image = _image->image()) + [pasteboard setData:(NSData *)image->getTIFFRepresentation() forType:NSTIFFPboardType]; + [self clearImage]; } - - [pasteboard setPropertyList:[NSArray arrayWithObjects:URLStrings, titlesOrEmptyStrings, nil] - forType:PasteboardTypes::WebURLsWithTitlesPboardType]; + return; } + // FIXME: Handle RTFD here. } - -static void writeImage(NSPasteboard* pasteboard, NSImage *image, DOMElement* element, NSURL* URL, NSString* title, LegacyWebArchive* archive, NSArray* types) + +- (void)pasteboardChangedOwner:(NSPasteboard *)pasteboard { - ASSERT(image || element); - ASSERT(URL); - - writeURL(pasteboard, URL, title, types); - - if ([types containsObject:NSTIFFPboardType]) { - // FIXME: we should add handling of promised types. - if (image) - [pasteboard setData:[image TIFFRepresentation] forType:NSTIFFPboardType]; - else if (element) - [pasteboard setData:[element _imageTIFFRepresentation] forType:NSTIFFPboardType]; - } - - if (archive && [types containsObject:PasteboardTypes::WebArchivePboardType]) - [pasteboard setData:[[(NSData *)archive->rawDataRepresentation().get() retain] autorelease] forType:PasteboardTypes::WebArchivePboardType]; + [self clearImage]; } - -void WebDragClient::declareAndWriteDragImage(NSPasteboard* pasteboard, DOMElement* element, NSURL* URL, NSString* title, WebCore::Frame*) + +static bool matchesExtensionOrEquivalent(NSString *filename, NSString *extension) { - ASSERT(element); - ASSERT(pasteboard && pasteboard == [NSPasteboard pasteboardWithName:NSDragPboard]); + NSString *extensionAsSuffix = [@"." stringByAppendingString:extension]; + return [filename _webkit_hasCaseInsensitiveSuffix:extensionAsSuffix] + || ([extension _webkit_isCaseInsensitiveEqualToString:@"jpeg"] + && [filename _webkit_hasCaseInsensitiveSuffix:@".jpg"]); +} + +- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination +{ + NSFileWrapper *wrapper = nil; + NSURL *draggingImageURL = nil; - NSString *extension = @""; - if (RenderObject* renderer = core(element)->renderer()) { - if (renderer->isImage()) { - if (CachedImage* image = toRenderImage(renderer)->cachedImage()) { - extension = image->image()->filenameExtension(); - if (![extension length]) - return; - } + if (_image) { + if (SharedBuffer* buffer = _image->CachedResource::data()) { + NSData *data = buffer->createNSData(); + NSURLResponse *response = _image->response().nsURLResponse(); + draggingImageURL = [response URL]; + wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:data] autorelease]; + NSString* filename = [response suggestedFilename]; + NSString* trueExtension(_image->image()->filenameExtension()); + if (!matchesExtensionOrEquivalent(filename, trueExtension)) + filename = [[filename stringByAppendingString:@"."] stringByAppendingString:trueExtension]; + [wrapper setPreferredFilename:filename]; } } + + // FIXME: Do we need to handle the case where we do not have a CachedImage? + // WebKit1 had code for this case. - RefPtr<LegacyWebArchive> archive = LegacyWebArchive::create(core(element)); - NSMutableArray *types = [[NSMutableArray alloc] initWithObjects:NSFilesPromisePboardType, nil]; - [types addObjectsFromArray:(archive) ? PasteboardTypes::forImagesWithArchive() : PasteboardTypes::forImages()]; - [pasteboard declareTypes:types owner:nil]; - writeImage(pasteboard, nil, element, URL, title, archive.get(), types); - [types release]; - - NSArray *extensions = [[NSArray alloc] initWithObjects:extension, nil]; - [pasteboard setPropertyList:extensions forType:NSFilesPromisePboardType]; - [extensions release]; + if (!wrapper) { + LOG_ERROR("Failed to create image file."); + return nil; + } + + // FIXME: Report an error if we fail to create a file. + NSString *path = [[dropDestination path] stringByAppendingPathComponent:[wrapper preferredFilename]]; + path = [[NSFileManager defaultManager] _webkit_pathWithUniqueFilenameForPath:path]; + if (![wrapper writeToFile:path atomically:NO updateFilenames:YES]) + LOG_ERROR("Failed to create image file via -[NSFileWrapper writeToFile:atomically:updateFilenames:] at path %@", path); + + if (draggingImageURL) + [[NSFileManager defaultManager] _webkit_setMetadataURL:[draggingImageURL absoluteString] referrer:nil atPath:path]; + + return [NSArray arrayWithObject:[path lastPathComponent]]; } -} // namespace WebKit +@end diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm index 8af0438..7a95a72 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm +++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm @@ -46,7 +46,7 @@ #import <WebCore/Page.h> #import <WebKit/WebResource.h> #import <WebKit/WebNSURLExtras.h> -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) +#if !defined(BUILDING_ON_SNOW_LEOPARD) #import <AppKit/NSTextChecker.h> #endif @@ -246,26 +246,27 @@ void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, uint64 m_page->sendSync(Messages::WebPageProxy::CheckTextOfParagraph(String(text, length), checkingTypes), Messages::WebPageProxy::CheckTextOfParagraph::Reply(results)); } -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) -void WebEditorClient::showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType type, const WebCore::FloatRect& boundingBoxOfReplacedString, const WTF::String& replacedString, const WTF::String& replacementString, const Vector<String>& alternativeReplacementStrings, WebCore::Editor*) +#if !defined(BUILDING_ON_SNOW_LEOPARD) +void WebEditorClient::showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType type, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) { - notImplemented(); + m_page->send(Messages::WebPageProxy::ShowCorrectionPanel(type, boundingBoxOfReplacedString, replacedString, replacementString, alternativeReplacementStrings)); } -void WebEditorClient::dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel) +void WebEditorClient::dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel reason) { - notImplemented(); + m_page->send(Messages::WebPageProxy::DismissCorrectionPanel(reason)); } -bool WebEditorClient::isShowingCorrectionPanel() +String WebEditorClient::dismissCorrectionPanelSoon(WebCore::ReasonForDismissingCorrectionPanel reason) { - notImplemented(); - return false; + String result; + m_page->sendSync(Messages::WebPageProxy::DismissCorrectionPanelSoon(reason), Messages::WebPageProxy::DismissCorrectionPanelSoon::Reply(result)); + return result; } void WebEditorClient::recordAutocorrectionResponse(EditorClient::AutocorrectionResponseType responseType, const String& replacedString, const String& replacementString) { - notImplemented(); + m_page->send(Messages::WebPageProxy::RecordAutocorrectionResponse(responseType, replacedString, replacementString)); } #endif diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm index 677c537..70e7607 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm +++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm @@ -28,6 +28,7 @@ #import "WKError.h" #import "WebError.h" +#import <WebCore/LocalizedStrings.h> #import <WebCore/ResourceRequest.h> #import <WebCore/ResourceResponse.h> #import <pthread.h> @@ -41,9 +42,6 @@ static NSString * const WebKitErrorMIMETypeKey = @"WebKitErrorMIME static NSString * const WebKitErrorPlugInNameKey = @"WebKitErrorPlugInNameKey"; static NSString * const WebKitErrorPlugInPageURLStringKey = @"WebKitErrorPlugInPageURLStringKey"; -// FIXME (WebKit2) <rdar://problem/8728860> WebKit2 needs to be localized -#define UI_STRING(__str, __desc) [NSString stringWithUTF8String:__str] - // Policy errors #define WebKitErrorDescriptionCannotShowMIMEType UI_STRING("Content with specified MIME type can’t be shown", "WebKitErrorCannotShowMIMEType description") #define WebKitErrorDescriptionCannotShowURL UI_STRING("The URL can’t be shown", "WebKitErrorCannotShowURL description") @@ -119,17 +117,17 @@ static void registerErrors() NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: // Policy errors - WebKitErrorDescriptionCannotShowMIMEType, [NSNumber numberWithInt: kWKErrorCodeCannotShowMIMEType], - WebKitErrorDescriptionCannotShowURL, [NSNumber numberWithInt: kWKErrorCodeCannotShowURL], - WebKitErrorDescriptionFrameLoadInterruptedByPolicyChange, [NSNumber numberWithInt: kWKErrorCodeFrameLoadInterruptedByPolicyChange], - WebKitErrorDescriptionCannotUseRestrictedPort, [NSNumber numberWithInt: kWKErrorCodeCannotUseRestrictedPort], + (NSString *)WebKitErrorDescriptionCannotShowMIMEType, [NSNumber numberWithInt: kWKErrorCodeCannotShowMIMEType], + (NSString *)WebKitErrorDescriptionCannotShowURL, [NSNumber numberWithInt: kWKErrorCodeCannotShowURL], + (NSString *)WebKitErrorDescriptionFrameLoadInterruptedByPolicyChange, [NSNumber numberWithInt: kWKErrorCodeFrameLoadInterruptedByPolicyChange], + (NSString *)WebKitErrorDescriptionCannotUseRestrictedPort, [NSNumber numberWithInt: kWKErrorCodeCannotUseRestrictedPort], // Plug-in and java errors - WebKitErrorDescriptionCannotFindPlugin, [NSNumber numberWithInt: kWKErrorCodeCannotFindPlugIn], - WebKitErrorDescriptionCannotLoadPlugin, [NSNumber numberWithInt: kWKErrorCodeCannotLoadPlugIn], - WebKitErrorDescriptionJavaUnavailable, [NSNumber numberWithInt: kWKErrorCodeJavaUnavailable], - WebKitErrorDescriptionPlugInCancelledConnection, [NSNumber numberWithInt: kWKErrorCodePlugInCancelledConnection], - WebKitErrorDescriptionPlugInWillHandleLoad, [NSNumber numberWithInt: kWKErrorCodePlugInWillHandleLoad], + (NSString *)WebKitErrorDescriptionCannotFindPlugin, [NSNumber numberWithInt: kWKErrorCodeCannotFindPlugIn], + (NSString *)WebKitErrorDescriptionCannotLoadPlugin, [NSNumber numberWithInt: kWKErrorCodeCannotLoadPlugIn], + (NSString *)WebKitErrorDescriptionJavaUnavailable, [NSNumber numberWithInt: kWKErrorCodeJavaUnavailable], + (NSString *)WebKitErrorDescriptionPlugInCancelledConnection, [NSNumber numberWithInt: kWKErrorCodePlugInCancelledConnection], + (NSString *)WebKitErrorDescriptionPlugInWillHandleLoad, [NSNumber numberWithInt: kWKErrorCodePlugInWillHandleLoad], nil]; [NSError _webkit_addErrorsWithCodesAndDescriptions:dict inDomain:WebError::webKitErrorDomain()]; diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm index 2c8649e..06faa2f 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm +++ b/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm @@ -59,6 +59,7 @@ void InitWebCoreSystemInterface(void) INIT(GetHTTPPipeliningPriority); INIT(GetMIMETypeForExtension); INIT(GetNSURLResponseLastModifiedDate); + INIT(SignedPublicKeyAndChallengeString); INIT(GetPreferredExtensionForMIMEType); INIT(GetUserToBaseCTM); INIT(GetWheelEventDeltas); @@ -95,7 +96,7 @@ void InitWebCoreSystemInterface(void) INIT(SignalCFReadStreamHasBytes); INIT(CreatePrivateStorageSession); INIT(CopyRequestWithStorageSession); - INIT(CreatePrivateInMemoryHTTPCookieStorage); + INIT(CopyHTTPCookieStorage); INIT(GetHTTPCookieAcceptPolicy); INIT(HTTPCookiesForURL); INIT(SetHTTPCookiesForURL); @@ -108,6 +109,7 @@ void InitWebCoreSystemInterface(void) INIT(MakeScrollbarPainter); INIT(ScrollbarPainterSetDelegate); INIT(ScrollbarPainterPaint); + INIT(ScrollbarPainterForceFlashScrollers); INIT(ScrollbarThickness); INIT(ScrollbarMinimumThumbLength); INIT(ScrollbarMinimumTotalLengthNeededForThumb); @@ -148,5 +150,11 @@ void InitWebCoreSystemInterface(void) INIT(AccessibilityHandleFocusChanged); INIT(CreateAXUIElementRef); INIT(UnregisterUniqueIdForElement); + + INIT(GetCFURLResponseMIMEType); + INIT(GetCFURLResponseURL); + INIT(GetCFURLResponseHTTPResponse); + INIT(CopyCFURLResponseSuggestedFilename); + INIT(SetCFURLResponseMIMEType); }); } diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp index b4db406..851203c 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp @@ -78,9 +78,9 @@ void WebPopupMenu::setUpPlatformData(const WebCore::IntRect& pageCoordinates, Pl // The backing stores should be drawn at least as wide as the control on the page to match the width of the popup window we'll create. int backingStoreWidth = max(pageCoordinates.width() - m_popupClient->clientInsetLeft() - m_popupClient->clientInsetRight(), popupWidth); - data.m_backingStoreSize = IntSize(backingStoreWidth, (itemCount * data.m_itemHeight)); - data.m_notSelectedBackingStore = ShareableBitmap::createShareable(data.m_backingStoreSize); - data.m_selectedBackingStore = ShareableBitmap::createShareable(data.m_backingStoreSize); + IntSize backingStoreSize(backingStoreWidth, (itemCount * data.m_itemHeight)); + data.m_notSelectedBackingStore = ShareableBitmap::createShareable(backingStoreSize, ShareableBitmap::SupportsAlpha); + data.m_selectedBackingStore = ShareableBitmap::createShareable(backingStoreSize, ShareableBitmap::SupportsAlpha); OwnPtr<GraphicsContext> notSelectedBackingStoreContext = data.m_notSelectedBackingStore->createGraphicsContext(); OwnPtr<GraphicsContext> selectedBackingStoreContext = data.m_selectedBackingStore->createGraphicsContext(); @@ -88,7 +88,7 @@ void WebPopupMenu::setUpPlatformData(const WebCore::IntRect& pageCoordinates, Pl Color activeOptionBackgroundColor = RenderTheme::defaultTheme()->activeListBoxSelectionBackgroundColor(); Color activeOptionTextColor = RenderTheme::defaultTheme()->activeListBoxSelectionForegroundColor(); - for (int y = 0; y < data.m_backingStoreSize.height(); y += data.m_itemHeight) { + for (int y = 0; y < backingStoreSize.height(); y += data.m_itemHeight) { int index = y / data.m_itemHeight; PopupMenuStyle itemStyle = m_popupClient->itemStyle(index); diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp index 0a18256..47acc7a 100644 --- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp @@ -64,7 +64,8 @@ DrawingAreaImpl::DrawingAreaImpl(WebPage* webPage, const WebPageCreationParamete , m_isWaitingForDidUpdate(false) , m_isPaintingSuspended(!parameters.isVisible) , m_alwaysUseCompositing(false) - , m_displayTimer(WebProcess::shared().runLoop(), this, &DrawingAreaImpl::display) + , m_lastDisplayTime(0) + , m_displayTimer(WebProcess::shared().runLoop(), this, &DrawingAreaImpl::displayTimerFired) , m_exitCompositingTimer(WebProcess::shared().runLoop(), this, &DrawingAreaImpl::exitAcceleratedCompositingMode) { if (webPage->corePage()->settings()->acceleratedDrawingEnabled()) @@ -89,6 +90,9 @@ void DrawingAreaImpl::setNeedsDisplay(const IntRect& rect) return; } + if (m_webPage->mainFrameHasCustomRepresentation()) + return; + m_dirtyRegion.unite(dirtyRect); scheduleDisplay(); } @@ -104,6 +108,9 @@ void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollOff return; } + if (m_webPage->mainFrameHasCustomRepresentation()) + return; + if (!m_scrollRect.isEmpty() && scrollRect != m_scrollRect) { unsigned scrollArea = scrollRect.width() * scrollRect.height(); unsigned currentScrollArea = m_scrollRect.width() * m_scrollRect.height(); @@ -197,7 +204,9 @@ void DrawingAreaImpl::layerHostDidFlushLayers() if (!m_layerTreeHost) return; +#if USE(ACCELERATED_COMPOSITING) m_webPage->send(Messages::DrawingAreaProxy::EnterAcceleratedCompositingMode(m_backingStoreStateID, m_layerTreeHost->layerTreeContext())); +#endif } void DrawingAreaImpl::setRootCompositingLayer(GraphicsLayer* graphicsLayer) @@ -291,11 +300,13 @@ void DrawingAreaImpl::sendDidUpdateBackingStoreState() m_shouldSendDidUpdateBackingStoreState = false; UpdateInfo updateInfo; - LayerTreeContext layerTreeContext; if (!m_isPaintingSuspended && !m_layerTreeHost) display(updateInfo); +#if USE(ACCELERATED_COMPOSITING) + LayerTreeContext layerTreeContext; + if (m_isPaintingSuspended || m_layerTreeHost) { updateInfo.viewSize = m_webPage->size(); @@ -311,6 +322,7 @@ void DrawingAreaImpl::sendDidUpdateBackingStoreState() } m_webPage->send(Messages::DrawingAreaProxy::DidUpdateBackingStoreState(m_backingStoreStateID, updateInfo, layerTreeContext)); +#endif } void DrawingAreaImpl::didUpdate() @@ -322,8 +334,8 @@ void DrawingAreaImpl::didUpdate() m_isWaitingForDidUpdate = false; - // Display if needed. - display(); + // Display if needed. We call displayTimerFired here since it will throttle updates to 60fps. + displayTimerFired(); } void DrawingAreaImpl::suspendPainting() @@ -391,9 +403,11 @@ void DrawingAreaImpl::exitAcceleratedCompositingMode() else display(updateInfo); +#if USE(ACCELERATED_COMPOSITING) // Send along a complete update of the page so we can paint the contents right after we exit the // accelerated compositing mode, eliminiating flicker. m_webPage->send(Messages::DrawingAreaProxy::ExitAcceleratedCompositingMode(m_backingStoreStateID, updateInfo)); +#endif } void DrawingAreaImpl::exitAcceleratedCompositingModeSoon() @@ -421,6 +435,21 @@ void DrawingAreaImpl::scheduleDisplay() m_displayTimer.startOneShot(0); } +void DrawingAreaImpl::displayTimerFired() +{ + static const double minimumFrameInterval = 1.0 / 60.0; + + double timeSinceLastDisplay = currentTime() - m_lastDisplayTime; + double timeUntilNextDisplay = minimumFrameInterval - timeSinceLastDisplay; + + if (timeUntilNextDisplay > 0) { + m_displayTimer.startOneShot(timeUntilNextDisplay); + return; + } + + display(); +} + void DrawingAreaImpl::display() { ASSERT(!m_layerTreeHost); @@ -479,8 +508,11 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo) ASSERT(!m_webPage->size().isEmpty()); // FIXME: It would be better if we could avoid painting altogether when there is a custom representation. - if (m_webPage->mainFrameHasCustomRepresentation()) + if (m_webPage->mainFrameHasCustomRepresentation()) { + // ASSUMPTION: the custom representation will be painting the dirty region for us. + m_dirtyRegion = Region(); return; + } m_webPage->layoutIfNeeded(); @@ -492,7 +524,7 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo) IntRect bounds = m_dirtyRegion.bounds(); ASSERT(m_webPage->bounds().contains(bounds)); - RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bounds.size()); + RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bounds.size(), ShareableBitmap::SupportsAlpha); if (!bitmap->createHandle(updateInfo.bitmapHandle)) return; @@ -527,6 +559,8 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo) // Layout can trigger more calls to setNeedsDisplay and we don't want to process them // until the UI process has painted the update, so we stop the timer here. m_displayTimer.stop(); + + m_lastDisplayTime = currentTime(); } diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h index 8d85200..9e93869 100644 --- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h +++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h @@ -72,6 +72,7 @@ private: void exitAcceleratedCompositingMode(); void scheduleDisplay(); + void displayTimerFired(); void display(); void display(UpdateInfo&); @@ -97,6 +98,8 @@ private: bool m_isPaintingSuspended; bool m_alwaysUseCompositing; + double m_lastDisplayTime; + RunLoop::Timer<DrawingAreaImpl> m_displayTimer; RunLoop::Timer<DrawingAreaImpl> m_exitCompositingTimer; diff --git a/Source/WebKit2/WebProcess/WebPage/FindController.cpp b/Source/WebKit2/WebProcess/WebPage/FindController.cpp index 8e9dba7..3e7b268 100644 --- a/Source/WebKit2/WebProcess/WebPage/FindController.cpp +++ b/Source/WebKit2/WebProcess/WebPage/FindController.cpp @@ -153,6 +153,10 @@ bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOve return false; IntRect selectionRect = enclosingIntRect(selectedFrame->selection()->bounds()); + + // Selection rect can be empty for matches that are currently obscured from view. + if (selectionRect.isEmpty()) + return false; // We want the selection rect in window coordinates. IntRect selectionRectInWindowCoordinates = selectedFrame->view()->contentsToWindow(selectionRect); @@ -161,7 +165,7 @@ bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOve selectedFrame->selection()->getClippedVisibleTextRectangles(textRects); // Create a backing store and paint the find indicator text into it. - RefPtr<ShareableBitmap> findIndicatorTextBackingStore = ShareableBitmap::createShareable(selectionRect.size()); + RefPtr<ShareableBitmap> findIndicatorTextBackingStore = ShareableBitmap::createShareable(selectionRect.size(), ShareableBitmap::SupportsAlpha); if (!findIndicatorTextBackingStore) return false; @@ -178,7 +182,7 @@ bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOve selectedFrame->view()->paint(graphicsContext.get(), paintRect); selectedFrame->view()->setPaintBehavior(PaintBehaviorNormal); - SharedMemory::Handle handle; + ShareableBitmap::Handle handle; if (!findIndicatorTextBackingStore->createHandle(handle)) return false; @@ -203,7 +207,7 @@ void FindController::hideFindIndicator() if (!m_isShowingFindIndicator) return; - SharedMemory::Handle handle; + ShareableBitmap::Handle handle; m_webPage->send(Messages::WebPageProxy::SetFindIndicator(FloatRect(), Vector<FloatRect>(), handle, false)); m_isShowingFindIndicator = false; } diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp index 1112d39..737e195 100644 --- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp +++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp @@ -27,7 +27,7 @@ #include "LayerTreeHost.h" #if PLATFORM(MAC) -#include "LayerTreeHostMac.h" +#include "LayerTreeHostCA.h" #endif #if !PLATFORM(MAC) && !PLATFORM(WIN) @@ -41,7 +41,7 @@ namespace WebKit { PassRefPtr<LayerTreeHost> LayerTreeHost::create(WebPage* webPage) { #if PLATFORM(MAC) - return LayerTreeHostMac::create(webPage); + return LayerTreeHostCA::create(webPage); #endif return 0; diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp index fa4dc2c..574634f 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp @@ -335,7 +335,11 @@ String WebFrame::url() const if (!m_coreFrame) return String(); - return m_coreFrame->document()->url().string(); + DocumentLoader* documentLoader = m_coreFrame->loader()->documentLoader(); + if (!documentLoader) + return String(); + + return documentLoader->url().string(); } String WebFrame::innerText() const @@ -611,7 +615,12 @@ String WebFrame::suggestedFilenameForResourceWithURL(const KURL& url) const DocumentLoader* loader = m_coreFrame->loader()->documentLoader(); if (!loader) return String(); - + + // First, try the main resource. + if (loader->url() == url) + return loader->response().suggestedFilename(); + + // Next, try subresources. RefPtr<ArchiveResource> resource = loader->subresource(url); if (!resource) return String(); @@ -627,7 +636,12 @@ String WebFrame::mimeTypeForResourceWithURL(const KURL& url) const DocumentLoader* loader = m_coreFrame->loader()->documentLoader(); if (!loader) return String(); - + + // First, try the main resource. + if (loader->url() == url) + return loader->response().mimeType(); + + // Next, try subresources. RefPtr<ArchiveResource> resource = loader->subresource(url); if (resource) return resource->mimeType(); diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index ff567bd..d5f3724 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -54,6 +54,7 @@ #include "WebEvent.h" #include "WebEventConversion.h" #include "WebFrame.h" +#include "WebFullScreenManager.h" #include "WebGeolocationClient.h" #include "WebImage.h" #include "WebInspector.h" @@ -91,6 +92,7 @@ #include <WebCore/RenderView.h> #include <WebCore/ReplaceSelectionCommand.h> #include <WebCore/ResourceRequest.h> +#include <WebCore/SchemeRegistry.h> #include <WebCore/SerializedScriptValue.h> #include <WebCore/Settings.h> #include <WebCore/SharedBuffer.h> @@ -158,6 +160,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters) , m_canRunBeforeUnloadConfirmPanel(parameters.canRunBeforeUnloadConfirmPanel) , m_canRunModal(parameters.canRunModal) , m_isRunningModal(false) + , m_userSpaceScaleFactor(parameters.userSpaceScaleFactor) , m_cachedMainFrameIsPinnedToLeftSide(false) , m_cachedMainFrameIsPinnedToRightSide(false) { @@ -352,6 +355,9 @@ void WebPage::close() #if ENABLE(INSPECTOR) m_inspector = 0; #endif +#if ENABLE(FULLSCREEN_API) + m_fullScreenManager = 0; +#endif if (m_activePopupMenu) { m_activePopupMenu->disconnectFromPage(); @@ -424,7 +430,7 @@ void WebPage::loadAlternateHTMLString(const String& htmlString, const String& ba { RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(htmlString.characters()), htmlString.length() * sizeof(UChar)); KURL baseURL = baseURLString.isEmpty() ? blankURL() : KURL(KURL(), baseURLString); - KURL unreachableURL = unreachableURLString.isEmpty() ? KURL() : KURL(KURL(), unreachableURLString) ; + KURL unreachableURL = unreachableURLString.isEmpty() ? KURL() : KURL(KURL(), unreachableURLString); loadData(sharedBuffer, "text/html", "utf-16", baseURL, unreachableURL); } @@ -785,9 +791,9 @@ void WebPage::pageDidScroll() } #if ENABLE(TILED_BACKING_STORE) -void WebPage::pageDidRequestScroll(const IntSize& delta) +void WebPage::pageDidRequestScroll(const IntPoint& point) { - send(Messages::WebPageProxy::PageDidRequestScroll(delta)); + send(Messages::WebPageProxy::PageDidRequestScroll(point)); } #endif @@ -1051,6 +1057,21 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent) } #endif +void WebPage::scroll(Page* page, ScrollDirection direction, ScrollGranularity granularity) +{ + page->focusController()->focusedOrMainFrame()->eventHandler()->scrollRecursively(direction, granularity); +} + +void WebPage::logicalScroll(Page* page, ScrollLogicalDirection direction, ScrollGranularity granularity) +{ + page->focusController()->focusedOrMainFrame()->eventHandler()->logicalScrollRecursively(direction, granularity); +} + +void WebPage::scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity) +{ + scroll(m_page.get(), static_cast<ScrollDirection>(scrollDirection), static_cast<ScrollGranularity>(scrollGranularity)); +} + void WebPage::setActive(bool isActive) { m_page->focusController()->setActive(isActive); @@ -1121,6 +1142,8 @@ void WebPage::viewWillEndLiveResize() void WebPage::setFocused(bool isFocused) { + if (!isFocused) + m_page->focusController()->focusedOrMainFrame()->selection()->clear(); m_page->focusController()->setFocused(isFocused); } @@ -1176,6 +1199,13 @@ void WebPage::setUserAgent(const String& userAgent) { m_userAgent = userAgent; } + +IntRect WebPage::windowToScreen(const IntRect& rect) +{ + IntRect screenRect; + sendSync(Messages::WebPageProxy::WindowToScreen(rect), Messages::WebPageProxy::WindowToScreen::Reply(screenRect)); + return screenRect; +} IntRect WebPage::windowResizerRect() const { @@ -1353,6 +1383,9 @@ void WebPage::updatePreferences(const WebPreferencesStore& store) settings->setDOMPasteAllowed(store.getBoolValueForKey(WebPreferencesKey::domPasteAllowedKey())); settings->setJavaScriptCanAccessClipboard(store.getBoolValueForKey(WebPreferencesKey::javaScriptCanAccessClipboardKey())); settings->setShouldPrintBackgrounds(store.getBoolValueForKey(WebPreferencesKey::shouldPrintBackgroundsKey())); + settings->setWebSecurityEnabled(store.getBoolValueForKey(WebPreferencesKey::webSecurityEnabledKey())); + settings->setAllowUniversalAccessFromFileURLs(store.getBoolValueForKey(WebPreferencesKey::allowUniversalAccessFromFileURLsKey())); + settings->setAllowFileAccessFromFileURLs(store.getBoolValueForKey(WebPreferencesKey::allowFileAccessFromFileURLsKey())); settings->setMinimumFontSize(store.getUInt32ValueForKey(WebPreferencesKey::minimumFontSizeKey())); settings->setMinimumLogicalFontSize(store.getUInt32ValueForKey(WebPreferencesKey::minimumLogicalFontSizeKey())); @@ -1363,9 +1396,11 @@ void WebPage::updatePreferences(const WebPreferencesStore& store) // Temporarily turn off accelerated compositing until we have a good solution for rendering it. settings->setAcceleratedCompositingEnabled(false); settings->setAcceleratedDrawingEnabled(false); + settings->setCanvasUsesAcceleratedDrawing(false); #else settings->setAcceleratedCompositingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedCompositingEnabledKey())); settings->setAcceleratedDrawingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedDrawingEnabledKey())); + settings->setCanvasUsesAcceleratedDrawing(store.getBoolValueForKey(WebPreferencesKey::canvasUsesAcceleratedDrawingKey())); #endif settings->setShowDebugBorders(store.getBoolValueForKey(WebPreferencesKey::compositingBordersVisibleKey())); settings->setShowRepaintCounter(store.getBoolValueForKey(WebPreferencesKey::compositingRepaintCountersVisibleKey())); @@ -1375,6 +1410,14 @@ void WebPage::updatePreferences(const WebPreferencesStore& store) AbstractDatabase::setIsAvailable(store.getBoolValueForKey(WebPreferencesKey::databasesEnabledKey())); #endif +#if ENABLE(FULLSCREEN_API) + settings->setFullScreenEnabled(store.getBoolValueForKey(WebPreferencesKey::fullScreenEnabledKey())); +#endif + +#if ENABLE(DOM_STORAGE) + settings->setLocalStorageDatabasePath(WebProcess::shared().localStorageDirectory()); +#endif + platformPreferencesDidChange(store); } @@ -1389,6 +1432,15 @@ WebInspector* WebPage::inspector() } #endif +#if ENABLE(FULLSCREEN_API) +WebFullScreenManager* WebPage::fullScreenManager() +{ + if (!m_fullScreenManager) + m_fullScreenManager = WebFullScreenManager::create(this); + return m_fullScreenManager.get(); +} +#endif + #if !PLATFORM(MAC) bool WebPage::handleEditingKeyboardEvent(KeyboardEvent* evt) { @@ -1488,6 +1540,7 @@ void WebPage::dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint glob IntPoint adjustedClientPosition(clientPosition.x() + m_page->dragController()->dragOffset().x(), clientPosition.y() + m_page->dragController()->dragOffset().y()); IntPoint adjustedGlobalPosition(globalPosition.x() + m_page->dragController()->dragOffset().x(), globalPosition.y() + m_page->dragController()->dragOffset().y()); + platformDragEnded(); m_page->dragController()->dragEnded(); FrameView* view = m_page->mainFrame()->view(); if (!view) @@ -1729,13 +1782,13 @@ void WebPage::windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInSc (*it)->windowAndViewFramesChanged(windowFrameInScreenCoordinates, viewFrameInWindowCoordinates); } +#endif + bool WebPage::windowIsFocused() const { return m_page->focusController()->isActive(); } - -#endif - + void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) { if (messageID.is<CoreIPC::MessageClassDrawingAreaLegacy>()) { @@ -1760,6 +1813,13 @@ void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Messag } #endif +#if ENABLE(FULLSCREEN_API) + if (messageID.is<CoreIPC::MessageClassWebFullScreenManager>()) { + fullScreenManager()->didReceiveMessage(connection, messageID, arguments); + return; + } +#endif + didReceiveWebPageMessage(connection, messageID, arguments); } @@ -1998,6 +2058,7 @@ void WebPage::drawRectToPDF(uint64_t frameID, const WebCore::IntRect& rect, uint if (coreFrame) { ASSERT(coreFrame->document()->printing()); +#if PLATFORM(CG) // FIXME: Use CGDataConsumerCreate with callbacks to avoid copying the data. RetainPtr<CGDataConsumerRef> pdfDataConsumer(AdoptCF, CGDataConsumerCreateWithCFData(pdfPageData.get())); @@ -2013,6 +2074,7 @@ void WebPage::drawRectToPDF(uint64_t frameID, const WebCore::IntRect& rect, uint CGPDFContextEndPage(context.get()); CGPDFContextClose(context.get()); +#endif } send(Messages::WebPageProxy::DataCallback(CoreIPC::DataReference(CFDataGetBytePtr(pdfPageData.get()), CFDataGetLength(pdfPageData.get())), callbackID)); @@ -2028,6 +2090,7 @@ void WebPage::drawPagesToPDF(uint64_t frameID, uint32_t first, uint32_t count, u if (coreFrame) { ASSERT(coreFrame->document()->printing()); +#if PLATFORM(CG) // FIXME: Use CGDataConsumerCreate with callbacks to avoid copying the data. RetainPtr<CGDataConsumerRef> pdfDataConsumer(AdoptCF, CGDataConsumerCreateWithCFData(pdfPageData.get())); @@ -2048,6 +2111,7 @@ void WebPage::drawPagesToPDF(uint64_t frameID, uint32_t first, uint32_t count, u CGPDFContextEndPage(context.get()); } CGPDFContextClose(context.get()); +#endif } send(Messages::WebPageProxy::DataCallback(CoreIPC::DataReference(CFDataGetBytePtr(pdfPageData.get()), CFDataGetLength(pdfPageData.get())), callbackID)); @@ -2072,4 +2136,27 @@ void WebPage::setMemoryCacheMessagesEnabled(bool memoryCacheMessagesEnabled) m_page->setMemoryCacheClientCallsEnabled(memoryCacheMessagesEnabled); } +#if !PLATFORM(MAC) +void WebPage::platformDragEnded() +{ +} +#endif + +bool WebPage::canHandleRequest(const WebCore::ResourceRequest& request) +{ + if (SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(request.url().protocol())) + return true; + return platformCanHandleRequest(request); +} + +#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) +void WebPage::handleCorrectionPanelResult(const String& result) +{ + Frame* frame = m_page->focusController()->focusedOrMainFrame(); + if (!frame) + return; + frame->editor()->handleCorrectionPanelResult(result); +} +#endif + } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index 8ce6405..8e4e71c 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -46,6 +46,7 @@ #include <WebCore/Editor.h> #include <WebCore/FrameLoaderTypes.h> #include <WebCore/IntRect.h> +#include <WebCore/ScrollTypes.h> #include <WebCore/WebCoreKeyboardUIMode.h> #include <wtf/HashMap.h> #include <wtf/OwnPtr.h> @@ -61,6 +62,8 @@ #include "DictionaryPopupInfo.h" #include <wtf/RetainPtr.h> OBJC_CLASS AccessibilityWebPageObject; +OBJC_CLASS NSDictionary; +OBJC_CLASS NSObject; #endif namespace CoreIPC { @@ -77,6 +80,7 @@ namespace WebCore { class Range; class ResourceRequest; class SharedBuffer; + class VisibleSelection; } namespace WebKit { @@ -90,6 +94,7 @@ class WebContextMenu; class WebContextMenuItemData; class WebEvent; class WebFrame; +class WebFullScreenManager; class WebImage; class WebInspector; class WebKeyboardEvent; @@ -137,10 +142,16 @@ public: void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset); + void scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity); + #if ENABLE(INSPECTOR) WebInspector* inspector(); #endif +#if ENABLE(FULLSCREEN_API) + WebFullScreenManager* fullScreenManager(); +#endif + // -- Called by the DrawingArea. // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial? void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&); @@ -229,15 +240,16 @@ public: bool windowIsVisible() const { return m_windowIsVisible; } const WebCore::IntRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; } const WebCore::IntRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; } - bool windowIsFocused() const; bool interceptEditingKeyboardEvent(WebCore::KeyboardEvent*, bool); #elif PLATFORM(WIN) HWND nativeWindow() const { return m_nativeWindow; } #endif + bool windowIsFocused() const; void installPageOverlay(PassRefPtr<PageOverlay>); void uninstallPageOverlay(PageOverlay*); bool hasPageOverlay() const { return m_pageOverlay; } + WebCore::IntRect windowToScreen(const WebCore::IntRect&); PassRefPtr<WebImage> snapshotInViewCoordinates(const WebCore::IntRect&, ImageOptions); PassRefPtr<WebImage> snapshotInDocumentCoordinates(const WebCore::IntRect&, ImageOptions); @@ -250,7 +262,7 @@ public: void pageDidScroll(); #if ENABLE(TILED_BACKING_STORE) - void pageDidRequestScroll(const WebCore::IntSize& delta); + void pageDidRequestScroll(const WebCore::IntPoint&); void setActualVisibleContentRect(const WebCore::IntRect&); bool resizesToContentsEnabled() const { return !m_resizesToContentsLayoutSize.isEmpty(); } @@ -297,6 +309,7 @@ public: void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result); void firstRectForCharacterRange(uint64_t location, uint64_t length, WebCore::IntRect& resultRect); void writeSelectionToPasteboard(const WTF::String& pasteboardName, const WTF::Vector<WTF::String>& pasteboardTypes, bool& result); + void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result); #elif PLATFORM(WIN) void confirmComposition(const String& compositionString); void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition); @@ -309,7 +322,7 @@ public: void dummy(bool&); #if PLATFORM(MAC) - void performDictionaryLookupForRange(DictionaryPopupInfo::Type, WebCore::Frame*, WebCore::Range*); + void performDictionaryLookupForSelection(DictionaryPopupInfo::Type, WebCore::Frame*, const WebCore::VisibleSelection&); bool isSpeaking(); void speak(const String&); @@ -346,10 +359,20 @@ public: void runModal(); + float userSpaceScaleFactor() const { return m_userSpaceScaleFactor; } + void setMemoryCacheMessagesEnabled(bool); void forceRepaintWithoutCallback(); +#if PLATFORM(MAC) + void setDragSource(NSObject *); +#endif + +#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) + void handleCorrectionPanelResult(const String&); +#endif + private: WebPage(uint64_t pageID, const WebPageCreationParameters&); @@ -398,6 +421,9 @@ private: void touchEvent(const WebTouchEvent&); #endif + static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity); + static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity); + uint64_t restoreSession(const SessionState&); void restoreSessionAndNavigateToCurrentItem(const SessionState&, const SandboxExtension::Handle&); @@ -429,6 +455,7 @@ private: #if PLATFORM(MAC) void performDictionaryLookupAtLocation(const WebCore::FloatPoint&); + void performDictionaryLookupForRange(DictionaryPopupInfo::Type, WebCore::Frame*, WebCore::Range*, NSDictionary *options); void setWindowIsVisible(bool windowIsVisible); void windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInScreenCoordinates, const WebCore::IntRect& viewFrameInWindowCoordinates, const WebCore::IntPoint& accessibilityViewCoordinates); @@ -473,6 +500,10 @@ private: void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&); #endif + void platformDragEnded(); + + static bool platformCanHandleRequest(const WebCore::ResourceRequest&); + OwnPtr<WebCore::Page> m_page; RefPtr<WebFrame> m_mainFrame; RefPtr<InjectedBundleBackForwardList> m_backForwardList; @@ -512,6 +543,8 @@ private: HashSet<PluginView*> m_pluginViews; RetainPtr<AccessibilityWebPageObject> m_mockAccessibilityElement; + + RetainPtr<NSObject> m_dragSource; #elif PLATFORM(WIN) // Our view's window (in the UI process). HWND m_nativeWindow; @@ -539,6 +572,9 @@ private: #if ENABLE(INSPECTOR) RefPtr<WebInspector> m_inspector; #endif +#if ENABLE(FULLSCREEN_API) + RefPtr<WebFullScreenManager> m_fullScreenManager; +#endif RefPtr<WebPopupMenu> m_activePopupMenu; RefPtr<WebContextMenu> m_contextMenu; RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener; @@ -554,6 +590,8 @@ private: bool m_canRunModal; bool m_isRunningModal; + float m_userSpaceScaleFactor; + bool m_cachedMainFrameIsPinnedToLeftSide; bool m_cachedMainFrameIsPinnedToRightSide; }; diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in index 0c0eea5..69bd54d 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in @@ -42,6 +42,8 @@ messages -> WebPage { TouchEvent(WebKit::WebTouchEvent event) #endif + ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity) + GoBack(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle) GoForward(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle) GoToBackForwardItem(uint64_t backForwardItemID, WebKit::SandboxExtension::Handle sandboxExtensionHandle) @@ -55,6 +57,7 @@ messages -> WebPage { StopLoadingFrame(uint64_t frameID) + RestoreSession(WebKit::SessionState state) RestoreSessionAndNavigateToCurrentItem(WebKit::SessionState state, WebKit::SandboxExtension::Handle sandboxExtensionHandle) DidRemoveBackForwardItem(uint64_t backForwardItemID) @@ -181,6 +184,7 @@ messages -> WebPage { FirstRectForCharacterRange(uint64_t location, uint64_t length) -> (WebCore::IntRect resultRect) RegisterUIProcessAccessibilityTokens(CoreIPC::DataReference elemenToken, CoreIPC::DataReference windowToken) WriteSelectionToPasteboard(WTF::String pasteboardName, WTF::Vector<WTF::String> pasteboardTypes) -> (bool result) + ReadSelectionFromPasteboard(WTF::String pasteboardName) -> (bool result) #endif #if PLATFORM(WIN) ConfirmComposition(WTF::String compositionString) @@ -191,4 +195,8 @@ messages -> WebPage { #if PLATFORM(QT) FindZoomableAreaForPoint(WebCore::IntPoint point) #endif + +#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) + HandleCorrectionPanelResult(String result) +#endif } diff --git a/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp index 494f5e6..2460607 100644 --- a/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm +++ b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp @@ -23,39 +23,31 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#import "config.h" -#import "LayerTreeHostMac.h" - -#import "DrawingAreaImpl.h" -#import "WebPage.h" -#import "WebProcess.h" -#import <QuartzCore/CATransaction.h> -#import <WebCore/Frame.h> -#import <WebCore/FrameView.h> -#import <WebCore/Page.h> -#import <WebCore/Settings.h> -#import <WebKitSystemInterface.h> - -@interface CATransaction (Details) -+ (void)synchronize; -@end +#include "config.h" +#include "LayerTreeHostCA.h" + +#include "DrawingAreaImpl.h" +#include "WebPage.h" +#include "WebProcess.h" +#include <WebCore/Frame.h> +#include <WebCore/FrameView.h> +#include <WebCore/Page.h> +#include <WebCore/Settings.h> using namespace WebCore; namespace WebKit { -PassRefPtr<LayerTreeHostMac> LayerTreeHostMac::create(WebPage* webPage) +PassRefPtr<LayerTreeHostCA> LayerTreeHostCA::create(WebPage* webPage) { - return adoptRef(new LayerTreeHostMac(webPage)); + return adoptRef(new LayerTreeHostCA(webPage)); } -LayerTreeHostMac::LayerTreeHostMac(WebPage* webPage) +LayerTreeHostCA::LayerTreeHostCA(WebPage* webPage) : LayerTreeHost(webPage) , m_isValid(true) , m_notifyAfterScheduledLayerFlush(false) { - mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort(); - m_remoteLayerClient = WKCARemoteLayerClientMakeWithServerPort(serverPort); // Create a root layer. m_rootLayer = GraphicsLayer::create(this); @@ -65,8 +57,6 @@ LayerTreeHostMac::LayerTreeHostMac(WebPage* webPage) m_rootLayer->setDrawsContent(false); m_rootLayer->setSize(webPage->size()); - [m_rootLayer->platformLayer() setGeometryFlipped:YES]; - m_nonCompositedContentLayer = GraphicsLayer::create(this); #ifndef NDEBUG m_nonCompositedContentLayer->setName("LayerTreeHost non-composited content"); @@ -79,53 +69,35 @@ LayerTreeHostMac::LayerTreeHostMac(WebPage* webPage) m_rootLayer->addChild(m_nonCompositedContentLayer.get()); - WKCARemoteLayerClientSetLayer(m_remoteLayerClient.get(), m_rootLayer->platformLayer()); - if (m_webPage->hasPageOverlay()) createPageOverlayLayer(); - scheduleLayerFlush(); + platformInitialize(); - m_layerTreeContext.contextID = WKCARemoteLayerClientGetClientId(m_remoteLayerClient.get()); + scheduleLayerFlush(); } -LayerTreeHostMac::~LayerTreeHostMac() +LayerTreeHostCA::~LayerTreeHostCA() { ASSERT(!m_isValid); + ASSERT(!m_rootLayer); +#if PLATFORM(MAC) ASSERT(!m_flushPendingLayerChangesRunLoopObserver); ASSERT(!m_remoteLayerClient); - ASSERT(!m_rootLayer); +#endif } -const LayerTreeContext& LayerTreeHostMac::layerTreeContext() +const LayerTreeContext& LayerTreeHostCA::layerTreeContext() { return m_layerTreeContext; } -void LayerTreeHostMac::scheduleLayerFlush() -{ - CFRunLoopRef currentRunLoop = CFRunLoopGetCurrent(); - - // Make sure we wake up the loop or the observer could be delayed until some other source fires. - CFRunLoopWakeUp(currentRunLoop); - - if (m_flushPendingLayerChangesRunLoopObserver) - return; - - // Run before the Core Animation commit observer, which has order 2000000. - const CFIndex runLoopOrder = 2000000 - 1; - CFRunLoopObserverContext context = { 0, this, 0, 0, 0 }; - m_flushPendingLayerChangesRunLoopObserver.adoptCF(CFRunLoopObserverCreate(0, kCFRunLoopBeforeWaiting | kCFRunLoopExit, true, runLoopOrder, flushPendingLayerChangesRunLoopObserverCallback, &context)); - - CFRunLoopAddObserver(currentRunLoop, m_flushPendingLayerChangesRunLoopObserver.get(), kCFRunLoopCommonModes); -} - -void LayerTreeHostMac::setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush) +void LayerTreeHostCA::setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush) { m_notifyAfterScheduledLayerFlush = notifyAfterScheduledLayerFlush; } -void LayerTreeHostMac::setRootCompositingLayer(GraphicsLayer* graphicsLayer) +void LayerTreeHostCA::setRootCompositingLayer(GraphicsLayer* graphicsLayer) { m_nonCompositedContentLayer->removeAllChildren(); @@ -134,22 +106,15 @@ void LayerTreeHostMac::setRootCompositingLayer(GraphicsLayer* graphicsLayer) m_nonCompositedContentLayer->addChild(graphicsLayer); } -void LayerTreeHostMac::invalidate() +void LayerTreeHostCA::invalidate() { ASSERT(m_isValid); - - if (m_flushPendingLayerChangesRunLoopObserver) { - CFRunLoopObserverInvalidate(m_flushPendingLayerChangesRunLoopObserver.get()); - m_flushPendingLayerChangesRunLoopObserver = nullptr; - } - - WKCARemoteLayerClientInvalidate(m_remoteLayerClient.get()); - m_remoteLayerClient = nullptr; + platformInvalidate(); m_rootLayer = nullptr; m_isValid = false; } -void LayerTreeHostMac::setNonCompositedContentsNeedDisplay(const IntRect& rect) +void LayerTreeHostCA::setNonCompositedContentsNeedDisplay(const IntRect& rect) { m_nonCompositedContentLayer->setNeedsDisplayInRect(rect); if (m_pageOverlayLayer) @@ -158,12 +123,12 @@ void LayerTreeHostMac::setNonCompositedContentsNeedDisplay(const IntRect& rect) scheduleLayerFlush(); } -void LayerTreeHostMac::scrollNonCompositedContents(const IntRect& scrollRect, const IntSize& scrollOffset) +void LayerTreeHostCA::scrollNonCompositedContents(const IntRect& scrollRect, const IntSize& scrollOffset) { setNonCompositedContentsNeedDisplay(scrollRect); } -void LayerTreeHostMac::sizeDidChange(const IntSize& newSize) +void LayerTreeHostCA::sizeDidChange(const IntSize& newSize) { m_rootLayer->setSize(newSize); m_nonCompositedContentLayer->setSize(newSize); @@ -174,47 +139,45 @@ void LayerTreeHostMac::sizeDidChange(const IntSize& newSize) scheduleLayerFlush(); flushPendingLayerChanges(); - [CATransaction flush]; - [CATransaction synchronize]; + platformSizeDidChange(); } -void LayerTreeHostMac::forceRepaint() +void LayerTreeHostCA::forceRepaint() { scheduleLayerFlush(); flushPendingLayerChanges(); - [CATransaction flush]; - [CATransaction synchronize]; + platformForceRepaint(); } -void LayerTreeHostMac::didInstallPageOverlay() +void LayerTreeHostCA::didInstallPageOverlay() { createPageOverlayLayer(); scheduleLayerFlush(); } -void LayerTreeHostMac::didUninstallPageOverlay() +void LayerTreeHostCA::didUninstallPageOverlay() { destroyPageOverlayLayer(); scheduleLayerFlush(); } -void LayerTreeHostMac::setPageOverlayNeedsDisplay(const IntRect& rect) +void LayerTreeHostCA::setPageOverlayNeedsDisplay(const IntRect& rect) { ASSERT(m_pageOverlayLayer); m_pageOverlayLayer->setNeedsDisplayInRect(rect); scheduleLayerFlush(); } -void LayerTreeHostMac::notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) +void LayerTreeHostCA::notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) { } -void LayerTreeHostMac::notifySyncRequired(const WebCore::GraphicsLayer*) +void LayerTreeHostCA::notifySyncRequired(const WebCore::GraphicsLayer*) { } -void LayerTreeHostMac::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect) +void LayerTreeHostCA::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect) { if (graphicsLayer == m_nonCompositedContentLayer) { m_webPage->drawRect(graphicsContext, clipRect); @@ -227,25 +190,20 @@ void LayerTreeHostMac::paintContents(const GraphicsLayer* graphicsLayer, Graphic } } -bool LayerTreeHostMac::showDebugBorders() const +bool LayerTreeHostCA::showDebugBorders() const { return m_webPage->corePage()->settings()->showDebugBorders(); } -bool LayerTreeHostMac::showRepaintCounter() const +bool LayerTreeHostCA::showRepaintCounter() const { return m_webPage->corePage()->settings()->showRepaintCounter(); } -void LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* context) -{ - static_cast<LayerTreeHostMac*>(context)->flushPendingLayerChangesRunLoopObserverCallback(); -} - -void LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback() +void LayerTreeHostCA::performScheduledLayerFlush() { { - RefPtr<LayerTreeHostMac> protect(this); + RefPtr<LayerTreeHostCA> protect(this); m_webPage->layoutIfNeeded(); if (!m_isValid) @@ -255,10 +213,12 @@ void LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback() if (!flushPendingLayerChanges()) return; - // We successfully flushed the pending layer changes, remove the run loop observer. - ASSERT(m_flushPendingLayerChangesRunLoopObserver); - CFRunLoopObserverInvalidate(m_flushPendingLayerChangesRunLoopObserver.get()); - m_flushPendingLayerChangesRunLoopObserver = 0; + didPerformScheduledLayerFlush(); +} + +void LayerTreeHostCA::didPerformScheduledLayerFlush() +{ + platformDidPerformScheduledLayerFlush(); if (m_notifyAfterScheduledLayerFlush) { // Let the drawing area know that we've done a flush of the layer changes. @@ -267,7 +227,7 @@ void LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback() } } -bool LayerTreeHostMac::flushPendingLayerChanges() +bool LayerTreeHostCA::flushPendingLayerChanges() { m_rootLayer->syncCompositingStateForThisLayerOnly(); m_nonCompositedContentLayer->syncCompositingStateForThisLayerOnly(); @@ -277,7 +237,7 @@ bool LayerTreeHostMac::flushPendingLayerChanges() return m_webPage->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes(); } -void LayerTreeHostMac::createPageOverlayLayer() +void LayerTreeHostCA::createPageOverlayLayer() { ASSERT(!m_pageOverlayLayer); @@ -292,7 +252,7 @@ void LayerTreeHostMac::createPageOverlayLayer() m_rootLayer->addChild(m_pageOverlayLayer.get()); } -void LayerTreeHostMac::destroyPageOverlayLayer() +void LayerTreeHostCA::destroyPageOverlayLayer() { ASSERT(m_pageOverlayLayer); m_pageOverlayLayer->removeFromParent(); diff --git a/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h index d05e43e..ba4e33a 100644 --- a/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h +++ b/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h @@ -23,26 +23,31 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LayerTreeHostMac_h -#define LayerTreeHostMac_h +#ifndef LayerTreeHostCA_h +#define LayerTreeHostCA_h #include "LayerTreeContext.h" #include "LayerTreeHost.h" #include <WebCore/GraphicsLayerClient.h> #include <wtf/OwnPtr.h> + +#if PLATFORM(MAC) #include <wtf/RetainPtr.h> +#endif +#if PLATFORM(MAC) typedef struct __WKCARemoteLayerClientRef* WKCARemoteLayerClientRef; +#endif namespace WebKit { -class LayerTreeHostMac : public LayerTreeHost, WebCore::GraphicsLayerClient { +class LayerTreeHostCA : public LayerTreeHost, WebCore::GraphicsLayerClient { public: - static PassRefPtr<LayerTreeHostMac> create(WebPage*); - ~LayerTreeHostMac(); + static PassRefPtr<LayerTreeHostCA> create(WebPage*); + ~LayerTreeHostCA(); private: - explicit LayerTreeHostMac(WebPage*); + explicit LayerTreeHostCA(WebPage*); // LayerTreeHost. virtual const LayerTreeContext& layerTreeContext(); @@ -67,13 +72,23 @@ private: virtual bool showDebugBorders() const; virtual bool showRepaintCounter() const; - static void flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void*); - void flushPendingLayerChangesRunLoopObserverCallback(); + void platformInitialize(); + void platformInvalidate(); + void platformSizeDidChange(); + void platformForceRepaint(); + + void performScheduledLayerFlush(); + void didPerformScheduledLayerFlush(); + void platformDidPerformScheduledLayerFlush(); bool flushPendingLayerChanges(); void createPageOverlayLayer(); void destroyPageOverlayLayer(); +#if PLATFORM(MAC) + static void flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void*); +#endif + // The context for this layer tree. LayerTreeContext m_layerTreeContext; @@ -93,10 +108,12 @@ private: // The page overlay layer. Will be null if there's no page overlay. OwnPtr<WebCore::GraphicsLayer> m_pageOverlayLayer; +#if PLATFORM(MAC) RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient; RetainPtr<CFRunLoopObserverRef> m_flushPendingLayerChangesRunLoopObserver; +#endif }; } // namespace WebKit -#endif // LayerTreeHostMac_h +#endif // LayerTreeHostCA_h diff --git a/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm b/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm new file mode 100644 index 0000000..50776d7 --- /dev/null +++ b/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "config.h" +#import "LayerTreeHostCA.h" + +#import "WebProcess.h" +#import <QuartzCore/CATransaction.h> +#import <WebCore/GraphicsLayer.h> +#import <WebKitSystemInterface.h> + +@interface CATransaction (Details) ++ (void)synchronize; +@end + +namespace WebKit { + +void LayerTreeHostCA::platformInitialize() +{ + mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort(); + m_remoteLayerClient = WKCARemoteLayerClientMakeWithServerPort(serverPort); + + [m_rootLayer->platformLayer() setGeometryFlipped:YES]; + + WKCARemoteLayerClientSetLayer(m_remoteLayerClient.get(), m_rootLayer->platformLayer()); + + m_layerTreeContext.contextID = WKCARemoteLayerClientGetClientId(m_remoteLayerClient.get()); +} + +void LayerTreeHostCA::scheduleLayerFlush() +{ + CFRunLoopRef currentRunLoop = CFRunLoopGetCurrent(); + + // Make sure we wake up the loop or the observer could be delayed until some other source fires. + CFRunLoopWakeUp(currentRunLoop); + + if (m_flushPendingLayerChangesRunLoopObserver) + return; + + // Run before the Core Animation commit observer, which has order 2000000. + const CFIndex runLoopOrder = 2000000 - 1; + CFRunLoopObserverContext context = { 0, this, 0, 0, 0 }; + m_flushPendingLayerChangesRunLoopObserver.adoptCF(CFRunLoopObserverCreate(0, kCFRunLoopBeforeWaiting | kCFRunLoopExit, true, runLoopOrder, flushPendingLayerChangesRunLoopObserverCallback, &context)); + + CFRunLoopAddObserver(currentRunLoop, m_flushPendingLayerChangesRunLoopObserver.get(), kCFRunLoopCommonModes); +} + +void LayerTreeHostCA::platformInvalidate() +{ + if (m_flushPendingLayerChangesRunLoopObserver) { + CFRunLoopObserverInvalidate(m_flushPendingLayerChangesRunLoopObserver.get()); + m_flushPendingLayerChangesRunLoopObserver = nullptr; + } + + WKCARemoteLayerClientInvalidate(m_remoteLayerClient.get()); + m_remoteLayerClient = nullptr; +} + +void LayerTreeHostCA::platformSizeDidChange() +{ + [CATransaction flush]; + [CATransaction synchronize]; +} + +void LayerTreeHostCA::platformForceRepaint() +{ + [CATransaction flush]; + [CATransaction synchronize]; +} + +void LayerTreeHostCA::flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* context) +{ + // This gets called outside of the normal event loop so wrap in an autorelease pool + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + static_cast<LayerTreeHostCA*>(context)->performScheduledLayerFlush(); + [pool drain]; +} + +void LayerTreeHostCA::platformDidPerformScheduledLayerFlush() +{ + // We successfully flushed the pending layer changes, remove the run loop observer. + ASSERT(m_flushPendingLayerChangesRunLoopObserver); + CFRunLoopObserverInvalidate(m_flushPendingLayerChangesRunLoopObserver.get()); + m_flushPendingLayerChangesRunLoopObserver = 0; +} + +} // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp b/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp new file mode 100644 index 0000000..81db03e --- /dev/null +++ b/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "LayerTreeHostCA.h" + +#include <WebCore/NotImplemented.h> + +namespace WebKit { + +void LayerTreeHostCA::platformInitialize() +{ + // FIXME: <http://webkit.org/b/45567> Implement this! + notImplemented(); +} + +void LayerTreeHostCA::scheduleLayerFlush() +{ + // FIXME: <http://webkit.org/b/45567> Implement this! + notImplemented(); +} + +void LayerTreeHostCA::platformInvalidate() +{ + // FIXME: <http://webkit.org/b/45567> Implement this! + notImplemented(); +} + +void LayerTreeHostCA::platformSizeDidChange() +{ + // FIXME: <http://webkit.org/b/45567> Implement this! + notImplemented(); +} + +void LayerTreeHostCA::platformForceRepaint() +{ + // FIXME: <http://webkit.org/b/45567> Implement this! + notImplemented(); +} + +void LayerTreeHostCA::platformDidPerformScheduledLayerFlush() +{ + // FIXME: <http://webkit.org/b/45567> Implement this! + notImplemented(); +} + +} // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebPage/mac/AccessibilityWebPageObject.mm b/Source/WebKit2/WebProcess/WebPage/mac/AccessibilityWebPageObject.mm index c88ab7e..1d036fa 100644 --- a/Source/WebKit2/WebProcess/WebPage/mac/AccessibilityWebPageObject.mm +++ b/Source/WebKit2/WebProcess/WebPage/mac/AccessibilityWebPageObject.mm @@ -175,10 +175,12 @@ using namespace WebKit; point.y -= remotePosition.y; point.x -= remotePosition.x; - WebCore::FrameView* fv = m_page->mainFrame()->coreFrame()->view(); - if (fv) { - point.y += fv->scrollPosition().y(); - point.x += fv->scrollPosition().x(); + if (m_page && m_page->mainFrame() && m_page->mainFrame()->coreFrame()) { + WebCore::FrameView* fv = m_page->mainFrame()->coreFrame()->view(); + if (fv) { + point.y += fv->scrollPosition().y(); + point.x += fv->scrollPosition().x(); + } } return [[self accessibilityRootObjectWrapper] accessibilityHitTest:point]; @@ -186,7 +188,7 @@ using namespace WebKit; - (id)accessibilityFocusedUIElement { - return NSAccessibilityUnignoredDescendant(self); + return [[self accessibilityRootObjectWrapper] accessibilityFocusedUIElement]; } diff --git a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm index 4cae5aa..8d81889 100644 --- a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm +++ b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -46,6 +46,7 @@ #import <WebCore/ScrollView.h> #import <WebCore/TextIterator.h> #import <WebCore/WindowsKeyboardCodes.h> +#import <WebCore/visible_units.h> #import <WebKitSystemInterface.h> using namespace WebCore; @@ -76,8 +77,6 @@ void WebPage::platformPreferencesDidChange(const WebPreferencesStore&) { } -// FIXME: need to add support for input methods - bool WebPage::interceptEditingKeyboardEvent(KeyboardEvent* evt, bool shouldSaveCommand) { Node* node = evt->target()->toNode(); @@ -164,12 +163,12 @@ void WebPage::getMarkedRange(uint64_t& location, uint64_t& length) getLocationAndLengthFromRange(frame->editor()->compositionRange().get(), location, length); } -static PassRefPtr<Range> characterRangeAtPoint(Frame* frame, const IntPoint& point) + +static PassRefPtr<Range> characterRangeAtPositionForPoint(Frame* frame, const VisiblePosition& position, const IntPoint& point) { - VisiblePosition position = frame->visiblePositionForPoint(point); if (position.isNull()) return 0; - + VisiblePosition previous = position.previous(); if (previous.isNotNull()) { RefPtr<Range> previousCharacterRange = makeRange(previous, position); @@ -188,7 +187,12 @@ static PassRefPtr<Range> characterRangeAtPoint(Frame* frame, const IntPoint& poi return 0; } - + +static PassRefPtr<Range> characterRangeAtPoint(Frame* frame, const IntPoint& point) +{ + return characterRangeAtPositionForPoint(frame, frame->visiblePositionForPoint(point), point); +} + void WebPage::characterIndexForPoint(IntPoint point, uint64_t& index) { index = NSNotFound; @@ -242,6 +246,32 @@ void WebPage::firstRectForCharacterRange(uint64_t location, uint64_t length, Web resultRect = frame->view()->contentsToWindow(rect); } +static bool isPositionInRange(const VisiblePosition& position, Range* range) +{ + RefPtr<Range> positionRange = makeRange(position, position); + + ExceptionCode ec = 0; + range->compareBoundaryPoints(Range::START_TO_START, positionRange.get(), ec); + if (ec) + return false; + + if (!range->isPointInRange(positionRange->startContainer(), positionRange->startOffset(), ec)) + return false; + if (ec) + return false; + + return true; +} + +static bool shouldUseSelection(const VisiblePosition& position, const VisibleSelection& selection) +{ + RefPtr<Range> selectedRange = selection.toNormalizedRange(); + if (!selectedRange) + return false; + + return isPositionInRange(position, selectedRange.get()); +} + void WebPage::performDictionaryLookupAtLocation(const FloatPoint& floatPoint) { Frame* frame = m_page->mainFrame(); @@ -250,46 +280,78 @@ void WebPage::performDictionaryLookupAtLocation(const FloatPoint& floatPoint) // Find the frame the point is over. IntPoint point = roundedIntPoint(floatPoint); - HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(point, false); frame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController()->focusedOrMainFrame(); - // Figure out if there are any characters under the point. - RefPtr<Range> characterRange = characterRangeAtPoint(frame, frame->view()->windowToContents(point)); - if (!characterRange) + IntPoint translatedPoint = frame->view()->windowToContents(point); + VisiblePosition position = frame->visiblePositionForPoint(translatedPoint); + + // Don't do anything if there is no character at the point. + if (!characterRangeAtPositionForPoint(frame, position, translatedPoint)) return; - // Grab the currently selected text. - RefPtr<Range> selectedRange = m_page->focusController()->focusedOrMainFrame()->selection()->selection().toNormalizedRange(); - - // Use the selected text if the point was anywhere in it. Assertain this by seeing if either character range - // the mouse is over is contained by the selection range. - if (characterRange && selectedRange) { - ExceptionCode ec = 0; - selectedRange->compareBoundaryPoints(Range::START_TO_START, characterRange.get(), ec); - if (!ec) { - if (selectedRange->isPointInRange(characterRange->startContainer(), characterRange->startOffset(), ec)) { - if (!ec) - characterRange = selectedRange; - } - } + VisibleSelection selection = m_page->focusController()->focusedOrMainFrame()->selection()->selection(); + if (shouldUseSelection(position, selection)) { + performDictionaryLookupForSelection(DictionaryPopupInfo::HotKey, frame, selection); + return; } - if (!characterRange) - return; + NSDictionary *options = nil; + +#if !defined(BUILDING_ON_SNOW_LEOPARD) + // As context, we are going to use the surrounding paragraph of text. + VisiblePosition paragraphStart = startOfParagraph(position); + VisiblePosition paragraphEnd = endOfParagraph(position); + + NSRange rangeToPass = NSMakeRange(TextIterator::rangeLength(makeRange(paragraphStart, position).get()), 0); - // Ensure we have whole words. - VisibleSelection selection(characterRange.get()); - selection.expandUsingGranularity(WordGranularity); + RefPtr<Range> fullCharacterRange = makeRange(paragraphStart, paragraphEnd); + String fullPlainTextString = plainText(fullCharacterRange.get()); - RefPtr<Range> finalRange = selection.toNormalizedRange(); + NSRange extractedRange = WKExtractWordDefinitionTokenRangeFromContextualString(fullPlainTextString, rangeToPass, &options); + + RefPtr<Range> finalRange = TextIterator::subrange(fullCharacterRange.get(), extractedRange.location, extractedRange.length); + if (!finalRange) + return; +#else + RefPtr<Range> finalRange = makeRange(startOfWord(position), endOfWord(position)); if (!finalRange) return; +#endif + + performDictionaryLookupForRange(DictionaryPopupInfo::HotKey, frame, finalRange.get(), options); +} + +void WebPage::performDictionaryLookupForSelection(DictionaryPopupInfo::Type type, Frame* frame, const VisibleSelection& selection) +{ + RefPtr<Range> selectedRange = selection.toNormalizedRange(); + if (!selectedRange) + return; - performDictionaryLookupForRange(DictionaryPopupInfo::HotKey, frame, finalRange.get()); + NSDictionary *options = nil; + +#if !defined(BUILDING_ON_SNOW_LEOPARD) + VisiblePosition selectionStart = selection.visibleStart(); + VisiblePosition selectionEnd = selection.visibleEnd(); + + // As context, we are going to use the surrounding paragraphs of text. + VisiblePosition paragraphStart = startOfParagraph(selectionStart); + VisiblePosition paragraphEnd = endOfParagraph(selectionEnd); + + int lengthToSelectionStart = TextIterator::rangeLength(makeRange(paragraphStart, selectionStart).get()); + int lengthToSelectionEnd = TextIterator::rangeLength(makeRange(paragraphStart, selectionEnd).get()); + NSRange rangeToPass = NSMakeRange(lengthToSelectionStart, lengthToSelectionEnd - lengthToSelectionStart); + + String fullPlainTextString = plainText(makeRange(paragraphStart, paragraphEnd).get()); + + // Since we already have the range we want, we just need to grab the returned options. + WKExtractWordDefinitionTokenRangeFromContextualString(fullPlainTextString, rangeToPass, &options); +#endif + + performDictionaryLookupForRange(type, frame, selectedRange.get(), options); } -void WebPage::performDictionaryLookupForRange(DictionaryPopupInfo::Type type, Frame* frame, Range* range) +void WebPage::performDictionaryLookupForRange(DictionaryPopupInfo::Type type, Frame* frame, Range* range, NSDictionary *options) { String rangeText = range->text(); if (rangeText.stripWhiteSpace().isEmpty()) @@ -316,20 +378,11 @@ void WebPage::performDictionaryLookupForRange(DictionaryPopupInfo::Type type, Fr dictionaryPopupInfo.type = type; dictionaryPopupInfo.origin = FloatPoint(rangeRect.x(), rangeRect.y()); dictionaryPopupInfo.fontInfo.fontAttributeDictionary = fontDescriptorAttributes; + dictionaryPopupInfo.options = (CFDictionaryRef)options; send(Messages::WebPageProxy::DidPerformDictionaryLookup(rangeText, dictionaryPopupInfo)); } -static inline void scroll(Page* page, ScrollDirection direction, ScrollGranularity granularity) -{ - page->focusController()->focusedOrMainFrame()->eventHandler()->scrollRecursively(direction, granularity); -} - -static inline void logicalScroll(Page* page, ScrollLogicalDirection direction, ScrollGranularity granularity) -{ - page->focusController()->focusedOrMainFrame()->eventHandler()->logicalScrollRecursively(direction, granularity); -} - bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboardEvent) { if (keyboardEvent.type() != WebEvent::KeyDown) @@ -390,7 +443,7 @@ bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboard if (keyboardEvent.metaKey()) m_page->goBack(); else { - if (keyboardEvent.altKey() | keyboardEvent.controlKey()) + if (keyboardEvent.altKey() || keyboardEvent.controlKey()) scroll(m_page.get(), ScrollLeft, ScrollByPage); else scroll(m_page.get(), ScrollLeft, ScrollByLine); @@ -435,6 +488,13 @@ void WebPage::writeSelectionToPasteboard(const String& pasteboardName, const Vec result = true; } +void WebPage::readSelectionFromPasteboard(const String& pasteboardName, bool& result) +{ + Frame* frame = m_page->focusController()->focusedOrMainFrame(); + frame->editor()->readSelectionFromPasteboard(pasteboardName); + result = true; +} + AccessibilityWebPageObject* WebPage::accessibilityRemoteObject() { return m_mockAccessibilityElement.get(); @@ -472,13 +532,26 @@ String WebPage::cachedResponseMIMETypeForURL(const WebCore::KURL& url) return [[cachedResponse response] MIMEType]; } -bool WebPage::canHandleRequest(const WebCore::ResourceRequest& request) +bool WebPage::platformCanHandleRequest(const WebCore::ResourceRequest& request) { if ([NSURLConnection canHandleRequest:request.nsURLRequest()]) - return YES; + return true; // FIXME: Return true if this scheme is any one WebKit2 knows how to handle. return request.url().protocolIs("applewebdata"); } +void WebPage::setDragSource(NSObject *dragSource) +{ + m_dragSource = dragSource; +} + +void WebPage::platformDragEnded() +{ + // The drag source we care about here is NSFilePromiseDragSource, which doesn't look at + // the arguments. It's OK to just pass arbitrary constant values, so we just pass all zeroes. + [m_dragSource.get() draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationNone]; + m_dragSource = nullptr; +} + } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp index cad0c04..de8385c 100644 --- a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp +++ b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp @@ -277,7 +277,7 @@ String WebPage::cachedResponseMIMETypeForURL(const WebCore::KURL&) return String(); } -bool WebPage::canHandleRequest(const WebCore::ResourceRequest&) +bool WebPage::platformCanHandleRequest(const WebCore::ResourceRequest&) { // FIXME: Implement return true; diff --git a/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp b/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp index 73ba2b2..41bb219 100644 --- a/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp +++ b/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp @@ -192,16 +192,6 @@ const char* WebPage::interpretKeyEvent(const KeyboardEvent* evt) return mapKey ? keyPressCommandsMap->get(mapKey) : 0; } -static inline void scroll(Page* page, ScrollDirection direction, ScrollGranularity granularity) -{ - page->focusController()->focusedOrMainFrame()->eventHandler()->scrollRecursively(direction, granularity); -} - -static inline void logicalScroll(Page* page, ScrollLogicalDirection direction, ScrollGranularity granularity) -{ - page->focusController()->focusedOrMainFrame()->eventHandler()->logicalScrollRecursively(direction, granularity); -} - bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboardEvent) { if (keyboardEvent.type() != WebEvent::KeyDown && keyboardEvent.type() != WebEvent::RawKeyDown) @@ -209,33 +199,53 @@ bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboard switch (keyboardEvent.windowsVirtualKeyCode()) { case VK_BACK: + if (keyboardEvent.isSystemKey()) + return false; if (keyboardEvent.shiftKey()) m_page->goForward(); else m_page->goBack(); break; case VK_LEFT: - scroll(m_page.get(), ScrollLeft, ScrollByLine); + if (keyboardEvent.isSystemKey()) + m_page->goBack(); + else + scroll(m_page.get(), ScrollLeft, ScrollByLine); break; case VK_RIGHT: - scroll(m_page.get(), ScrollRight, ScrollByLine); + if (keyboardEvent.isSystemKey()) + m_page->goForward(); + else + scroll(m_page.get(), ScrollRight, ScrollByLine); break; case VK_UP: + if (keyboardEvent.isSystemKey()) + return false; scroll(m_page.get(), ScrollUp, ScrollByLine); break; case VK_DOWN: + if (keyboardEvent.isSystemKey()) + return false; scroll(m_page.get(), ScrollDown, ScrollByLine); break; case VK_HOME: + if (keyboardEvent.isSystemKey()) + return false; logicalScroll(m_page.get(), ScrollBlockDirectionBackward, ScrollByDocument); break; case VK_END: + if (keyboardEvent.isSystemKey()) + return false; logicalScroll(m_page.get(), ScrollBlockDirectionForward, ScrollByDocument); break; case VK_PRIOR: + if (keyboardEvent.isSystemKey()) + return false; logicalScroll(m_page.get(), ScrollBlockDirectionBackward, ScrollByPage); break; case VK_NEXT: + if (keyboardEvent.isSystemKey()) + return false; logicalScroll(m_page.get(), ScrollBlockDirectionForward, ScrollByPage); break; default: @@ -296,10 +306,9 @@ String WebPage::cachedResponseMIMETypeForURL(const WebCore::KURL& url) #endif } -bool WebPage::canHandleRequest(const WebCore::ResourceRequest& request) +bool WebPage::platformCanHandleRequest(const WebCore::ResourceRequest& request) { #if USE(CFNETWORK) - // FIXME: Are there other requests we need to be able to handle? WebKit1's WebView.cpp has a FIXME here as well. return CFURLProtocolCanHandleRequest(request.cfURLRequest()); #else return true; diff --git a/Source/WebKit2/WebProcess/WebProcess.cpp b/Source/WebKit2/WebProcess/WebProcess.cpp index 6de748f..ba3290b 100644 --- a/Source/WebKit2/WebProcess/WebProcess.cpp +++ b/Source/WebKit2/WebProcess/WebProcess.cpp @@ -41,6 +41,7 @@ #include "WebFrame.h" #include "WebGeolocationManagerMessages.h" #include "WebKeyValueStorageManager.h" +#include "WebMediaCacheManager.h" #include "WebMemorySampler.h" #include "WebPage.h" #include "WebPageCreationParameters.h" @@ -50,6 +51,7 @@ #include "WebProcessMessages.h" #include "WebProcessProxyMessages.h" #include "WebResourceCacheManager.h" +#include <WebCore/AXObjectCache.h> #include <WebCore/ApplicationCacheStorage.h> #include <WebCore/CrossOriginPreflightResultCache.h> #include <WebCore/Font.h> @@ -62,6 +64,7 @@ #include <WebCore/SchemeRegistry.h> #include <WebCore/SecurityOrigin.h> #include <WebCore/Settings.h> +#include <WebCore/StorageTracker.h> #include <wtf/PassRefPtr.h> #include <wtf/RandomNumber.h> @@ -126,6 +129,7 @@ WebProcess::WebProcess() #endif , m_textCheckerState() , m_geolocationManager(this) + , m_iconDatabaseProxy(this) { #if USE(PLATFORM_STRATEGIES) // Initialize our platform strategies. @@ -175,6 +179,15 @@ void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parame WebDatabaseManager::initialize(parameters.databaseDirectory); #endif +#if ENABLE(ICONDATABASE) + m_iconDatabaseProxy.setEnabled(parameters.iconDatabaseEnabled); +#endif + +#if ENABLE(DOM_STORAGE) + StorageTracker::initializeTracker(parameters.localStorageDirectory); + m_localStorageDirectory = parameters.localStorageDirectory; +#endif + #if ENABLE(OFFLINE_WEB_APPLICATIONS) if (!parameters.applicationCacheDirectory.isEmpty()) cacheStorage().setCacheDirectory(parameters.applicationCacheDirectory); @@ -453,6 +466,17 @@ void WebProcess::calculateCacheSizes(CacheModel cacheModel, uint64_t memorySize, }; } +WebPage* WebProcess::focusedWebPage() const +{ + HashMap<uint64_t, RefPtr<WebPage> >::const_iterator end = m_pageMap.end(); + for (HashMap<uint64_t, RefPtr<WebPage> >::const_iterator it = m_pageMap.begin(); it != end; ++it) { + WebPage* page = (*it).second.get(); + if (page->windowIsFocused()) + return page; + } + return 0; +} + WebPage* WebProcess::webPage(uint64_t pageID) const { return m_pageMap.get(pageID).get(); @@ -565,11 +589,21 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes return; } + if (messageID.is<CoreIPC::MessageClassWebIconDatabaseProxy>()) { + m_iconDatabaseProxy.didReceiveMessage(connection, messageID, arguments); + return; + } + if (messageID.is<CoreIPC::MessageClassWebKeyValueStorageManager>()) { WebKeyValueStorageManager::shared().didReceiveMessage(connection, messageID, arguments); return; } + if (messageID.is<CoreIPC::MessageClassWebMediaCacheManager>()) { + WebMediaCacheManager::shared().didReceiveMessage(connection, messageID, arguments); + return; + } + if (messageID.is<CoreIPC::MessageClassWebResourceCacheManager>()) { WebResourceCacheManager::shared().didReceiveMessage(connection, messageID, arguments); return; @@ -668,9 +702,11 @@ WebPageGroupProxy* WebProcess::webPageGroup(const WebPageGroupData& pageGroupDat return result.first->second.get(); } -void WebProcess::clearResourceCaches() +void WebProcess::clearResourceCaches(uint32_t cachesToClear) { - platformClearResourceCaches(); + ResourceCachesToClear resourceCachesToClear = static_cast<ResourceCachesToClear>(cachesToClear); + + platformClearResourceCaches(resourceCachesToClear); // Toggling the cache model like this forces the cache to evict all its in-memory resources. // FIXME: We need a better way to do this. @@ -748,6 +784,11 @@ void WebProcess::cancelDownload(uint64_t downloadID) DownloadManager::shared().cancelDownload(downloadID); } +void WebProcess::setEnhancedAccessibility(bool flag) +{ + WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility(flag); +} + void WebProcess::startMemorySampler(const SandboxExtension::Handle& sampleLogFileHandle, const String& sampleLogFilePath, const double interval) { #if ENABLE(MEMORY_SAMPLER) diff --git a/Source/WebKit2/WebProcess/WebProcess.h b/Source/WebKit2/WebProcess/WebProcess.h index 946bb69..d666910 100644 --- a/Source/WebKit2/WebProcess/WebProcess.h +++ b/Source/WebKit2/WebProcess/WebProcess.h @@ -29,11 +29,13 @@ #include "CacheModel.h" #include "ChildProcess.h" #include "DrawingArea.h" +#include "ResourceCachesToClear.h" #include "SandboxExtension.h" #include "SharedMemory.h" #include "TextCheckerState.h" #include "VisitedLinkTable.h" #include "WebGeolocationManager.h" +#include "WebIconDatabaseProxy.h" #include "WebPageGroupProxy.h" #include <WebCore/LinkHash.h> #include <wtf/Forward.h> @@ -76,7 +78,8 @@ public: WebPage* webPage(uint64_t pageID) const; void createWebPage(uint64_t pageID, const WebPageCreationParameters&); void removeWebPage(uint64_t pageID); - + WebPage* focusedWebPage() const; + InjectedBundle* injectedBundle() const { return m_injectedBundle.get(); } bool isSeparateProcess() const; @@ -116,7 +119,9 @@ public: // Geolocation WebGeolocationManager& geolocationManager() { return m_geolocationManager; } - void clearResourceCaches(); + void clearResourceCaches(uint32_t cachesToClear = AllResourceCaches); + + const String& localStorageDirectory() const { return m_localStorageDirectory; } private: WebProcess(); @@ -144,9 +149,11 @@ private: static void calculateCacheSizes(CacheModel cacheModel, uint64_t memorySize, uint64_t diskFreeSize, unsigned& cacheTotalCapacity, unsigned& cacheMinDeadCapacity, unsigned& cacheMaxDeadCapacity, double& deadDecodedDataDeletionInterval, unsigned& pageCacheCapacity, unsigned long& urlCacheMemoryCapacity, unsigned long& urlCacheDiskCapacity); - void platformClearResourceCaches(); + void platformClearResourceCaches(ResourceCachesToClear); void clearApplicationCache(); + void setEnhancedAccessibility(bool); + #if !ENABLE(PLUGIN_PROCESS) void getSitesWithPluginData(const Vector<String>& pluginPaths, uint64_t callbackID); void clearPluginSiteData(const Vector<String>& pluginPaths, const Vector<String>& sites, uint64_t flags, uint64_t maxAgeInSeconds, uint64_t callbackID); @@ -202,6 +209,9 @@ private: TextCheckerState m_textCheckerState; WebGeolocationManager m_geolocationManager; + WebIconDatabaseProxy m_iconDatabaseProxy; + + String m_localStorageDirectory; }; } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebProcess.messages.in b/Source/WebKit2/WebProcess/WebProcess.messages.in index e297179..36155a7 100644 --- a/Source/WebKit2/WebProcess/WebProcess.messages.in +++ b/Source/WebKit2/WebProcess/WebProcess.messages.in @@ -51,7 +51,7 @@ messages -> WebProcess { ClearPluginSiteData(Vector<WTF::String> pluginPaths, Vector<WTF::String> sites, uint64_t flags, uint64_t maxAgeInSeconds, uint64_t callbackID) #endif - ClearResourceCaches(); + ClearResourceCaches(uint32_t cachesToClear); ClearApplicationCache(); void StartMemorySampler(WebKit::SandboxExtension::Handle sampleLogFileHandle, WTF::String sampleLogFilePath, double interval); @@ -63,4 +63,6 @@ messages -> WebProcess { CancelDownload(uint64_t downloadID) SetTextCheckerState(WebKit::TextCheckerState textCheckerState) + + SetEnhancedAccessibility(bool flag) } diff --git a/Source/WebKit2/WebProcess/com.apple.WebProcess.sb b/Source/WebKit2/WebProcess/com.apple.WebProcess.sb index 07c1f52..fa81666 100644 --- a/Source/WebKit2/WebProcess/com.apple.WebProcess.sb +++ b/Source/WebKit2/WebProcess/com.apple.WebProcess.sb @@ -3,6 +3,10 @@ (allow ipc-posix-shm system-audit system-socket file-read-metadata) (import "system.sb") +(import "com.apple.corefoundation.sb") + +;; Distributed notifications, local pasteboard client +(corefoundation) ;; Read-only preferences and data (allow file-read* @@ -69,6 +73,10 @@ (if (positive? (string-length (param "WEBKIT_DATABASE_DIR"))) (allow file* (subpath (param "WEBKIT_DATABASE_DIR")))) +;; LocalStorage dir +(if (positive? (string-length (param "WEBKIT_LOCALSTORAGE_DIR"))) + (allow file* (subpath (param "WEBKIT_LOCALSTORAGE_DIR")))) + ;; The NSURLCache directory. (if (positive? (string-length (param "NSURL_CACHE_DIR"))) (allow file* (subpath (param "NSURL_CACHE_DIR")))) @@ -87,7 +95,6 @@ ;; Various services required by AppKit and other frameworks (allow mach-lookup (global-name "com.apple.CoreServices.coreservicesd") - (global-name "com.apple.CFPasteboardClient") (global-name "com.apple.DiskArbitration.diskarbitrationd") (global-name "com.apple.FileCoordination") (global-name "com.apple.FontObjectsServer") @@ -99,7 +106,6 @@ (global-name "com.apple.audio.coreaudiod") (global-name "com.apple.cookied") (global-name "com.apple.cvmsServ") - (global-name "com.apple.distributed_notifications.2") (global-name "com.apple.dock.server") (global-name "com.apple.ocspd") (global-name "com.apple.pasteboard.1") diff --git a/Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp b/Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp index 0deed68..77088a3 100644 --- a/Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp +++ b/Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp @@ -37,7 +37,7 @@ void WebProcess::platformSetCacheModel(CacheModel) notImplemented(); } -void WebProcess::platformClearResourceCaches() +void WebProcess::platformClearResourceCaches(ResourceCachesToClear) { notImplemented(); } diff --git a/Source/WebKit2/WebProcess/mac/WebProcessMac.mm b/Source/WebKit2/WebProcess/mac/WebProcessMac.mm index 92b36b8..88ef834 100644 --- a/Source/WebKit2/WebProcess/mac/WebProcessMac.mm +++ b/Source/WebKit2/WebProcess/mac/WebProcessMac.mm @@ -28,6 +28,7 @@ #import "FullKeyboardAccessWatcher.h" #import "SandboxExtension.h" +#import "WebPage.h" #import "WebProcessCreationParameters.h" #import <WebCore/MemoryCache.h> #import <WebCore/PageCache.h> @@ -37,6 +38,8 @@ #import <mach/host_info.h> #import <mach/mach.h> #import <mach/mach_error.h> +#import <objc/runtime.h> +#import <WebCore/LocalizedStrings.h> #if ENABLE(WEB_PROCESS_SANDBOX) #import <sandbox.h> @@ -106,8 +109,10 @@ void WebProcess::platformSetCacheModel(CacheModel cacheModel) [nsurlCache setDiskCapacity:max<unsigned long>(urlCacheDiskCapacity, [nsurlCache diskCapacity])]; // Don't shrink a big disk cache, since that would cause churn. } -void WebProcess::platformClearResourceCaches() +void WebProcess::platformClearResourceCaches(ResourceCachesToClear cachesToClear) { + if (cachesToClear == InMemoryResourceCachesOnly) + return; [[NSURLCache sharedURLCache] removeAllCachedResponses]; } @@ -152,6 +157,7 @@ static void initializeSandbox(const WebProcessCreationParameters& parameters) appendSandboxParameterConfPath(sandboxParameters, "DARWIN_USER_TEMP_DIR", _CS_DARWIN_USER_TEMP_DIR); appendSandboxParameterConfPath(sandboxParameters, "DARWIN_USER_CACHE_DIR", _CS_DARWIN_USER_CACHE_DIR); appendSandboxParameterPath(sandboxParameters, "WEBKIT_DATABASE_DIR", [(NSString *)parameters.databaseDirectory fileSystemRepresentation]); + appendSandboxParameterPath(sandboxParameters, "WEBKIT_LOCALSTORAGE_DIR", [(NSString *)parameters.localStorageDirectory fileSystemRepresentation]); appendSandboxParameterPath(sandboxParameters, "NSURL_CACHE_DIR", parameters.nsURLCachePath.data()); appendSandboxParameterPath(sandboxParameters, "UI_PROCESS_BUNDLE_RESOURCE_DIR", parameters.uiProcessBundleResourcePath.data()); sandboxParameters.append(static_cast<const char*>(0)); @@ -171,13 +177,23 @@ static void initializeSandbox(const WebProcessCreationParameters& parameters) #endif } +static id NSApplicationAccessibilityFocusedUIElement(NSApplication*, SEL) +{ + WebPage* page = WebProcess::shared().focusedWebPage(); + if (!page || !page->accessibilityRemoteObject()) + return 0; + + return [page->accessibilityRemoteObject() accessibilityFocusedUIElement]; +} + void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::ArgumentDecoder*) { + [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] bundlePath]]; + initializeSandbox(parameters); if (!parameters.parentProcessName.isNull()) { - // FIXME (WebKit2) <rdar://problem/8728860> WebKit2 needs to be localized - NSString *applicationName = [NSString stringWithFormat:@"%@ Web Content", (NSString *)parameters.parentProcessName]; + NSString *applicationName = [NSString stringWithFormat:UI_STRING("%@ Web Content", "Visible name of the web process. The argument is the application name."), (NSString *)parameters.parentProcessName]; WKSetVisibleApplicationName((CFStringRef)applicationName); } @@ -191,6 +207,11 @@ void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters } m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port(); + + // rdar://9118639 accessibilityFocusedUIElement in NSApplication defaults to use the keyWindow. Since there's + // no window in WK2, NSApplication needs to use the focused page's focused element. + Method methodToPatch = class_getInstanceMethod([NSApplication class], @selector(accessibilityFocusedUIElement)); + method_setImplementation(methodToPatch, (IMP)NSApplicationAccessibilityFocusedUIElement); } void WebProcess::platformTerminate() diff --git a/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp b/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp index 291c3e7..6ff10ba 100644 --- a/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp +++ b/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp @@ -48,13 +48,6 @@ #endif #endif -#if !defined(QWEBKIT_EXPORT) -#if defined(QT_SHARED) -#define QWEBKIT_EXPORT Q_DECL_EXPORT -#else -#define QWEBKIT_EXPORT -#endif -#endif #ifndef NDEBUG #include <QDebug> #endif @@ -89,7 +82,7 @@ bool EnvHttpProxyFactory::initializeFromEnvironment() { bool wasSetByEnvironment = false; - QUrl proxyUrl = QUrl::fromUserInput(qgetenv("http_proxy")); + QUrl proxyUrl = QUrl::fromUserInput(QString::fromLocal8Bit(qgetenv("http_proxy"))); if (proxyUrl.isValid() && !proxyUrl.host().isEmpty()) { int proxyPort = (proxyUrl.port() > 0) ? proxyUrl.port() : 8080; m_httpProxy << QNetworkProxy(QNetworkProxy::HttpProxy, proxyUrl.host(), proxyPort); @@ -97,7 +90,7 @@ bool EnvHttpProxyFactory::initializeFromEnvironment() } else m_httpProxy << QNetworkProxy::NoProxy; - proxyUrl = QUrl::fromUserInput(qgetenv("https_proxy")); + proxyUrl = QUrl::fromUserInput(QString::fromLocal8Bit(qgetenv("https_proxy"))); if (proxyUrl.isValid() && !proxyUrl.host().isEmpty()) { int proxyPort = (proxyUrl.port() > 0) ? proxyUrl.port() : 8080; m_httpsProxy << QNetworkProxy(QNetworkProxy::HttpProxy, proxyUrl.host(), proxyPort); @@ -137,9 +130,9 @@ static void initializeProxy() QNetworkProxyFactory::setUseSystemConfiguration(true); } -QWEBKIT_EXPORT int WebProcessMainQt(int argc, char** argv) +Q_DECL_EXPORT int WebProcessMainQt(int argc, char** argv) { - QApplication::setGraphicsSystem("raster"); + QApplication::setGraphicsSystem(QLatin1String("raster")); QApplication* app = new QApplication(argc, argv); #ifndef NDEBUG if (!qgetenv("WEBKIT2_PAUSE_WEB_PROCESS_ON_LAUNCH").isEmpty()) { diff --git a/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp b/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp index 459274c..919044e 100644 --- a/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp +++ b/Source/WebKit2/WebProcess/qt/WebProcessQt.cpp @@ -37,7 +37,7 @@ void WebProcess::platformSetCacheModel(CacheModel) // FIXME: Implement. } -void WebProcess::platformClearResourceCaches() +void WebProcess::platformClearResourceCaches(ResourceCachesToClear) { } diff --git a/Source/WebKit2/WebProcess/win/WebProcessWin.cpp b/Source/WebKit2/WebProcess/win/WebProcessWin.cpp index 58230d3..d56fef6 100644 --- a/Source/WebKit2/WebProcess/win/WebProcessWin.cpp +++ b/Source/WebKit2/WebProcess/win/WebProcessWin.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "WebProcess.h" +#include "WebCookieManager.h" #include "WebProcessCreationParameters.h" #include <WebCore/FileSystem.h> #include <WebCore/MemoryCache.h> @@ -98,9 +99,11 @@ void WebProcess::platformSetCacheModel(CacheModel cacheModel) #endif } -void WebProcess::platformClearResourceCaches() +void WebProcess::platformClearResourceCaches(ResourceCachesToClear cachesToClear) { #if USE(CFNETWORK) + if (cachesToClear == InMemoryResourceCachesOnly) + return; CFURLCacheRemoveAllCachedResponses(RetainPtr<CFURLCacheRef>(AdoptCF, CFURLCacheCopySharedURLCache()).get()); #endif } @@ -119,6 +122,8 @@ void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters RetainPtr<CFURLCacheRef> uiProcessCache(AdoptCF, CFURLCacheCreate(kCFAllocatorDefault, cacheMemoryCapacity, cacheDiskCapacity, cachePath.get())); CFURLCacheSetSharedURLCache(uiProcessCache.get()); #endif + + WebCookieManager::shared().setHTTPCookieAcceptPolicy(parameters.initialHTTPCookieAcceptPolicy); } void WebProcess::platformTerminate() diff --git a/Source/WebKit2/config.h b/Source/WebKit2/config.h index 36fd989..3723185 100644 --- a/Source/WebKit2/config.h +++ b/Source/WebKit2/config.h @@ -28,16 +28,6 @@ #include "autotoolsconfig.h" #endif /* defined (BUILDING_GTK__) */ -#ifdef __cplusplus - -// These undefs match up with defines in WebKit2Prefix.h for Mac OS X. -// Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h". -#undef new -#undef delete -#include <wtf/FastMalloc.h> - -#endif - #include <wtf/DisallowCType.h> #include <wtf/Platform.h> @@ -68,6 +58,8 @@ static const type& name() \ #define JS_EXPORTDATA #define JS_EXPORTCLASS +#define WTF_EXPORT_PRIVATE +#define JS_EXPORT_PRIVATE #elif defined(__APPLE__) @@ -102,6 +94,9 @@ static const type& name() \ #define JS_EXPORTCLASS #define WEBKIT_EXPORTDATA +#define WTF_EXPORT_PRIVATE +#define JS_EXPORT_PRIVATE + #include <WebCore/EmptyProtocolDefinitions.h> #elif defined(WIN32) || defined(_WIN32) @@ -136,6 +131,16 @@ static const type& name() \ #endif /* defined(WIN32) || defined(_WIN32) */ +#ifdef __cplusplus + +// These undefs match up with defines in WebKit2Prefix.h for Mac OS X. +// Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h". +#undef new +#undef delete +#include <wtf/FastMalloc.h> + +#endif + #if PLATFORM(MAC) || (OS(MAC_OS_X) && PLATFORM(QT)) #define PLUGIN_ARCHITECTURE_MAC 1 #elif PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(QT)) diff --git a/Source/WebKit2/qt/MainQt.cpp b/Source/WebKit2/qt/MainQt.cpp index d42ef05..d243514 100644 --- a/Source/WebKit2/qt/MainQt.cpp +++ b/Source/WebKit2/qt/MainQt.cpp @@ -26,16 +26,8 @@ #include <QtGlobal> -#if !defined(QWEBKIT_EXPORT) -#if defined(QT_SHARED) -#define QWEBKIT_EXPORT Q_DECL_EXPORT -#else -#define QWEBKIT_EXPORT -#endif -#endif - namespace WebKit { -QWEBKIT_EXPORT int WebProcessMainQt(int argc, char** argv); +Q_DECL_IMPORT int WebProcessMainQt(int argc, char** argv); } // The framework entry point. diff --git a/Source/WebKit2/win/WebKit2.def b/Source/WebKit2/win/WebKit2.def index 799fea9..37c5dfc 100644 --- a/Source/WebKit2/win/WebKit2.def +++ b/Source/WebKit2/win/WebKit2.def @@ -19,14 +19,6 @@ EXPORTS WebKitShouldUseFontSmoothing WebKitCreateInstance - ; Exported for WebKitTestRunner's use only - ??0KURL@WebCore@@QAE@W4ParsedURLStringTag@1@PBD@Z - ??1StringImpl@WTF@@QAE@XZ - ?equal@WTF@@YA_NPBVStringImpl@1@PBD@Z - ?equalIgnoringCase@WTF@@YA_NPAVStringImpl@1@PBD@Z - ?host@KURL@WebCore@@QBE?AVString@WTF@@XZ - ?protocol@KURL@WebCore@@QBE?AVString@WTF@@XZ - ; These functions are deprecated WebLocalizedString WebLocalizedLPCTSTR diff --git a/Source/WebKit2/win/WebKit2.make b/Source/WebKit2/win/WebKit2.make index 111d113..b53561e 100755 --- a/Source/WebKit2/win/WebKit2.make +++ b/Source/WebKit2/win/WebKit2.make @@ -1,7 +1,7 @@ !IF "$(BUILDSTYLE)"=="DEBUG" BUILDSTYLE=Debug_All !ELSE -BUILDSTYLE=Release_LTCG +BUILDSTYLE=Production !ENDIF install: @@ -9,7 +9,6 @@ install: set WebKitOutputDir=$(OBJROOT) set ConfigurationBuildDir=$(OBJROOT)\$(BUILDSTYLE) set WebKitVSPropsRedirectionDir=$(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\1\2\3\ - set PRODUCTION=1 devenv "WebKit2.submit.sln" /rebuild $(BUILDSTYLE) -xcopy "%ConfigurationBuildDir%\bin\*.exe" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y xcopy "%ConfigurationBuildDir%\bin\*.pdb" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y diff --git a/Source/WebKit2/win/WebKit2.submit.sln b/Source/WebKit2/win/WebKit2.submit.sln index 4c0089b..208a0df 100755 --- a/Source/WebKit2/win/WebKit2.submit.sln +++ b/Source/WebKit2/win/WebKit2.submit.sln @@ -17,7 +17,7 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug_All|Win32 = Debug_All|Win32 Debug|Win32 = Debug|Win32 - Release_LTCG|Win32 = Release_LTCG|Win32 + Production|Win32 = Production|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution @@ -25,24 +25,24 @@ Global {2E51ABE8-76CB-485B-A66C-46AEF4DF8ACD}.Debug_All|Win32.Build.0 = Debug_All|Win32 {2E51ABE8-76CB-485B-A66C-46AEF4DF8ACD}.Debug|Win32.ActiveCfg = Debug|Win32 {2E51ABE8-76CB-485B-A66C-46AEF4DF8ACD}.Debug|Win32.Build.0 = Debug|Win32 - {2E51ABE8-76CB-485B-A66C-46AEF4DF8ACD}.Release_LTCG|Win32.ActiveCfg = Release_LTCG|Win32 - {2E51ABE8-76CB-485B-A66C-46AEF4DF8ACD}.Release_LTCG|Win32.Build.0 = Release_LTCG|Win32 + {2E51ABE8-76CB-485B-A66C-46AEF4DF8ACD}.Production|Win32.ActiveCfg = Production|Win32 + {2E51ABE8-76CB-485B-A66C-46AEF4DF8ACD}.Production|Win32.Build.0 = Production|Win32 {2E51ABE8-76CB-485B-A66C-46AEF4DF8ACD}.Release|Win32.ActiveCfg = Release|Win32 {2E51ABE8-76CB-485B-A66C-46AEF4DF8ACD}.Release|Win32.Build.0 = Release|Win32 {2EDAD637-CBA8-4E55-97ED-7D2BBC336FDB}.Debug_All|Win32.ActiveCfg = Debug_All|Win32 {2EDAD637-CBA8-4E55-97ED-7D2BBC336FDB}.Debug_All|Win32.Build.0 = Debug_All|Win32 {2EDAD637-CBA8-4E55-97ED-7D2BBC336FDB}.Debug|Win32.ActiveCfg = Debug|Win32 {2EDAD637-CBA8-4E55-97ED-7D2BBC336FDB}.Debug|Win32.Build.0 = Debug|Win32 - {2EDAD637-CBA8-4E55-97ED-7D2BBC336FDB}.Release_LTCG|Win32.ActiveCfg = Release_LTCG|Win32 - {2EDAD637-CBA8-4E55-97ED-7D2BBC336FDB}.Release_LTCG|Win32.Build.0 = Release_LTCG|Win32 + {2EDAD637-CBA8-4E55-97ED-7D2BBC336FDB}.Production|Win32.ActiveCfg = Production|Win32 + {2EDAD637-CBA8-4E55-97ED-7D2BBC336FDB}.Production|Win32.Build.0 = Production|Win32 {2EDAD637-CBA8-4E55-97ED-7D2BBC336FDB}.Release|Win32.ActiveCfg = Release|Win32 {2EDAD637-CBA8-4E55-97ED-7D2BBC336FDB}.Release|Win32.Build.0 = Release|Win32 {AAE88FEF-509E-4D49-870B-7357922C276F}.Debug_All|Win32.ActiveCfg = Debug_All|Win32 {AAE88FEF-509E-4D49-870B-7357922C276F}.Debug_All|Win32.Build.0 = Debug_All|Win32 {AAE88FEF-509E-4D49-870B-7357922C276F}.Debug|Win32.ActiveCfg = Debug|Win32 {AAE88FEF-509E-4D49-870B-7357922C276F}.Debug|Win32.Build.0 = Debug|Win32 - {AAE88FEF-509E-4D49-870B-7357922C276F}.Release_LTCG|Win32.ActiveCfg = Release_LTCG|Win32 - {AAE88FEF-509E-4D49-870B-7357922C276F}.Release_LTCG|Win32.Build.0 = Release_LTCG|Win32 + {AAE88FEF-509E-4D49-870B-7357922C276F}.Production|Win32.ActiveCfg = Production|Win32 + {AAE88FEF-509E-4D49-870B-7357922C276F}.Production|Win32.Build.0 = Production|Win32 {AAE88FEF-509E-4D49-870B-7357922C276F}.Release|Win32.ActiveCfg = Release|Win32 {AAE88FEF-509E-4D49-870B-7357922C276F}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection diff --git a/Source/WebKit2/win/WebKit2.vcproj b/Source/WebKit2/win/WebKit2.vcproj index ecd064d..5e4ffa8 100755 --- a/Source/WebKit2/win/WebKit2.vcproj +++ b/Source/WebKit2/win/WebKit2.vcproj @@ -18,7 +18,7 @@ <Configuration Name="Debug|Win32" ConfigurationType="2" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;.\WebKit2Common.vsprops;.\WebKit2DirectX.vsprops;.\WebKit2Apple.vsprops" + InheritedPropertySheets=".\WebKit2Debug.vsprops" CharacterSet="1" > <Tool @@ -79,7 +79,7 @@ <Configuration Name="Release|Win32" ConfigurationType="2" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops;.\WebKit2Common.vsprops;.\WebKit2DirectX.vsprops;.\WebKit2Apple.vsprops" + InheritedPropertySheets=".\WebKit2Release.vsprops" CharacterSet="1" > <Tool @@ -140,7 +140,7 @@ <Configuration Name="Debug_Cairo_CFLite|Win32" ConfigurationType="2" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_wincairo.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\cURL.vsprops;.\WebKit2Common.vsprops;.\WebKit2CFLite.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops" + InheritedPropertySheets=".\WebKit2DebugCairoCFLite.vsprops" CharacterSet="1" > <Tool @@ -202,7 +202,7 @@ <Configuration Name="Release_Cairo_CFLite|Win32" ConfigurationType="2" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\cURL.vsprops;.\WebKit2Common.vsprops;.\WebKit2CFLite.vsprops" + InheritedPropertySheets=".\WebKit2ReleaseCairoCFLite.vsprops" CharacterSet="1" > <Tool @@ -263,7 +263,7 @@ <Configuration Name="Debug_All|Win32" ConfigurationType="2" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_all.vsprops;.\WebKit2Common.vsprops;.\WebKit2DirectX.vsprops;.\WebKit2Apple.vsprops" + InheritedPropertySheets=".\WebKit2DebugAll.vsprops" CharacterSet="1" > <Tool @@ -322,9 +322,9 @@ /> </Configuration> <Configuration - Name="Release_LTCG|Win32" + Name="Production|Win32" ConfigurationType="2" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops;.\WebKit2Common.vsprops;.\WebKit2DirectX.vsprops;.\WebKit2Apple.vsprops" + InheritedPropertySheets=".\WebKit2Production.vsprops" CharacterSet="1" WholeProgramOptimization="1" > @@ -507,6 +507,10 @@ > </File> <File + RelativePath="..\Shared\ResourceCachesToClear.h" + > + </File> + <File RelativePath="..\Shared\SameDocumentNavigationType.h" > </File> @@ -786,6 +790,10 @@ > </File> <File + RelativePath="..\Shared\API\c\win\WKBaseWin.h" + > + </File> + <File RelativePath="..\Shared\API\c\WKCertificateInfo.cpp" > </File> @@ -973,6 +981,30 @@ Name="cf" > <File + RelativePath="..\Shared\API\c\cf\WKErrorCF.cpp" + > + <FileConfiguration + Name="Debug_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\Shared\API\c\cf\WKErrorCF.h" + > + </File> + <File RelativePath="..\Shared\API\c\cf\WKStringCF.cpp" > </File> @@ -1140,6 +1172,22 @@ <File RelativePath="..\Shared\win\LayerTreeContextWin.cpp" > + <FileConfiguration + Name="Debug_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> </File> <File RelativePath="..\Shared\win\NativeWebKeyboardEventWin.cpp" @@ -1297,7 +1345,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release_LTCG|Win32" + Name="Production|Win32" ExcludedFromBuild="true" > <Tool @@ -1411,6 +1459,22 @@ </File> </Filter> <Filter + Name="IconDatabase" + > + <File + RelativePath="..\WebProcess\IconDatabase\WebIconDatabaseProxy.cpp" + > + </File> + <File + RelativePath="..\WebProcess\IconDatabase\WebIconDatabaseProxy.h" + > + </File> + <File + RelativePath="..\WebProcess\IconDatabase\WebIconDatabaseProxy.messages.in" + > + </File> + </Filter> + <Filter Name="KeyValueStorage" > <File @@ -1427,6 +1491,22 @@ </File> </Filter> <Filter + Name="MediaCache" + > + <File + RelativePath="..\WebProcess\MediaCache\WebMediaCacheManager.cpp" + > + </File> + <File + RelativePath="..\WebProcess\MediaCache\WebMediaCacheManager.h" + > + </File> + <File + RelativePath="..\WebProcess\MediaCache\WebMediaCacheManager.messages.in" + > + </File> + </Filter> + <Filter Name="ResourceCache" > <File @@ -1465,6 +1545,70 @@ RelativePath="..\WebProcess\Cookies\WebCookieManager.messages.in" > </File> + <Filter + Name="cf" + > + <File + RelativePath="..\WebProcess\Cookies\cf\WebCookieManagerCFNet.cpp" + > + <FileConfiguration + Name="Debug_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="curl" + > + <File + RelativePath="..\WebProcess\Cookies\curl\WebCookieManagerCurl.cpp" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug_All|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Production|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + </Filter> </Filter> <Filter Name="WebCoreSupport" @@ -1769,6 +1913,58 @@ > </File> </Filter> + <Filter + Name="ca" + > + <File + RelativePath="..\WebProcess\WebPage\ca\LayerTreeHostCA.cpp" + > + <FileConfiguration + Name="Debug_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\WebProcess\WebPage\ca\LayerTreeHostCA.h" + > + </File> + <Filter + Name="win" + > + <File + RelativePath="..\WebProcess\WebPage\ca\win\LayerTreeHostCAWin.cpp" + > + <FileConfiguration + Name="Debug_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + </Filter> + </Filter> </Filter> <Filter Name="win" @@ -1805,7 +2001,15 @@ Name="cf" > <File - RelativePath="..\WebProcess\Downloads\cf\DownloadCFNet.cpp" + RelativePath="..\WebProcess\Downloads\cf\win\DownloadCFWin.cpp" + > + </File> + </Filter> + <Filter + Name="cfnet" + > + <File + RelativePath="..\WebProcess\Downloads\cfnet\DownloadCFNet.cpp" > <FileConfiguration Name="Debug_Cairo_CFLite|Win32" @@ -1824,14 +2028,6 @@ /> </FileConfiguration> </File> - <Filter - Name="win" - > - <File - RelativePath="..\WebProcess\Downloads\cf\win\DownloadCFNetWin.cpp" - > - </File> - </Filter> </Filter> <Filter Name="curl" @@ -1864,7 +2060,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release_LTCG|Win32" + Name="Production|Win32" ExcludedFromBuild="true" > <Tool @@ -2127,6 +2323,18 @@ RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleScriptWorld.h" > </File> + <Filter + Name="win" + > + <File + RelativePath="..\WebProcess\InjectedBundle\API\c\win\WKBundlePrivateWin.cpp" + > + </File> + <File + RelativePath="..\WebProcess\InjectedBundle\API\c\win\WKBundlePrivateWin.h" + > + </File> + </Filter> </Filter> </Filter> <Filter @@ -2511,6 +2719,14 @@ > </File> <File + RelativePath="..\UIProcess\WebFullScreenManagerProxy.cpp" + > + </File> + <File + RelativePath="..\UIProcess\WebFullScreenManagerProxy.h" + > + </File> + <File RelativePath="..\UIProcess\WebGeolocationManagerProxy.cpp" > </File> @@ -2539,6 +2755,18 @@ > </File> <File + RelativePath="..\UIProcess\WebIconDatabase.cpp" + > + </File> + <File + RelativePath="..\UIProcess\WebIconDatabase.h" + > + </File> + <File + RelativePath="..\UIProcess\WebIconDatabase.messages.in" + > + </File> + <File RelativePath="..\UIProcess\WebInspectorProxy.cpp" > </File> @@ -2567,6 +2795,18 @@ > </File> <File + RelativePath="..\UIProcess\WebMediaCacheManagerProxy.cpp" + > + </File> + <File + RelativePath="..\UIProcess\WebMediaCacheManagerProxy.h" + > + </File> + <File + RelativePath="..\UIProcess\WebMediaCacheManagerProxy.messages.in" + > + </File> + <File RelativePath="..\UIProcess\WebNavigationData.cpp" > </File> @@ -2825,6 +3065,14 @@ > </File> <File + RelativePath="..\UIProcess\API\C\WKIconDatabase.cpp" + > + </File> + <File + RelativePath="..\UIProcess\API\C\WKIconDatabase.h" + > + </File> + <File RelativePath="..\UIProcess\API\C\WKInspector.cpp" > </File> @@ -2841,6 +3089,14 @@ > </File> <File + RelativePath="..\UIProcess\API\C\WKMediaCacheManager.cpp" + > + </File> + <File + RelativePath="..\UIProcess\API\C\WKMediaCacheManager.h" + > + </File> + <File RelativePath="..\UIProcess\API\C\WKNativeEvent.h" > </File> @@ -2929,14 +3185,54 @@ > </File> <Filter - Name="win" + Name="cg" > <File - RelativePath="..\UIProcess\API\C\win\WKAPICastWin.h" + RelativePath="..\UIProcess\API\C\cg\WKIconDatabaseCG.cpp" > + <FileConfiguration + Name="Debug_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> </File> <File - RelativePath="..\UIProcess\API\C\win\WKBaseWin.h" + RelativePath="..\UIProcess\API\C\cg\WKIconDatabaseCG.h" + > + <FileConfiguration + Name="Debug_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="win" + > + <File + RelativePath="..\UIProcess\API\C\win\WKAPICastWin.h" > </File> <File @@ -3110,6 +3406,14 @@ > </File> <File + RelativePath="..\UIProcess\win\WebUndoClient.cpp" + > + </File> + <File + RelativePath="..\UIProcess\win\WebUndoClient.h" + > + </File> + <File RelativePath="..\UIProcess\win\WebView.cpp" > </File> @@ -3547,6 +3851,22 @@ > </File> <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebFullScreenManagerMessageReceiver.cpp" + > + </File> + <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebFullScreenManagerMessages.h" + > + </File> + <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebFullScreenManagerProxyMessageReceiver.cpp" + > + </File> + <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebFullScreenManagerProxyMessages.h" + > + </File> + <File RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebGeolocationManagerMessageReceiver.cpp" > </File> @@ -3563,6 +3883,22 @@ > </File> <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebIconDatabaseMessageReceiver.cpp" + > + </File> + <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebIconDatabaseMessages.h" + > + </File> + <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebIconDatabaseProxyMessageReceiver.cpp" + > + </File> + <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebIconDatabaseProxyMessages.h" + > + </File> + <File RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebInspectorMessageReceiver.cpp" > </File> @@ -3595,6 +3931,22 @@ > </File> <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebMediaCacheManagerMessageReceiver.cpp" + > + </File> + <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebMediaCacheManagerMessages.h" + > + </File> + <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebMediaCacheManagerProxyMessageReceiver.cpp" + > + </File> + <File + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebMediaCacheManagerProxyMessages.h" + > + </File> + <File RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebPageMessageReceiver.cpp" > </File> @@ -3728,7 +4080,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release_LTCG|Win32" + Name="Production|Win32" > <Tool Name="VCCLCompilerTool" diff --git a/Source/WebKit2/win/WebKit2Apple.vsprops b/Source/WebKit2/win/WebKit2Apple.vsprops index 4cec313..68d01ac 100644 --- a/Source/WebKit2/win/WebKit2Apple.vsprops +++ b/Source/WebKit2/win/WebKit2Apple.vsprops @@ -5,6 +5,10 @@ Name="WebKit2Apple" > <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories=""$(ProjectDir)..\WebProcess\WebPage\ca"" + /> + <Tool Name="VCLinkerTool" AdditionalDependencies="CFNetwork$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib QTMovieWin$(WebKitConfigSuffix).lib WebKitSystemInterface$(WebKitConfigSuffix).lib" ModuleDefinitionFile="WebKit2.def" diff --git a/Source/WebKit2/win/WebKit2Common.vsprops b/Source/WebKit2/win/WebKit2Common.vsprops index e093639..1af69ae 100755 --- a/Source/WebKit2/win/WebKit2Common.vsprops +++ b/Source/WebKit2/win/WebKit2Common.vsprops @@ -6,7 +6,7 @@ > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories=""$(ProjectDir)";"$(ProjectDir)\..";"$(ProjectDir)\..\Platform";"$(ProjectDir)\..\Platform\cg";"$(ProjectDir)\..\Platform\CoreIPC";"$(ProjectDir)\..\PluginProcess";"$(ProjectDir)\..\Shared";"$(ProjectDir)\..\Shared\win";"$(ProjectDir)\..\Shared\cf";"$(ProjectDir)\..\Shared\API\c";"$(ProjectDir)\..\Shared\API\c\cf";"$(ProjectDir)\..\Shared\API\c\win";"$(ProjectDir)\..\Shared\CoreIPCSupport";"$(ProjectDir)\..\Shared\Plugins";"$(ProjectDir)\..\Shared\Plugins\Netscape";"$(ProjectDir)\..\UIProcess";"$(ProjectDir)\..\UIProcess\API\C";"$(ProjectDir)\..\UIProcess\API\C\win";"$(ProjectDir)\..\UIProcess\API\cpp";"$(ProjectDir)\..\UIProcess\API\win";"$(ProjectDir)\..\UIProcess\Authentication";"$(ProjectDir)\..\UIProcess\Downloads";"$(ProjectDir)\..\UIProcess\Launcher";"$(ProjectDir)\..\UIProcess\Plugins";"$(ProjectDir)\..\UIProcess\win";"$(ProjectDir)\..\WebProcess";"$(ProjectDir)\..\WebProcess\WebCoreSupport";"$(ProjectDir)\..\WebProcess\WebCoreSupport\win";"$(ProjectDir)\..\WebProcess\WebPage";"$(ProjectDir)\..\WebProcess\WebPage\win";"$(ProjectDir)\..\WebProcess\InjectedBundle";"$(ProjectDir)\..\WebProcess\InjectedBundle\API\c";"$(ProjectDir)\..\WebProcess\InjectedBundle\DOM";"$(ProjectDir)\..\WebProcess\InjectedBundle\win";"$(ProjectDir)\..\WebProcess\Plugins";"$(ProjectDir)\..\WebProcess\Plugins\Netscape";"$(ProjectDir)\..\WebProcess\win";"$(ProjectDir)\..\WebProcess\ApplicationCache";"$(ProjectDir)\..\WebProcess\Authentication";"$(ProjectDir)\..\WebProcess\Cookies";"$(ProjectDir)\..\WebProcess\Downloads";"$(ProjectDir)\..\WebProcess\Downloads\cf";"$(ProjectDir)\..\WebProcess\Geolocation";"$(ProjectDir)\..\WebProcess\KeyValueStorage";"$(ProjectDir)\..\WebProcess\ResourceCache";"$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources";"$(ConfigurationBuildDir)\Include";"$(ConfigurationBuildDir)\Include\private";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\Include\private";"$(WebKitLibrariesDir)\Include\pthreads";"$(ConfigurationBuildDir)\Include\JavaScriptCore";"$(ConfigurationBuildDir)\Include\private\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\private\JavaScriptCore";"$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders"" + AdditionalIncludeDirectories=""$(ProjectDir)";"$(ProjectDir)\..";"$(ProjectDir)\..\Platform";"$(ProjectDir)\..\Platform\cg";"$(ProjectDir)\..\Platform\CoreIPC";"$(ProjectDir)\..\PluginProcess";"$(ProjectDir)\..\Shared";"$(ProjectDir)\..\Shared\win";"$(ProjectDir)\..\Shared\cf";"$(ProjectDir)\..\Shared\API\c";"$(ProjectDir)\..\Shared\API\c\cf";"$(ProjectDir)\..\Shared\API\c\win";"$(ProjectDir)\..\Shared\CoreIPCSupport";"$(ProjectDir)\..\Shared\Plugins";"$(ProjectDir)\..\Shared\Plugins\Netscape";"$(ProjectDir)\..\UIProcess";"$(ProjectDir)\..\UIProcess\API\C";"$(ProjectDir)\..\UIProcess\API\C\win";"$(ProjectDir)\..\UIProcess\API\cpp";"$(ProjectDir)\..\UIProcess\API\win";"$(ProjectDir)\..\UIProcess\Authentication";"$(ProjectDir)\..\UIProcess\Downloads";"$(ProjectDir)\..\UIProcess\Launcher";"$(ProjectDir)\..\UIProcess\Plugins";"$(ProjectDir)\..\UIProcess\win";"$(ProjectDir)\..\WebProcess";"$(ProjectDir)\..\WebProcess\WebCoreSupport";"$(ProjectDir)\..\WebProcess\WebCoreSupport\win";"$(ProjectDir)\..\WebProcess\WebPage";"$(ProjectDir)\..\WebProcess\WebPage\win";"$(ProjectDir)\..\WebProcess\IconDatabase";"$(ProjectDir)\..\WebProcess\InjectedBundle";"$(ProjectDir)\..\WebProcess\InjectedBundle\API\c";"$(ProjectDir)\..\WebProcess\InjectedBundle\DOM";"$(ProjectDir)\..\WebProcess\InjectedBundle\win";"$(ProjectDir)\..\WebProcess\Plugins";"$(ProjectDir)\..\WebProcess\Plugins\Netscape";"$(ProjectDir)\..\WebProcess\win";"$(ProjectDir)\..\WebProcess\ApplicationCache";"$(ProjectDir)\..\WebProcess\Authentication";"$(ProjectDir)\..\WebProcess\Cookies";"$(ProjectDir)\..\WebProcess\Cookies\cf";"$(ProjectDir)\..\WebProcess\Downloads";"$(ProjectDir)\..\WebProcess\Downloads\cf";"$(ProjectDir)\..\WebProcess\FullScreen";"$(ProjectDir)\..\WebProcess\Geolocation";"$(ProjectDir)\..\WebProcess\KeyValueStorage";"$(ProjectDir)\..\WebProcess\MediaCache";"$(ProjectDir)\..\WebProcess\ResourceCache";"$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources";"$(ConfigurationBuildDir)\Include";"$(ConfigurationBuildDir)\Include\private";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\Include\private";"$(WebKitLibrariesDir)\Include\pthreads";"$(ConfigurationBuildDir)\Include\JavaScriptCore";"$(ConfigurationBuildDir)\Include\private\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\private\JavaScriptCore";"$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders"" PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT" UsePrecompiledHeader="2" PrecompiledHeaderThrough="WebKit2Prefix.h" diff --git a/Source/WebKit2/win/WebKit2Debug.vsprops b/Source/WebKit2/win/WebKit2Debug.vsprops new file mode 100644 index 0000000..b9b30a4 --- /dev/null +++ b/Source/WebKit2/win/WebKit2Debug.vsprops @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2Debug" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops; + .\WebKit2Common.vsprops; + .\WebKit2DirectX.vsprops; + .\WebKit2Apple.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Source/WebKit2/win/WebKit2DebugAll.vsprops b/Source/WebKit2/win/WebKit2DebugAll.vsprops new file mode 100644 index 0000000..2397b8e --- /dev/null +++ b/Source/WebKit2/win/WebKit2DebugAll.vsprops @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2DebugAll" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_all.vsprops; + .\WebKit2Common.vsprops; + .\WebKit2DirectX.vsprops; + .\WebKit2Apple.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Source/WebKit2/win/WebKit2DebugCairoCFLite.vsprops b/Source/WebKit2/win/WebKit2DebugCairoCFLite.vsprops new file mode 100644 index 0000000..967cf1c --- /dev/null +++ b/Source/WebKit2/win/WebKit2DebugCairoCFLite.vsprops @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2DebugCairoCFLite" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_wincairo.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\cURL.vsprops; + .\WebKit2Common.vsprops; + .\WebKit2CFLite.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Source/WebKit2/win/WebKit2Generated.make b/Source/WebKit2/win/WebKit2Generated.make index b5c2134..79c5f14 100644 --- a/Source/WebKit2/win/WebKit2Generated.make +++ b/Source/WebKit2/win/WebKit2Generated.make @@ -1,6 +1,7 @@ all: touch "%ConfigurationBuildDir%\buildfailed" -mkdir 2>NUL "%ConfigurationBuildDir%\include\WebKit2" + xcopy /y /d "..\Shared\API\c\cf\WKErrorCF.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\Shared\API\c\cf\WKStringCF.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\Shared\API\c\cf\WKURLCF.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\Shared\API\c\cf\WKURLRequestCF.h" "%ConfigurationBuildDir%\include\WebKit2" @@ -57,6 +58,7 @@ all: xcopy /y /d "..\UIProcess\API\C\WKGeolocationPosition.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\UIProcess\API\C\WKInspector.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\UIProcess\API\C\WKKeyValueStorageManager.h" "%ConfigurationBuildDir%\include\WebKit2" + xcopy /y /d "..\UIProcess\API\C\WKMediaCacheManager.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\UIProcess\API\C\WKNativeEvent.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\UIProcess\API\C\WKNavigationData.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\UIProcess\API\C\WKOpenPanelParameters.h" "%ConfigurationBuildDir%\include\WebKit2" @@ -74,6 +76,7 @@ all: xcopy /y /d "..\UIProcess\API\C\win\WKView.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\UIProcess\API\C\win\WKViewPrivate.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\UIProcess\API\cpp\WKRetainPtr.h" "%ConfigurationBuildDir%\include\WebKit2" + xcopy /y /d "..\WebProcess\InjectedBundle\API\c\win\WKBundlePrivateWin.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundle.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundleBackForwardList.h" "%ConfigurationBuildDir%\include\WebKit2" xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundleBackForwardListItem.h" "%ConfigurationBuildDir%\include\WebKit2" diff --git a/Source/WebKit2/win/WebKit2Generated.vcproj b/Source/WebKit2/win/WebKit2Generated.vcproj index 901e87d..75ea918 100755 --- a/Source/WebKit2/win/WebKit2Generated.vcproj +++ b/Source/WebKit2/win/WebKit2Generated.vcproj @@ -43,7 +43,7 @@ /> </Configuration> <Configuration - Name="Release_LTCG|Win32" + Name="Production|Win32" ConfigurationType="0" InheritedPropertySheets=".\WebKit2GeneratedCommon.vsprops" > diff --git a/Source/WebKit2/win/WebKit2Production.vsprops b/Source/WebKit2/win/WebKit2Production.vsprops new file mode 100644 index 0000000..5bdec6f --- /dev/null +++ b/Source/WebKit2/win/WebKit2Production.vsprops @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2Production" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\production.vsprops; + .\WebKit2Common.vsprops; + .\WebKit2DirectX.vsprops; + .\WebKit2Apple.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Source/WebKit2/win/WebKit2Release.vsprops b/Source/WebKit2/win/WebKit2Release.vsprops new file mode 100644 index 0000000..7ae6676 --- /dev/null +++ b/Source/WebKit2/win/WebKit2Release.vsprops @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2Release" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; + .\WebKit2Common.vsprops; + .\WebKit2DirectX.vsprops; + .\WebKit2Apple.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Source/WebKit2/win/WebKit2ReleaseCairoCFLite.vsprops b/Source/WebKit2/win/WebKit2ReleaseCairoCFLite.vsprops new file mode 100644 index 0000000..685f929 --- /dev/null +++ b/Source/WebKit2/win/WebKit2ReleaseCairoCFLite.vsprops @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2ReleaseCairoCFLite" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\cURL.vsprops; + .\WebKit2Common.vsprops; + .\WebKit2CFLite.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Source/WebKit2/win/WebKit2WebProcess.vcproj b/Source/WebKit2/win/WebKit2WebProcess.vcproj index ab34908..16a0238 100755 --- a/Source/WebKit2/win/WebKit2WebProcess.vcproj +++ b/Source/WebKit2/win/WebKit2WebProcess.vcproj @@ -17,7 +17,7 @@ <Configuration Name="Debug|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;.\WebKit2WebProcessCommon.vsprops" + InheritedPropertySheets=".\WebKit2WebProcessDebug.vsprops" CharacterSet="1" > <Tool @@ -78,7 +78,7 @@ <Configuration Name="Release|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops;.\WebKit2WebProcessCommon.vsprops" + InheritedPropertySheets=".\WebKit2WebProcessRelease.vsprops" CharacterSet="1" > <Tool @@ -139,7 +139,7 @@ <Configuration Name="Debug_All|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_all.vsprops;.\WebKit2WebProcessCommon.vsprops" + InheritedPropertySheets=".\WebKit2WebProcessDebugAll.vsprops" CharacterSet="1" > <Tool @@ -200,7 +200,7 @@ <Configuration Name="Debug_Cairo_CFLite|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_wincairo.vsprops;.\WebKit2WebProcessCommon.vsprops" + InheritedPropertySheets=".\WebKit2WebProcessDebugCairoCFLite.vsprops" CharacterSet="1" > <Tool @@ -259,9 +259,9 @@ /> </Configuration> <Configuration - Name="Release_LTCG|Win32" + Name="Production|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops;.\WebKit2WebProcessCommon.vsprops" + InheritedPropertySheets=".\WebKit2WebProcessProduction.vsprops" CharacterSet="1" WholeProgramOptimization="1" > @@ -323,7 +323,7 @@ <Configuration Name="Release_Cairo_CFLite|Win32" ConfigurationType="1" - InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops;$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops;.\WebKit2WebProcessCommon.vsprops" + InheritedPropertySheets=".\WebKit2WebProcessReleaseCairoCFLite.vsprops" CharacterSet="1" > <Tool diff --git a/Source/WebKit2/win/WebKit2WebProcessDebug.vsprops b/Source/WebKit2/win/WebKit2WebProcessDebug.vsprops new file mode 100644 index 0000000..0beec34 --- /dev/null +++ b/Source/WebKit2/win/WebKit2WebProcessDebug.vsprops @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2WebProcessDebug" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops; + .\WebKit2WebProcessCommon.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Source/WebKit2/win/WebKit2WebProcessDebugAll.vsprops b/Source/WebKit2/win/WebKit2WebProcessDebugAll.vsprops new file mode 100644 index 0000000..54886b8 --- /dev/null +++ b/Source/WebKit2/win/WebKit2WebProcessDebugAll.vsprops @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2WebProcessDebugAll" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_all.vsprops; + .\WebKit2WebProcessCommon.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Source/WebKit2/win/WebKit2WebProcessDebugCairoCFLite.vsprops b/Source/WebKit2/win/WebKit2WebProcessDebugCairoCFLite.vsprops new file mode 100644 index 0000000..c05f6c1 --- /dev/null +++ b/Source/WebKit2/win/WebKit2WebProcessDebugCairoCFLite.vsprops @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2WebProcessDebugCairoCFLite" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\debug_wincairo.vsprops; + .\WebKit2WebProcessCommon.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Source/WebKit2/win/WebKit2WebProcessProduction.vsprops b/Source/WebKit2/win/WebKit2WebProcessProduction.vsprops new file mode 100644 index 0000000..08c8ae2 --- /dev/null +++ b/Source/WebKit2/win/WebKit2WebProcessProduction.vsprops @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2WebProcessProduction" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\production.vsprops; + .\WebKit2WebProcessCommon.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Source/WebKit2/win/WebKit2WebProcessRelease.vsprops b/Source/WebKit2/win/WebKit2WebProcessRelease.vsprops new file mode 100644 index 0000000..a32a112 --- /dev/null +++ b/Source/WebKit2/win/WebKit2WebProcessRelease.vsprops @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2WebProcessRelease" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; + .\WebKit2WebProcessCommon.vsprops" + > +</VisualStudioPropertySheet> diff --git a/Source/WebKit2/win/WebKit2WebProcessReleaseCairoCFLite.vsprops b/Source/WebKit2/win/WebKit2WebProcessReleaseCairoCFLite.vsprops new file mode 100644 index 0000000..d278242 --- /dev/null +++ b/Source/WebKit2/win/WebKit2WebProcessReleaseCairoCFLite.vsprops @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="WebKit2WebProcessReleaseCairoCFLite" + InheritedPropertySheets=" + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops; + .\WebKit2WebProcessCommon.vsprops" + > +</VisualStudioPropertySheet> |