2011-05-24 Lucas Forschler Rollout r87221. 2011-05-24 Lucas Forschler Merged r87179. 2011-05-24 Adam Roben Invalidate JSNPObjects when they are finalized This will cause the underlying NPObject to be released at finalization time, rather than at destruction time (which is unpredictable and could occur after the plugin has been unloaded). Test: plugins/npobject-js-wrapper-destroyed-after-plugin-unload.html Fixes Crash in deallocateNPObject when reloading yahoo.com webarchive in WebKit2 Reviewed by Oliver Hunt. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::~JSNPObject): Assert that we've already been invalidated, rather than trying to perform invalidation now (when the plugin might already be unloaded). * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::getOrCreateJSObject): (WebKit::NPRuntimeObjectMap::invalidate): Updated for m_jsNPObjects type change. (WebKit::NPRuntimeObjectMap::finalize): Added. Invalidates the JSNPObject and removes it from the map. * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: Now inherits from WeakHandleOwner. Changed m_jsNPObjects from a WeakGCMap to a HashMap of JSC::Weak objects so that we will be notified when the JSNPObjects are finalized. 2011-05-24 Lucas Forschler Merged r87170. 2011-05-24 Sam Weinig Reviewed by John Sullivan. WebKit tells client that the page has become unresponsive while the beforeUnloadConfirm dialog is up https://bugs.webkit.org/show_bug.cgi?id=61372 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Stop the unresponsiveness timer like we do for other client functions that spin a runloop. 2011-05-24 Lucas Forschler Merged r87221. 2011-05-24 Brady Eidson Reviewed by Darin Adler. Part of and https://bugs.webkit.org/show_bug.cgi?id=61334 Should shim a few SecKeychainItem* methods on SnowLeopard Initialize the KeychainItem shim on SnowLeopard: * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::initializeShim): On SnowLeopard, shim the 4 SecKeychainItem methods: * WebProcess/mac/WebProcessShim.h: * WebProcess/mac/WebProcessShim.mm: (WebKit::shimSecKeychainItemCopyContent): (WebKit::shimSecKeychainItemCreateFromContent): (WebKit::shimSecKeychainItemModifyContent): (WebKit::shimSecKeychainItemFreeContent): (WebKit::WebKitWebProcessKeychainItemShimInitialize): * WebProcess/mac/KeychainItemShimMethods.h: Added. * WebProcess/mac/KeychainItemShimMethods.mm: Added. Manage a set of shim-controlled AttributeList data: (WebKit::shimManagedAttributeLists): (WebKit::freeAttributeListContents): (WebKit::allocateAttributeListContents): Manage a set of shim-controlled KeychainItem data: (WebKit::shimManagedKeychainItemContents): (WebKit::allocateKeychainItemContentData): Free any shim-controlled AttributeList or KeychainItem data: (WebKit::webFreeAttributeListContentOnMainThread): (WebKit::webFreeAttributeListContent): (WebKit::webFreeKeychainItemContentOnMainThread): (WebKit::webFreeKeychainItemContent): Marshall these 3 KeychainItem methods to the UIProcess: (WebKit::webSecKeychainItemCopyContentOnMainThread): (WebKit::webSecKeychainItemCopyContent): (WebKit::webSecKeychainItemCreateFromContentOnMainThread): (WebKit::webSecKeychainItemCreateFromContent): (WebKit::webSecKeychainItemModifyContentOnMainThread): (WebKit::webSecKeychainItemModifyContent): (WebKit::initializeKeychainItemShim): Container for an AttributeList entry that knows how to encode/decode: * Shared/mac/KeychainAttribute.cpp: Added. (WebKit::KeychainAttribute::KeychainAttribute): (CoreIPC::encode): (CoreIPC::decode): * Shared/mac/KeychainAttribute.h: Added. Container for the relevant arguments to the shimmed methods, to send to the UIProcess: * Shared/mac/SecKeychainItemRequestData.cpp: Added. (WebKit::SecKeychainItemRequestData::SecKeychainItemRequestData): (WebKit::SecKeychainItemRequestData::initializeWithAttributeList): (WebKit::SecKeychainItemRequestData::~SecKeychainItemRequestData): (WebKit::SecKeychainItemRequestData::attributeList): (WebKit::SecKeychainItemRequestData::encode): (WebKit::SecKeychainItemRequestData::decode): * Shared/mac/SecKeychainItemRequestData.h: Added. (WebKit::SecKeychainItemRequestData::keychainItem): (WebKit::SecKeychainItemRequestData::itemClass): (WebKit::SecKeychainItemRequestData::length): (WebKit::SecKeychainItemRequestData::data): Container for the possible output from the shimmed methods, to send back to the WebProcess: * Shared/mac/SecKeychainItemResponseData.cpp: Added. (WebKit::SecKeychainItemResponseData::SecKeychainItemResponseData): (WebKit::SecKeychainItemResponseData::encode): (WebKit::SecKeychainItemResponseData::decode): * Shared/mac/SecKeychainItemResponseData.h: Added. (WebKit::SecKeychainItemResponseData::itemClass): (WebKit::SecKeychainItemResponseData::data): (WebKit::SecKeychainItemResponseData::resultCode): (WebKit::SecKeychainItemResponseData::attributes): (WebKit::SecKeychainItemResponseData::keychainItem): Actually implement the calls to the SecKeychainItem* methods in the UIProcess: * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::secKeychainItemCopyContent): (WebKit::WebProcessProxy::secKeychainItemCreateFromContent): (WebKit::WebProcessProxy::secKeychainItemModifyContent): * WebKit2.xcodeproj/project.pbxproj: Project file stuff * Configurations/Shim.xcconfig: 2011-05-24 Lucas Forschler Merged r87154. 2011-05-24 Brady Eidson Build fix after r87153 * WebProcess/mac/SecItemShimMethods.mm: Don't compile this code on SnowLeopard. 2011-05-24 Lucas Forschler Merged r87153. 2011-05-23 Brady Eidson Reviewed by Sam Weinig. Part of and https://bugs.webkit.org/show_bug.cgi?id=61334 Should shim a few SecKeychainItem* methods on SnowLeopard In preparation for different WebProcess shims depending on platform, move the current shim to its own files. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::initializeShim): For non-SnowLeopard platforms, call initializeSecItemShim(). * WebProcess/mac/SecItemShimMethods.h: Added. * WebProcess/mac/SecItemShimMethods.mm: Added. Actual webSecItem* methods moved from WebProcessMac.mm. (WebKit::webSecItemCopyMatchingMainThread): (WebKit::webSecItemCopyMatching): (WebKit::webSecItemAddOnMainThread): (WebKit::webSecItemAdd): (WebKit::webSecItemUpdateOnMainThread): (WebKit::webSecItemUpdate): (WebKit::webSecItemDeleteOnMainThread): (WebKit::webSecItemDelete): (WebKit::initializeSecItemShim): Initialize the callbacks via WebKitWebProcessSecItemShimInitialize * WebProcess/mac/WebProcessShim.h: * WebProcess/mac/WebProcessShim.mm: Wrap all the actual code here in a !BUILDING_ON_SNOW_LEOPARD block (WebKit::shimSecItemCopyMatching): (WebKit::shimSecItemAdd): (WebKit::shimSecItemUpdate): (WebKit::shimSecItemDelete): (WebKit::WebKitWebProcessSecItemShimInitialize): 2011-05-24 Lucas Forschler Merged r87119. 2011-05-23 Anders Carlsson Reviewed by Sam Weinig. Cap painting to 30fps on Windows https://bugs.webkit.org/show_bug.cgi?id=61337 * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::displayTimerFired): 2011-05-24 Lucas Forschler Merged r87102. 2011-05-20 Jer Noble Reviewed by Darin Adler. Video looks squished when animating to full screen. https://bugs.webkit.org/show_bug.cgi?id=61220 Instead of scaling between the client sizes of the full-screen element before and after entering full-screen, scale between their content boxes. The difference is that the client sizes can have different aspect ratios, and thus the animation can end up "squishing" the content at one end of the animation. When animating between the two content box sizes, their aspect ratios (for the case of video) are equal, so the animation will appear to scale smoothly between the two states without "squishing" the content. * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): Set the destination frame to be the content box of the current full screen element. (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto. 2011-05-24 Lucas Forschler Merged r87113. 2011-05-23 Jeremy Noble Reviewed by Darin Adler. REGRESSION (r86990:86992): World leak when all windows closed https://bugs.webkit.org/show_bug.cgi?id=61311 Three interlocking problems: 1) Calling [WKView fullScreenController] will create the controller if it doesn't all ready exist, so move the closing code into WKView, where we can bail early if there isn't a controller. 2) A retain-cycle exists between WKView and WKFullScreenWindowController. Make sure to break the cycle explicitly by clearing the _fullScreenWindowController ivar when closing the controller. 3) [NSWindowController close] was overridden without calling [super close]. Do that. * UIProcess/API/mac/WKView.mm: (-[WKView closeFullScreenWindowController]): Moved here from WebFullScreenManagerProxyMac.mm. * UIProcess/API/mac/WKViewInternal.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController close]): Call [super close]. * UIProcess/mac/WebFullScreenManagerProxyMac.mm: (WebKit::WebFullScreenManagerProxy::invalidate): 2011-05-24 Lucas Forschler Merged r87093. 2011-05-23 Sam Weinig Reviewed by Darin Adler. Terminating a WebProcess should work even while a page is being closed https://bugs.webkit.org/show_bug.cgi?id=61299 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::terminateProcess): Change validity check to only check for process validity, since terminating the process of a page that is closed or is closing is acceptable behavior. 2011-05-24 Lucas Forschler Merged r87077. 2011-05-23 Jessie Berlin Reviewed by Darin Adler. [Windows] Initial Cookie Accept Policy not set on Deserialized Storage Session. https://bugs.webkit.org/show_bug.cgi?id=61255 * WebProcess/win/WebProcessWin.cpp: (WebKit::WebProcess::platformInitializeWebProcess): Move the code to set the cookie policy before the early return that is taken when using the default storage session from the UI Process. Also, remove unnecessary #ifdefs (USE(CFURLSTORAGESESSIONS) is true if USE(CFNETWORK) is true) and add a comment explaining the early return. 2011-05-24 Lucas Forschler Merged r87046. 2011-05-21 John Sullivan Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=61244 Undo operations for a web page linger after page is destroyed * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::closePage): Clear editing commands before telling UI client to close the page (this must be done while the page is still in a window so its undo manager can be accessed, so waiting for WebPageProxy::close() is too late). 2011-05-24 Lucas Forschler Merged r87005. 2011-05-20 Jeremy Noble Reviewed by Mark Rowe. Crash in WebFullScreenManager::didExitFullScreen when closing a window in Safari. https://bugs.webkit.org/show_bug.cgi?id=61228 Do not attempt to exit full screen if we aren't in full screen to begin with, as the WebProcess won't be expecting will/didExitFullScreen notifications. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController close]): 2011-05-24 Steve Falkenburg Reviewed by Adam Roben. Disable features on safari-534-branch. * Configurations/FeatureDefines.xcconfig: 2011-05-24 Lucas Forschler Merged r86995. 2011-05-20 Andy Estes Reviewed by Darin Adler. WebView loses firstResponder status when entering full-screen mode. https://bugs.webkit.org/show_bug.cgi?id=61153 * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): If the WebView was a descendant of the browser window's first responder when entering full-screen mode, set the full-screen window's first responder to that same NSResponder. (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Do the reverse of what is done in finishedEnterFullScreenAnimation:. 2011-05-24 Lucas Forschler Merged r86992. 2011-05-20 Jeremy Noble Reviewed by Maciej Stachowiak. WebKit2: Exit full screen mode if the WebProcess crashes. https://bugs.webkit.org/show_bug.cgi?id=61151 If the WebProcess crashes, exit full-screen mode to avoid getting stuck. Move the WebFullScreenManagerProxy::invalidate() implementation into the platform-specific files, and have them close their respective platform's full-screen window. * UIProcess/WebFullScreenManagerProxy.cpp: * UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp: (WebKit::WebFullScreenManagerProxy::invalidate): Added. Copied from main implementation. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController close]): Added. * UIProcess/mac/WebFullScreenManagerProxyMac.mm: (WebKit::WebFullScreenManagerProxy::invalidate): Added. * UIProcess/win/WebFullScreenManagerProxyWin.cpp: (WebKit::WebFullScreenManagerProxy::invalidate): Added. 2011-05-24 Lucas Forschler Merged r87022. 2011-05-21 Jeremy Noble Reviewed by Eric Carlson. WebKit2: fix failing fullscreen/full-screen-remove* tests. https://bugs.webkit.org/show_bug.cgi?id=61027 * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp: (WebKit::InjectedBundlePageFullScreenClient::exitFullScreenForElement): Call the exit functions (was calling the enter functions). 2011-05-23 Lucas Forschler Merge r86985. 2011-05-20 Matthew Delaney Reviewed by Steve Falkenburg. Default min DOM Timer interval is not set soon enough for first page to pick it up in WK2 https://bugs.webkit.org/show_bug.cgi?id=61215 * WebProcess/WebPage/WebPage.cpp: Simply moving the DOM min timer interval setting to before the first page creation. 2011-05-22 John Sullivan Rolled out , which I accidentally checked into the branch instead of trunk. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::closePage): 2011-05-22 Lucas Forschler Merge r86967. 2011-05-20 Sam Weinig Reviewed by Anders Carlsson. WebKit2: Media files cannot be saved in the Application Cache due to a sandbox violation https://bugs.webkit.org/show_bug.cgi?id=61199 Instead of using a sandbox extension to give permission to the application cache directory, initialize the sandbox with access to it like we do for other databases. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureWebProcess): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/com.apple.WebProcess.sb: * WebProcess/mac/WebProcessMac.mm: (WebKit::initializeSandbox): 2011-05-22 Lucas Forschler Merge r86956. 2011-05-20 Jer Noble Reviewed by Maciej Stachowiak. Win: non-full-screen content is briefly seen when entering full-screen mode (and vice versa) https://bugs.webkit.org/show_bug.cgi?id=61108 When the fullScreenController asks us to repaint, make an async repaint request, and when the callback is fired, notify the fullScreenController that repaint has completed. * UIProcess/win/WebView.cpp: (WebKit::fullScreenClientForceRepaintCompleted): Added. (WebKit::WebView::fullScreenClientForceRepaint): Added. * UIProcess/win/WebView.h: 2011-05-22 Lucas Forschler Merge r86924. 2011-05-19 Jer Noble Reviewed by Maciej Stachowiak. WebKit2: Flashing when entering and exiting full screen mode https://bugs.webkit.org/show_bug.cgi?id=56957 In the WKFullscreenWindowController, when exiting accelerated compositing mode, force a repaint, and don't actually remove the animation layer until the repaint completes. Also, move back to parenting the WebView in a layer-backed view, and work around the SnowLeopard bug which causes a crash in those situations. We no longer need to do a bunch of work in finishedEnterFullScreenAnimation, because the animation layer is "hiding" all the drawing happening in the webView underneath. In the WebFullScreenManagerMac, when asked to tear down the root layer, instead remove all its children, and set its contents to a flattened image of the full screen element and its children. This helps patch over the time where everything is re-rendering and helps give the appearance of continuousness in the animation. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): (-[WKFullScreenWindowController beganExitFullScreenAnimation]): (-[WKFullScreenWindowController enterAcceleratedCompositingMode:WebKit::]): (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): (-[WKFullScreenWindowController exitCompositedModeRepaintCompleted]): (exitCompositedModeRepaintCompleted): (-[WKFullScreenWindowController _page]): (-[WKFullScreenWindowController _manager]): (-[WKFullScreenWindow initWithContentRect:styleMask:backing:defer:]): * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): 2011-05-22 Lucas Forschler Merge r86895. 2011-05-19 Anders Carlsson Reviewed by Sam Weinig. Hang UI appears when WebProcess isn't running https://bugs.webkit.org/show_bug.cgi?id=61147 This fixes two bugs: 1. The HistoryClient related message handlers in WebContext could get invoked for pages that have been closed, and thus didn't have any subframes. Since we have a MESSAGE_CHECK that checks that the frame exists, we'd mark the currently dispatched message as invalid, which would end up calling Connection::Client::didReceiveInvalidMessage. Fix this by checking that the page exists first. 2. In the call to WebProcessProxy::didReceiveInvalidMessage we'd first invalidate the CoreIPC connection to make sure that we won't get any further messages from this connection. We'd then go ahead and terminate the web process, but because we've already invalidated the CoreIPC connection we would never get the Connection::Client::didClose callback that would call WebPageProxy::processDidCrash. Fix this by explicitly calling WebProcessProxy::didClose. Also, add logging when we receive an invalid message * UIProcess/WebContext.cpp: (WebKit::WebContext::didNavigateWithNavigationData): (WebKit::WebContext::didPerformClientRedirect): (WebKit::WebContext::didPerformServerRedirect): (WebKit::WebContext::didUpdateHistoryTitle): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didReceiveInvalidMessage): 2011-05-21 John Sullivan Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=61244 Undo operations for a web page linger after page is destroyed * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::closePage): Clear editing commands before telling UI client to close the page (this must be done while the page is still in a window so its undo manager can be accessed, so waiting for WebPageProxy::close() is too late). 2011-05-19 Lucas Forschler Reviewed by Anders Carlsson. Plug-ins at YouTube, cnn.com, nytimes vanish when their top/left is scrolled out of view when zoomed https://bugs.webkit.org/show_bug.cgi?id=61101 Scale both bounding boxes sent to m_plugin->geometryDidChange(), not just the frameRect. This fools the plugin into thinking it is drawing into an unscaled box with an unscaled view even when scaled. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::frame):Made this const so it can be used in clipRectInWindowCoordinates() (WebKit::PluginView::viewGeometryDidChange):Used IntRect::scale() rather than scaling by hand (WebKit::PluginView::clipRectInWindowCoordinates):Added scale of clipRect. * WebProcess/Plugins/PluginView.h: 2011-05-19 Lucas Forschler As originally reviewed by Anders Carlsson. and https://bugs.webkit.org/show_bug.cgi?id=61009 Processes spawned by SnowLeopard's WebProcess attempt to install WebKit2 shims. Restore r86797 to how it was supposed to be using the appropriate #ifdef, reverting the temporary r86814 in the process. The #ifdef is BUILDING_ON_SNOW_LEOPARD, not BUILDING_ON_SNOWLEOPARD! * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * WebProcess/mac/WebProcessMainMac.mm: (WebKit::WebProcessMain): 2011-05-19 Lucas Forschler Fix the WK2 SnowLeopard layouttests (again) until I can explore on a SnowLeopard machine tomorrow. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * WebProcess/mac/WebProcessMainMac.mm: (WebKit::WebProcessMain): 2011-05-19 Lucas Forschler Reviewed by Maciej Stachowiak. WK2: VoiceOver cannot move focus into a web area programmatically https://bugs.webkit.org/show_bug.cgi?id=60661 Add a makeFirstResponder method that will bring focus to the widget view within the UI process. * UIProcess/API/mac/PageClientImpl.h: * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::makeFirstResponder): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::makeFirstResponder): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::makeFirstResponder): * WebProcess/WebCoreSupport/WebChromeClient.h: 2011-05-19 Lucas Forschler Update the the context menu to reflect the system search provider on Mac. Reviewed by Sam Weinig. * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::searchWithGoogle): Add a FIXME about using NSPerformService on Mac. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): Added CopyDefaultSearchProviderDisplayName. 2011-05-19 Lucas Forschler Reviewed by Anders Carlsson. and https://bugs.webkit.org/show_bug.cgi?id=61009 Processes spawned by SnowLeopard's WebProcess attempt to install WebKit2 shims. If the WebProcess or PluginProcess forks, it shouldn't pass WebKit2 shims along to the new process in the DYLD_INSERT_LIBRARIES environment variable. Add Environment Utilities helper to strip unwanted values from an environment variable: * Platform/unix/EnvironmentUtilities.cpp: Added. (WebKit::EnvironmentUtilities::stripValuesEndingWithString): * Platform/unix/EnvironmentUtilities.h: Added. * WebKit2.xcodeproj/project.pbxproj: Strip PluginProcessShim.dylib from DYLD_INSERT_LIBRARIES: * PluginProcess/mac/PluginProcessMainMac.mm: (WebKit::PluginProcessMain): Strip WebProcessShim.dylib from DYLD_INSERT_LIBRARIES: * WebProcess/mac/WebProcessMainMac.mm: (WebKit::WebProcessMain): Unprotect SnowLeopard now that it will behave and not spawn processes trying to use WebKit2 shims: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): 2011-05-19 Lucas Forschler Reviewed by Simon Fraser. Crash in injected bundle client https://bugs.webkit.org/show_bug.cgi?id=61086 * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::shouldRubberBandInDirection): Check for existence of method in client prior to calling. 2011-05-19 Lucas Forschler Reviewed by Darin Adler. Exiting full screen will leave up invisible full-screen window, blocking all mouse clicks. https://bugs.webkit.org/show_bug.cgi?id=60982 The GraphicsLayer tree has unparented m_fullScreenRootLayer behind our backs, replacing the tiled layer with a normal one. Instead of holding on to a specific layer, assume that the w_rootLayer will only have 0 or 1 children, and if a child is present, then that is our full- screen layer. Additionally, check to see if the animating layer's presentationLayer is nil before calling it; asking a nil object for a CATransform3D will give back a struct full of garbage. In WKFullScreenWindowController, when the exit animation completes, ignore the "completed" parameter. This eliminates the possibility that the full screen window will end up left on top of the screen if the animation is cancelled and a enter full screen animation isn't forthcoming. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): 2011-05-19 Lucas Forschler Merge r86734. 2011-05-17 Dan Bernstein Reviewed by Alice Liu. REGRESSION (r86724): Repro crash loading any webpage in WebKit2 on SnowLeopard https://bugs.webkit.org/show_bug.cgi?id=61022 * WebProcess/mac/WebProcessMainMac.mm: (WebKit::WebProcessMain): As long as we are not loading the shim on Snow Leopard, we should not try to initialize it. 2011-05-17 Sheriff Bot Unreviewed, rolling out r86668. http://trac.webkit.org/changeset/86668 https://bugs.webkit.org/show_bug.cgi?id=61001 It made 52 tests crash on Qt WK2 bot (Requested by Ossy on #webkit). * UIProcess/API/qt/qgraphicswkview.cpp: * UIProcess/API/qt/qgraphicswkview.h: * UIProcess/API/qt/qwkpage.cpp: (QWKPagePrivate::createDrawingAreaProxy): 2011-05-17 Brian Weinstein Build fix after r86717. * UIProcess/API/C/win/WKView.h: Add a forward declaration of IDropTarget 2011-05-17 Brian Weinstein Reviewed by Adam Roben. WebKit2: Needs API to set a custom drop target https://bugs.webkit.org/show_bug.cgi?id=60991 Add API to set a custom drop target on a WKView. * UIProcess/API/C/win/WKView.cpp: (WKViewSetCustomDropTarget): Call through to WebView::setCustomDropTarget. * UIProcess/API/C/win/WKView.h: * UIProcess/win/WebView.cpp: (WebKit::WebView::setCustomDropTarget): Revoke the current drop target, and register the custom one. * UIProcess/win/WebView.h: 2011-05-17 Sam Weinig Reviewed by Dan Bernstein. Add API to determine if a frame has any form elements without going to javascript https://bugs.webkit.org/show_bug.cgi?id=60999 * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleFrameContainsAnyFormElements): * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::containsAnyFormElements): * WebProcess/WebPage/WebFrame.h: Add WKBundleFrameContainsAnyFormElements which does a walk of the document to determine if there are any form elements. 2011-05-17 Andreas Kling Reviewed by Kenneth Rohde Christiansen. [Qt][WK2] Initial support for favicons. https://bugs.webkit.org/show_bug.cgi?id=58937 Add the following API to QWKContext: - void setIconDatabasePath(QString) - void iconChangedForPageURL(QUrl) [signal] - QIcon iconForPageURL(QUrl) This is mostly analogous to the QWebSettings/QWebFrame icon API we had in WebKit1. * UIProcess/API/qt/ClientImpl.h: Added WKIconDatabaseClient methods. * UIProcess/API/qt/ClientImpl.cpp: (toQWKContext): Helper to cast from "void* clientInfo" to a QWKContext*. (qt_wk_didChangeIconForPageURL): Emits QWKContext::iconChangedForPageURL(QUrl). (qt_wk_didRemoveAllIcons): Stub. * UIProcess/API/qt/qwkcontext.h: * UIProcess/API/qt/qwkcontext_p.h: * UIProcess/API/qt/qwkcontext.cpp: (QWKContextPrivate::QWKContextPrivate): Set up and register a WKIconDatabaseClient. (QWKContext::QWKContext): Minor refactor to avoid code duplication in constructors. (QWKContext::setIconDatabasePath): Exactly what it sounds like. (QWKContext::iconForPageURL): Retrieves the favicon for a given page URL as a QIcon. * WebKit2API.pri: Add WKIconDatabase.cpp and WKIconDatabase.h to build. 2011-05-17 Brady Eidson Reviewed by Anders Carlsson. Part 4 of and https://bugs.webkit.org/show_bug.cgi?id=60595 Mac WebKit2 WebProcess needs a shim to make prompts appear to be from the UIProcess This patch actually hooks up the shim to the WebProcess shim callbacks, which messages these 4 calls up to the UIProcess and returns the result. Note that this patch uncovered the fact that CoreIPC can't sync message out from a secondary thread, so I filed https://bugs.webkit.org/show_bug.cgi?id=60975 as a followup to allow that. * Shared/mac/SecItemResponseData.cpp: (WebKit::SecItemResponseData::SecItemResponseData): Reorder the constructor arguments to be a little cleaner. * Shared/mac/SecItemResponseData.h: Call the shim callbacks for each method: * WebProcess/mac/WebProcessShim.mm: (WebKit::shimSecItemCopyMatching): (WebKit::shimSecItemAdd): (WebKit::shimSecItemUpdate): (WebKit::shimSecItemDelete): Implement the shim callbacks, which each marshall to the main thread, which then calls out to CoreIPC: * WebProcess/mac/WebProcessMac.mm: (WebKit::WebSecItemCopyMatchingMainThread): (WebKit::WebSecItemCopyMatching): (WebKit::WebSecItemAddOnMainThread): (WebKit::WebSecItemAdd): (WebKit::WebSecItemUpdateOnMainThread): (WebKit::WebSecItemUpdate): (WebKit::WebSecItemDeleteOnMainThread): (WebKit::WebSecItemDelete): Add the 4 messages and their implementations in the UIProcess: * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/mac/WebProcessProxyMac.mm: Added. (WebKit::WebProcessProxy::secItemCopyMatching): (WebKit::WebProcessProxy::secItemAdd): (WebKit::WebProcessProxy::secItemUpdate): (WebKit::WebProcessProxy::secItemDelete): * WebKit2.xcodeproj/project.pbxproj: 2011-05-17 Anders Carlsson Reviewed by Dan Bernstein. Incomplete page painting at dropbox.com https://bugs.webkit.org/show_bug.cgi?id=60974 When we're exiting compositing mode and haven't sent an EnterAcceleratedCompositingMode message to the UI process, we still need to send the updated bits to the ui process. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): 2011-05-17 Brady Eidson Reviewed by Anders Carlsson. Part 3 of and https://bugs.webkit.org/show_bug.cgi?id=60595 Mac WebKit2 WebProcess needs a shim to make prompts appear to be from the UIProcess Add CoreIPC stuff we'll need to marshall the SecItem calls to the UIProcess and back. Teach ArgumentCodersCF about CFDateRef, SecKeychainItemRef, and generic CFTypeRefs: * Shared/cf/ArgumentCodersCF.cpp: (CoreIPC::typeFromCFTypeRef): (CoreIPC::encode): (CoreIPC::decode): * Shared/cf/ArgumentCodersCF.h: Serializable object that contains the query CFDictionaryRef and optionally the "attributesToMatch" CFDictionaryRef: * Shared/mac/SecItemRequestData.cpp: Added. (WebKit::SecItemRequestData::SecItemRequestData): (WebKit::SecItemRequestData::encode): (WebKit::SecItemRequestData::decode): * Shared/mac/SecItemRequestData.h: Added. (WebKit::SecItemRequestData::query): (WebKit::SecItemRequestData::attributesToMatch): Serializable object that returns an OSStatus and optionally a "result object" CFTypeRef: * Shared/mac/SecItemResponseData.cpp: Added. (WebKit::SecItemResponseData::SecItemResponseData): (WebKit::SecItemResponseData::encode): (WebKit::SecItemResponseData::decode): * Shared/mac/SecItemResponseData.h: Added. (WebKit::SecItemResponseData::resultObject): (WebKit::SecItemResponseData::resultCode): * WebKit2.xcodeproj/project.pbxproj: 2011-05-17 Brady Eidson Reviewed by Anders Carlsson. Part 2 of and https://bugs.webkit.org/show_bug.cgi?id=60595 Mac WebKit2 WebProcess needs a shim to make prompts appear to be from the UIProcess Hookup some of the methods we plan to shim in the patch, but just have them call through to the actual implementations for now. Also stub-out the future shimmed versions of the methods. * WebProcess/mac/WebProcessShim.h: Add the methods to the shim callbacks. * WebProcess/mac/WebProcessShim.mm: (WebKit::shimSecItemCopyMatching): Call through to the actual function for now. (WebKit::shimSecItemAdd): Ditto. (WebKit::shimSecItemUpdate): Ditto. (WebKit::shimSecItemDelete): Ditto. (WebKit::WebKitWebProcessShimInitialize): Copy over the shim callbacks. * WebKit2.xcodeproj/project.pbxproj: Link the shim to required frameworks. * WebProcess/mac/WebProcessMac.mm: (WebKit::WebSecItemCopyMatching): Add placeholders for the future to-be-shimmed functions. (WebKit::WebSecItemAdd): Ditto. (WebKit::WebSecItemUpdate): Ditto. (WebKit::WebSecItemDelete): Ditto. (WebKit::WebProcess::initializeShim): Pass along those placeholders to the shim initializer. 2011-05-17 Brady Eidson Reviewed by Anders Carlsson. Part 1 of and https://bugs.webkit.org/show_bug.cgi?id=60595 Mac WebKit2 WebProcess needs a shim to make prompts appear to be from the UIProcess Add am empty shim for a new WebProcess shim and install it at launch. Use the same Shim.xcconfig for both the web and plugin processes: * Configurations/PluginProcessShim.xcconfig: Removed. * Configurations/Shim.xcconfig: Copied from Configurations/PluginProcessShim.xcconfig. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.h: Add initializeShim() for Mac-only * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::initializeShim): Initialize the (empty) shim callbacks. * WebProcess/mac/WebProcessMainMac.mm: (WebKit::WebProcessMain): Call initializeShim() * WebProcess/mac/WebProcessShim.h: Added. * WebProcess/mac/WebProcessShim.mm: Added. (WebKit::WebKitWebProcessShimInitialize): Empty for now. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): Install the Plugin Process shim for plugin processes and the WebProcess shim for the web content process. 2011-05-17 John Sullivan Reviewed by Adam Roben. Loose end from fix for https://bugs.webkit.org/show_bug.cgi?id=60938 * WebKit2.xcodeproj/project.pbxproj: Made new header file "private" instead of "project" so clients can access it. 2011-05-17 Andreas Kling Reviewed by Kenneth Rohde Christiansen. [Qt][WK2] Remove usage of ChunkedUpdateDrawingArea. https://bugs.webkit.org/show_bug.cgi?id=60901 To prepare for the eventual removal of the ChunkedUpdateDrawingArea, make QGraphicsWKView's "Simple" backing store type map to DrawingAreaImpl. * UIProcess/API/qt/qgraphicswkview.cpp: * UIProcess/API/qt/qgraphicswkview.h: * UIProcess/API/qt/qwkpage.cpp: (QWKPagePrivate::createDrawingAreaProxy): 2011-05-16 Martin Robinson Take another shot at fixing the WinCairo build. * Shared/cairo/LayerTreeContextCairo.cpp: Include NotImplemented.h using a framework include. 2011-05-16 Sam Weinig Reviewed by Jon Honeycutt. Add access to process pid in WebKit2 API https://bugs.webkit.org/show_bug.cgi?id=60938 * UIProcess/API/C/mac/WKPagePrivateMac.cpp: Added. (WKPageGetProcessIdentifier): * UIProcess/API/C/mac/WKPagePrivateMac.h: Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processIdentifier): * UIProcess/WebPageProxy.h: * WebKit2.xcodeproj/project.pbxproj: Add WKPageGetProcessIdentifier as SPI for the mac. 2011-05-16 Martin Robinson Add file missing from my previous commit. * Shared/cairo/LayerTreeContextCairo.cpp: Added. 2011-05-16 Martin Robinson Try to fix the WinCairo build after r86612. Move the LayerTreeContextGtk.cpp stub to LayerTreeContextCairo.cpp and add it to the WinCairo build. * GNUmakefile.am: Update the source list. * Shared/cairo/LayerTreeContextCairo.cpp: Renamed from Source/WebKit2/Shared/gtk/LayerTreeContextGtk.cpp. * win/WebKit2.vcproj: Update the source list. 2011-05-16 Martin Robinson Reviewed by Anders Carlsson. [GTK] [WebKit2] Provide a fast version of the backing store for X11 https://bugs.webkit.org/show_bug.cgi?id=60912 Instead of allocating the backing store surface directly in WebKit2, instantiate the GtkWidgetBackingStore class which abstracts away the platform-specific details of maintaining the backing store. * UIProcess/BackingStore.h: * UIProcess/gtk/BackingStoreGtk.cpp: (WebKit::BackingStore::paint): Call into GtkWidgetBackingStore to get the Cairo surface now. (WebKit::BackingStore::incorporateUpdate): Ditto. (WebKit::BackingStore::scroll): Call into GtkWidgetBackingStore to do the actual backing store scroll. 2011-05-16 Chris Marrin Reviewed by Darin Adler. Plug-in hit testing is broken after zooming https://bugs.webkit.org/show_bug.cgi?id=60916 Construct a WebMouseEvent to send to plugin, adjusting values to take pageScaleFactor into account. Also adjusted bounds sent to viewGeometryDidChange to take pageScaleFactor into account. Both are needed or the plugin will think the mouse positions are outside its bounds. * Shared/WebEvent.h: * Shared/WebMouseEvent.cpp:Add ctor to clone a WebMouseEvent and add a scaleFactor to values (WebKit::WebMouseEvent::WebMouseEvent): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::handleEvent):Adjust mouse coords to take pageScaleFactor into account (WebKit::PluginView::viewGeometryDidChange):Adjust bounds to take pageScaleFactor into account 2011-05-16 Martin Robinson Reviewed by Anders Carlsson. GTK port of WebKit2 should switch to new DrawingAreaImpl model https://bugs.webkit.org/show_bug.cgi?id=59655 * GNUmakefile.am: Add the files necessary to use the DrawingAreaProxyImpl to the source list. The source list also needs the LayerContextTree stubs. * Shared/LayerTreeContext.h: This file should not be guarded by USE(ACCELERATED_COMPOSITING) as it's needed for the DrawingAreaProxyImpl IPC messaging. * Shared/gtk/LayerTreeContextGtk.cpp: Added this stub. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): Instead of creating the deprecated chunked drawing area, create a DrawingAreaProxyImpl. (WebKit::PageClientImpl::setViewNeedsDisplay): Here we must now queue a redraw. Previously the chunked drawing area was doing this manually. This is the appropriate place though. (WebKit::PageClientImpl::scrollView): Add an implementation that just calls into setViewNeedsDisplay. * UIProcess/API/gtk/PageClientImpl.h: Added a getter for m_viewWidget. (WebKit::PageClientImpl::viewWidget): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (callDrawingAreaPaintMethod): Added this helper which reduces code duplication between GTK+ 2.x and 3.x (webkitWebViewBaseExpose): Call the new helper now. (webkitWebViewBaseDraw): Ditto. * UIProcess/BackingStore.h: Updated to include GTK+ specific types. * UIProcess/DrawingAreaProxy.h: Ditto. * UIProcess/DrawingAreaProxy.messages.in: Do not the DrawingAreaProxyImpl-specific message with USE(ACCELERATED_COMPOSITING). * UIProcess/WebPageProxy.cpp: Removed these guards, as DrawingAreProxyImpl is used on all platforms now. (WebKit::WebPageProxy::didReceiveMessage): Ditto. * UIProcess/WebPageProxy.h: Ditto. * UIProcess/gtk/BackingStoreGtk.cpp: Added. This implementation heavily uses Cairo, but depends on GTK+/GDK in a few places. (WebKit::BackingStore::paint): (WebKit::BackingStore::incorporateUpdate): (WebKit::BackingStore::scroll): * UIProcess/gtk/WebPageProxyGtk.cpp: Added a getting for the viewWidget, which is required by BackingStoreGtk. A similar getter exists for Windows and Mac. (WebKit::WebPageProxy::viewWidget): Ditto. * WebProcess/WebPage/DrawingArea.cpp: Removed these guards as DrawingAreaProxyImpl is used on all platforms now. (WebKit::DrawingArea::create): Ditto. * WebProcess/WebPage/DrawingArea.h: Ditto. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): Do not guard this DrawingAreaProxyImpl-specific message with USE(ACCELERATED_COMPOSITING) * WebProcess/WebPage/WebPage.cpp: Removed these guards as DrawingAreaProxyImpl is used on all platforms now. (WebKit::WebPage::didReceiveMessage): Ditto. 2011-05-16 Maciej Stachowiak Reviewed by Sam Weinig. Sandbox denies Kerberos authentication https://bugs.webkit.org/show_bug.cgi?id=60921 * WebProcess/com.apple.WebProcess.sb: 2011-05-16 David Kilzer C++ exceptions should not be enabled when building with llvm-gcc-4.2 Reviewed by Mark Rowe. * Configurations/Base.xcconfig: Fixed typo. 2011-05-16 Anders Carlsson Reviewed by Dan Bernstein. If the root compositing layer changes while we're about to exit compositing mode, make sure to enter compositing mode https://bugs.webkit.org/show_bug.cgi?id=60905 * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::setRootCompositingLayer): If we have a layer tree host, but haven't yet sent a EnterAcceleratedCompositingMode message (this can happen when quickly going in and out of compositing mode), make sure to schedule a notification when the layer tree host does it next flush. This will end up sending the EnterAcceleratedCompositingMode message. 2011-05-13 Jer Noble Reviewed by Simon Fraser. Video is blank, controller is misplaced on trailers.apple.com movie in fullscreen (with two screens) https://bugs.webkit.org/show_bug.cgi?id=60826 Emit a notification when moving a CALayer from the WebProcess's main layer host to a new context. This allows listeners to invalidate their layers which may not support moving between different CAContexts (as is the case with QTMovieLayer). In order to allow listeners to determine if they are affected, the notification will pass the root CALayer in a userInfo dictionary. In WebFullScreenManagerMac, move from storing a pointer to a non-refcounted class (GraphicsLayer) to a retainable class (PlatformLayer). * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::WebFullScreenManagerMac): No need to initialize m_fullScreenRootLayer now that it is a RetainPtr<>. (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): Emit a notification after either creating or destroying the full screen layer host. (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): 2011-05-16 Siddharth Mathur Rubber-stamped by Csaba Osztrogonác. [Qt][Wk2][Symbian] Fix build after r86560 https://bugs.webkit.org/show_bug.cgi?id=60887 Temporarily fix Symbian build by re-enabling compilation of Qt/Gtk common code (as was the case for Symbian before r55875). This is a stop gap until the pure Symbian Core IPC and process launching bits land in Bug 55875 As of this revision, only the native SharedMemory implementation is in trunk. * Platform/CoreIPC/Attachment.h: Compile Qt/Gtk common code for Qt-Symbian too * Platform/CoreIPC/Connection.h: ditto * Platform/SharedMemory.h: ditto * Platform/qt/SharedMemorySymbian.cpp: stub implementations of attachment handling (WebKit::SharedMemory::Handle::releaseToAttachment): (WebKit::SharedMemory::Handle::adoptFromAttachment): 2011-05-16 Jon Lee Reviewed by Simon Fraser. Can't horizontally scroll iframes and overflow because wheel events are always accepted https://bugs.webkit.org/show_bug.cgi?id=60779 We keep track of the number of horizontal scrollbars and mouse wheel event handlers in the UI process as a means of determining whether horizontal scroll events will be handled by the web process. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willHandleHorizontalScrollEvents): Return true if there is at least one wheel event handler * UIProcess/WebPageProxy.h: Add new variable to cache the count (WebKit::WebPageProxy::numWheelEventHandlersChanged): Sets the count The rest just provides all the connections. * UIProcess/API/C/WKPage.cpp: (WKPageWillHandleHorizontalScrollEvents): * UIProcess/API/C/WKPage.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/InjectedBundle/API/c/WKBundlePage.h: * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::shouldRubberBandInDirection): * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::shouldRubberBandInDirection): Forward to injected bundle UI client (WebKit::WebChromeClient::updateCountWheelEventHandlers): Updates the web page proxy * WebProcess/WebCoreSupport/WebChromeClient.h: 2011-05-16 Anders Carlsson Reviewed by Oliver Hunt. Silverlight: Selection via keyboard selects the entire plugin instead of the contents of a TextBox https://bugs.webkit.org/show_bug.cgi?id=60898 Special-case Command-A and always return true, indicating that the plug-in handled the event. This matches WebKit1. * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: (WebKit::NetscapePlugin::platformHandleKeyboardEvent): 2011-05-16 Anders Carlsson Reviewed by Oliver Hunt. Short-circuit NPRuntime calls made by Flash during plug-in instantiation https://bugs.webkit.org/show_bug.cgi?id=60894 During plug-in instantiation, Flash makes a couple of NPRuntime calls to get the URL of the current document as well as the URL of the toplevel document. This leads to a bunch of IPC traffic that slows down instantiation. Since we know what calls Flash is making and what results are expected, we can handle the NPRuntime calls directly in the plug-in process and avoid extra IPC overhead. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::PluginControllerProxy): Initialize m_pluginCreationParameters. (WebKit::PluginControllerProxy::initialize): Set m_pluginCreationParameters to point to the creation parameters right before calling Plugin::initialize and restore it back afterwards. (WebKit::PluginControllerProxy::tryToShortCircuitInvoke): If the plug-in calling NPN_Invoke has the CanShortCircuitSomeNPRuntimeCallsDuringInitialization quirk, and we're being initialized, check for the __flash_getWindowLocation and __flash_getTopLocation function calls and return the correct values. (WebKit::PluginControllerProxy::tryToShortCircuitEvaluate): Check if the script string has the definitions of __flash_getWindowLocation or __flash_getTopLocation and just ignore them. Note that ignoring them has the effect of not adding them to the window object, which could in theory be a backwards compatibility problem if web pages were to assume that these functions existed on a page with plug-ins. In practice this is probably not a problem, especially since these functions are only used on Mac WebKit. * PluginProcess/PluginControllerProxy.h: (WebKit::PluginControllerProxy::inInitialize): Add helper function. * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::NetscapePluginModule::determineQuirks): Add the CanShortCircuitSomeNPRuntimeCallsDuringInitialization quirk for Flash on Mac. * Shared/Plugins/PluginQuirks.h: Add Mac specific CanShortCircuitSomeNPRuntimeCallsDuringInitialization quirk. 2011-05-16 Anders Carlsson Reviewed by Adam Roben. Add a returnValue parameter to tryToShortCircuitInvoke https://bugs.webkit.org/show_bug.cgi?id=60891 tryToShortCircuitInvoke needs to be able to indicate that an invoke call failed. Add a returnValue parameter and have the real return value indicate whether tryToShortCircuitInvoke did short-circuit the invoke or not. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::tryToShortCircuitInvoke): * PluginProcess/PluginControllerProxy.h: * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_Invoke): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::tryToShortCircuitInvoke): * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::tryToShortCircuitInvoke): * WebProcess/Plugins/PluginView.h: 2011-05-16 Siddharth Mathur Reviewed by Csaba Osztrogonác. [Qt][Wk2][Symbian] Fix build after r86560 https://bugs.webkit.org/show_bug.cgi?id=60887 * Platform/CoreIPC/ArgumentDecoder.cpp: (CoreIPC::ArgumentDecoder::~ArgumentDecoder): guard Unix and Gtk code with USE(UNIX_DOMAIN_SOCKETS) * Platform/CoreIPC/ArgumentEncoder.cpp: (CoreIPC::ArgumentEncoder::~ArgumentEncoder): ditto 2011-05-16 Anders Carlsson Reviewed by Adam Roben. Add the ability for a plug-in controller to short-circuit calls to NPN_Invoke https://bugs.webkit.org/show_bug.cgi?id=60886 Make it possible for a plug-in controller to intercept calls to NPN_Invoke, which will be useful for avoiding sync IPC messages during instantiation. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::evaluate): Call tryToShortCircuitEvaluate. If it returns true, we don't need to call back to the web process to ask it to evaluate the script string. (WebKit::PluginControllerProxy::tryToShortCircuitInvoke): (WebKit::PluginControllerProxy::tryToShortCircuitEvaluate): Always return false for now. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_Invoke): Get the plug-in and call tryToShortCircuitInvoke. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::tryToShortCircuitInvoke): Call the plug-in controller. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::tryToShortCircuitInvoke): Always return false here, since there's no need to short-circuit calls for plug-ins that live in the web process. 2011-05-16 Siddharth Mathur Reviewed by Laszlo Gombos. [Qt][WK2][Symbian] Shared memory implementation for Symbian https://bugs.webkit.org/show_bug.cgi?id=55875 Use global chunks for sharing data between processes. This is an initial implementation. An outstanding issue is the correct way to close() the chunk in the SharedMemory d'tor without triggering a delete by the kernel when the ref-count temporarily goes to zero. * Platform/SharedMemory.h: platform specific handle and chunk name * Platform/qt/SharedMemorySymbian.cpp: Added. Native Symbian OS implementation using RChunk.CreateGlobal() for named chunks. The chunk name is serialized and sent over the IPC channel and opened by the remote process using RChunk.OpenGlobal(). (WebKit::SharedMemory::Handle::Handle): (WebKit::SharedMemory::Handle::~Handle): (WebKit::SharedMemory::Handle::isNull): (WebKit::SharedMemory::Handle::encode): (WebKit::SharedMemory::Handle::decode): (WebKit::SharedMemory::create): (WebKit::SharedMemory::~SharedMemory): (WebKit::SharedMemory::createHandle): (WebKit::SharedMemory::systemPageSize): * Platform/unix/SharedMemoryUnix.cpp: Exclude Qt-Symbian using HAVE(UNIX_DOMAIN_SOCKETS) * WebKit2.pro: Add SharedMemorySymbian.cpp 2011-05-16 Carlos Garcia Campos Unreviewed. Fix WebKit2 GTK build after r86489. * GNUmakefile.am: Add PluginProcess/PluginCreationParameters.cpp and PluginProcess/PluginCreationParameters.h to compilation. 2011-05-16 Carlos Garcia Campos Reviewed by Martin Robinson. [GTK] Enable building GTK port with ENABLE_PLUGIN_PROCESS=1 https://bugs.webkit.org/show_bug.cgi?id=58223 * GNUmakefile.am: Add new files to compilation. * PluginProcess/gtk/PluginControllerProxyGtk.cpp: Added. (WebKit::PluginControllerProxy::platformInitialize): (WebKit::PluginControllerProxy::platformDestroy): (WebKit::PluginControllerProxy::platformGeometryDidChange): * PluginProcess/gtk/PluginProcessGtk.cpp: Added. (WebKit::PluginProcess::platformInitialize): * UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp: Added. (WebKit::PluginProcessProxy::platformInitializePluginProcess): * WebProcess/Plugins/Netscape/gtk/PluginProxyGtk.cpp: Added. (WebKit::PluginProxy::needsBackingStore): 2011-05-16 Adam Barth Attempt to fix the Qt build. (Strict PassOwnPtr fix.) * Shared/qt/ShareableBitmapQt.cpp: (WebKit::ShareableBitmap::createGraphicsContext): 2011-05-15 Michael Saboff Reviewed by Geoffrey Garen. Suboptimal lifetime of BackingStore objects in DrawingAreaProxyImpl https://bugs.webkit.org/show_bug.cgi?id=60864 Implemented reuse of BackingStore's in DrawingAreaProxyImpl::didUpdateBackingStoreState when the size needed matches the size of the existing BackingStore. Also reduced the discardBackingStoreTimer from 5 to 2 seconds. These changes reduces memory usage up to 10MB on memory tests. * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState): (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon): 2011-05-15 Anders Carlsson Reviewed by Maciej Stachowiak. Pass the window NPObject identifier in the plug-in creation parameters https://bugs.webkit.org/show_bug.cgi?id=60865 This avoids a synchronous call when the plug-in wants to get the NPObject that corresponds to the window. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::initialize): Change this to take the PluginCreationParameters. Initialize the window NPObject. (WebKit::PluginControllerProxy::windowScriptNPObject): Just return the window NPObject; it's already been initialized. * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginCreationParameters.cpp: (WebKit::PluginCreationParameters::PluginCreationParameters): (WebKit::PluginCreationParameters::encode): (WebKit::PluginCreationParameters::decode): * PluginProcess/PluginCreationParameters.h: Add the window NPObject ID. * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::createPlugin): Pass the creation parameters to PluginControllerProxy::initialize. * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::initialize): Initialize the window NPObject ID. * WebProcess/Plugins/PluginProxy.messages.in: Remove the GetWindowScriptNPObject message. 2011-05-15 Anders Carlsson Reviewed by Geoffrey Garen. Pass the document URL and toplevel document URL when creating a plug-in https://bugs.webkit.org/show_bug.cgi?id=60863 This is the first of a series of patches intended to reduce the IPC traffic during plug-in instantiation. * WebProcess/Plugins/Plugin.cpp: (WebKit::Plugin::Parameters::encode): Encode the URLs. (WebKit::Plugin::Parameters::decode): Decode the URLs. * WebProcess/Plugins/Plugin.h: Add the document and toplevel document URLs. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::createPlugin): Initialize the document and toplevel document URLs. 2011-05-13 Oliver Hunt Reviewed by Geoffrey Garen. Make GC validation more aggressive https://bugs.webkit.org/show_bug.cgi?id=60802 Add GC_VALIDATION calls to all the JSNPObject methods. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::invalidate): (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::JSNPObject::getCallData): (WebKit::JSNPObject::getConstructData): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::getOwnPropertyDescriptor): (WebKit::JSNPObject::put): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): 2011-05-13 Oliver Hunt Reviewed by Geoffrey Garen. Make GC validation more aggressive https://bugs.webkit.org/show_bug.cgi?id=60802 Add GC_VALIDATION calls to all the JSNPObject methods. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::invalidate): (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::JSNPObject::getCallData): (WebKit::JSNPObject::getConstructData): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::getOwnPropertyDescriptor): (WebKit::JSNPObject::put): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): 2011-05-14 Alexey Proskuryakov Reviewed by Sam Weinig. WebKit2: Smart cut&paste is broken https://bugs.webkit.org/show_bug.cgi?id=60840 * UIProcess/mac/TextCheckerMac.mm: (WebKit::TextChecker::isSmartInsertDeleteEnabled): Match WK1 - this default defaults to YES if not present. 2011-05-14 Dan Bernstein Reviewed by Alice Liu. WKView does not draw after forced repaint before the first update https://bugs.webkit.org/show_bug.cgi?id=60845 * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint): Added. * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::waitForBackingStoreUpdateOnNextPaint): Set m_hasReceivedFirstUpdate to true, ensuring that paint() will wait for an update if needed. * UIProcess/DrawingAreaProxyImpl.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::forceRepaint): Call DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint(). 2011-05-14 Anders Carlsson Reviewed by Sam Weinig. Document the WantsMozillaUserAgent quirk and make it Windows specific https://bugs.webkit.org/show_bug.cgi?id=60843 * Shared/Plugins/PluginQuirks.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::userAgent): 2011-05-14 Anders Carlsson Reviewed by Sam Weinig. Consolidate plug-in creation parameters to a single struct https://bugs.webkit.org/show_bug.cgi?id=60839 * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::create): (WebKit::PluginControllerProxy::PluginControllerProxy): * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginCreationParameters.cpp: Added. (WebKit::PluginCreationParameters::PluginCreationParameters): (WebKit::PluginCreationParameters::encode): (WebKit::PluginCreationParameters::decode): * PluginProcess/PluginCreationParameters.h: Added. * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::createPlugin): * PluginProcess/WebProcessConnection.h: * PluginProcess/WebProcessConnection.messages.in: * Scripts/webkit2/messages.py: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::initialize): 2011-05-14 Anders Carlsson Reviewed by Kevin Decker. NPP_URLNotify is not called if a URL passed to NPN_GetURLNotify fails to load https://bugs.webkit.org/show_bug.cgi?id=60823 If a plug-in stream fails to load before it's been started, we won't destroy the stream. * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::stop): Call notifyAndDestroyStream which will call NPP_URLNotify if necessary, and also destroy the stream. (WebKit::NetscapePluginStream::notifyAndDestroyStream): Pass the request URL to NPP_URLNotify, matching other browsers. 2011-05-14 Jer Noble Reviewed by Simon Fraser. Flashing window frame and graphical glitches after exiting full screen mode. https://bugs.webkit.org/show_bug.cgi?id=60825 A layer-backed WebView throws an exception when moved from a layer-backed parent view to a non-layer-backed one, so make the WebView a child of the content view, instead of the animation view. There is an unrelated fix in beganExitFullScreen, which was calling finishedExitFullScreenAnimation: instead of finishedEnterFullScreenAnimation: when notifications come out of order. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Add the _webView to the full screen window's content view, instead of the _animationView. (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Call finishedEnterFullScreenAnimation: instead of finishedExitFullScreenAnimation:. (-[WKFullScreenWindowController enterAcceleratedCompositingMode:WebKit::]): Add the _layerHostingView to the contentView, instead of the animationView. 2011-05-14 Csaba Osztrogonác Unreviewed, rolling out r86469 and r86471, because they made hundreds tests crash on Qt. Make GC validation more aggressive https://bugs.webkit.org/show_bug.cgi?id=60802 * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::invalidate): (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::JSNPObject::getCallData): (WebKit::JSNPObject::getConstructData): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::getOwnPropertyDescriptor): (WebKit::JSNPObject::put): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): 2011-05-14 Sheriff Bot Unreviewed, rolling out r86476. http://trac.webkit.org/changeset/86476 https://bugs.webkit.org/show_bug.cgi?id=60832 It made plugins/get-url-notify-with-url-that-fails-to- load.html crash on GTK (Requested by Ossy on #webkit). * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::stop): (WebKit::NetscapePluginStream::notifyAndDestroyStream): 2011-05-13 Enrica Casucci Reviewed by Darin Adler and Brian Weinstein. REGRESSION (WK2): Can't drag and drop a link or image from Safari to Desktop https://bugs.webkit.org/show_bug.cgi?id=60819 To support drag-and-drop to the desktop and other windows applications, we need to support the fileDescriptor and fileContentZero clipboard formats. This patch adds the support for serializing these types across the process boundary. * Platform/CoreIPC/Arguments.h: Added support for messages with 10 arguments. (CoreIPC::Arguments10::Arguments10): (CoreIPC::Arguments10::encode): (CoreIPC::Arguments10::decode): (CoreIPC::In): (CoreIPC::Out): * Platform/CoreIPC/HandleMessage.h: (CoreIPC::callMemberFunction): Added support for memebers with 10 arguments. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startDragDrop): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/win/WebDragClientWin.cpp: (WebKit::WebDragClient::startDrag): 2011-05-13 Anders Carlsson Reviewed by Sam Weinig. NPP_URLNotify is not called if a URL passed to NPN_GetURLNotify fails to load https://bugs.webkit.org/show_bug.cgi?id=60823 If a plug-in stream fails to load before it's been started, we won't destroy the stream. * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::stop): Call notifyAndDestroyStream which will call NPP_URLNotify if necessary, and also destroy the stream. (WebKit::NetscapePluginStream::notifyAndDestroyStream): Pass the request URL to NPP_URLNotify, matching other browsers. 2011-05-13 Michael Saboff Reviewed by Geoffrey Garen. Backing store may not get discarded due to stopped timer https://bugs.webkit.org/show_bug.cgi?id=60816 Changed the backing store timer to restart if it has been stopped. The evaluation is done when the view's state is changed. This change appears to be worth ~3MB (one backing store worth) during memory tests. * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::viewStateDidChange): 2011-05-13 Oliver Hunt Reviewed by Geoffrey Garen. Make GC validation more aggressive https://bugs.webkit.org/show_bug.cgi?id=60802 Add GC_VALIDATION calls to all the JSNPObject methods. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::invalidate): (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::JSNPObject::getCallData): (WebKit::JSNPObject::getConstructData): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::getOwnPropertyDescriptor): (WebKit::JSNPObject::put): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): 2011-05-13 Anders Carlsson Reviewed by Sam Weinig. NPN_GetURL with a javascript: URL doesn't send back the result in the stream https://bugs.webkit.org/show_bug.cgi?id=60810 In NetscapePluginStream::sendJavaScriptStream, we were incorrectly passing the result URL to the stream, instead of the result. Also, store the request URL in the NetscapePluginStream object to avoid sending it over the wire. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::didEvaluateJavaScript): * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginControllerProxy.messages.in: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::loadURL): (WebKit::NetscapePlugin::didEvaluateJavaScript): (WebKit::NetscapePlugin::manualStreamDidReceiveResponse): * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): (WebKit::NetscapePluginStream::sendJavaScriptStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: (WebKit::NetscapePluginStream::create): * WebProcess/Plugins/Plugin.h: * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::didEvaluateJavaScript): * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performJavaScriptURLRequest): 2011-05-13 Jeff Miller Reviewed by Darin Adler. Make some page() member functions const https://bugs.webkit.org/show_bug.cgi?id=60794 * UIProcess/ChunkedUpdateDrawingAreaProxy.h: Make page() const. * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::page): Make page() const. * UIProcess/WebInspectorProxy.h: (WebKit::WebInspectorProxy::page): Make page() const. * UIProcess/gtk/ChunkedUpdateDrawingAreaProxyGtk.cpp: (WebKit::ChunkedUpdateDrawingAreaProxy::page): Make page() const. * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm: (WebKit::ChunkedUpdateDrawingAreaProxy::page): Make page() const. * UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp: (WebKit::ChunkedUpdateDrawingAreaProxy::page): Make page() const. * UIProcess/win/ChunkedUpdateDrawingAreaProxyWin.cpp: (WebKit::ChunkedUpdateDrawingAreaProxy::page): Make page() const. 2011-05-13 Adam Roben Load plugins in the order they're found Fixes REGRESSION (r69790): WebKit2 doesn't prefer plugins in the additional plugins directory Reviewed by Anders Carlsson. * UIProcess/Plugins/PluginInfoStore.cpp: (WebKit::addFromVector): Changed to use a ListHashSet instead of a HashSet to store the plugin paths. 2011-05-13 Sam Weinig Reviewed by Anders Carlsson. Prune #includes from FrameView.h (Part 2) https://bugs.webkit.org/show_bug.cgi?id=60748 - Update files that were depending on FrameView.h #including Frame.h or Page.h. * WebProcess/Plugins/PluginView.cpp: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: * WebProcess/WebPage/WebContextMenu.cpp: * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm: 2011-05-13 Martin Robinson Reviewed by Eric Seidel. [GTK] Share the GTK+ key binding code between WebKit1 and WebKit2 https://bugs.webkit.org/show_bug.cgi?id=59765 Use the new KeyBindingTranslator class from WebCore/platform/gtk. With this utility class we can now share the code with WebKit2. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::PageClientImpl): No longer need to initialize keybinding code. (WebKit::PageClientImpl::getEditorCommandsForKeyEvent): Use the new utility class. * UIProcess/API/gtk/PageClientImpl.h: Remove unnecessary members. Add utility class member. 2011-05-12 Pratik Solanki Reviewed by Antti Koivisto. Part of WebCore should use CFNetwork-based loader on Mac https://bugs.webkit.org/show_bug.cgi?id=51836 Use CFRunLoop when using CFNetwork. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformInitialize): 2011-05-12 Sam Weinig Reviewed by Gavin Barraclough. WebProcess sandbox denies file:/// accesses after you navigate to a nonexistent file https://bugs.webkit.org/show_bug.cgi?id=60745 * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad): Don't attempt to re-use a non-existent committed sandbox extension. This can happen when the previous load was file: url, but did not require an extension, such as an error page. 2011-05-12 Jia Pu Reviewed by Darin Adler. Regression caused by changeset 86281 https://bugs.webkit.org/show_bug.cgi?id=60712 Removed the condition variable. [NSSpellChecker dismissCorrectionIndicatorForView:] is blocking. So handleAcceptedReplacement() triggered by dismissInternal() will return before dismissInternal() returns. So we don't need to use the condition to coordinate between these two function. In fact, all callbacks are delivered on main thread. We don't really need any locking here. Since now we don't have distinction between dismiss() and dismissSoon(). dismissSoon() has been removed. * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::dismissCorrectionPanelSoon): * UIProcess/mac/CorrectionPanel.h: * UIProcess/mac/CorrectionPanel.mm: (WebKit::CorrectionPanel::CorrectionPanel): (WebKit::CorrectionPanel::show): (WebKit::CorrectionPanel::dismiss): (WebKit::CorrectionPanel::dismissInternal): (WebKit::CorrectionPanel::handleAcceptedReplacement): 2011-05-12 Brian Weinstein Reviewed by Adam Roben. WebKit2: Implement plugin quirk for Mozilla user agent for older Flash https://bugs.webkit.org/show_bug.cgi?id=60726 Implement the quirk for versions of Flash before v10 that only request windowless plugins if we use a Mozilla user agent. * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp: (WebKit::NetscapePluginModule::determineQuirks): If we have a plugin that handles the "application/x-shockwave-flash" MIME type with a version less than 10, tell it to use the Mozilla user agent. * Shared/Plugins/PluginQuirks.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::userAgent): Add an early return if the plugin uses the Mozilla user agent. * win/WebKit2.vcproj: Add PluginQuirks.h. 2011-05-12 Anders Carlsson Reviewed by Simon Fraser. PluginView::invalidateRect doesn't work for transformed plug-ins https://bugs.webkit.org/show_bug.cgi?id=60727 Ask the RenderObject to repaint the plug-in instead of using invalidateContentsAndWindow. This matches what we do in WebKit1. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::invalidateRect): 2011-05-12 Jessie Berlin Reviewed by Darin Adler. [Windows WebKit2] Use cookies set in WebKit1 https://bugs.webkit.org/show_bug.cgi?id=60274 Properly handle the case where there is no serialized default storage session by not trying to encode or decode 0, while still making sure to decode any valid storage session. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): (WebKit::WebProcessCreationParameters::encode): Only encode the storage session if there is one to encode. (WebKit::WebProcessCreationParameters::decode): Only decode the storage session there is one to decode. * Shared/WebProcessCreationParameters.h: 2011-05-11 Brian Weinstein Reviewed by Anders Carlsson. After relaunching an unresponsive web process, web page stops responding to mouse movement https://bugs.webkit.org/show_bug.cgi?id=60669 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidCrash): Set m_processingMouseMoveEvent to false when the WebProcess crashes. 2011-05-10 Tony Gentilcore Reviewed by Darin Adler. Perform some forward declarations suggested by include-what-you-use https://bugs.webkit.org/show_bug.cgi?id=60545 * WebProcess/WebPage/mac/WebPageMac.mm: 2011-05-12 Carlos Garcia Campos Reviewed by Martin Robinson. Fix the build with ENABLE_PLUGIN_PROCESS https://bugs.webkit.org/show_bug.cgi?id=60628 * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::initialize): Move the call to pluginController->isAcceleratedCompositingEnabled() to a #ifdef block. * WebProcess/Plugins/PluginProxy.h: Add include for . 2011-05-11 Damian Kaleta Reviewed by Brady Eidson. Need a new API that will try to restore the scrollbars' position, when navigating in the back/forward history https://bugs.webkit.org/show_bug.cgi?id=60674 * UIProcess/API/C/WKPage.cpp: (WKPageTryRestoreScrollPosition): * UIProcess/API/C/WKPage.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::tryRestoreScrollPosition): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::tryRestoreScrollPosition): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2011-05-11 Sam Weinig Reviewed by Gavin Barraclough. WebKit2 doesn't build on Mac with strict PassOwnPtr https://bugs.webkit.org/show_bug.cgi?id=60655 * Platform/CoreIPC/HandleMessage.h: (CoreIPC::handleMessageDelayed): Add explicit adoptPtr to indicate that the constructor is taking ownership. 2011-05-11 Jessie Berlin Reviewed by Steve Falkenburg. [Windows WebKit2] Use cookies set in WebKit1 https://bugs.webkit.org/show_bug.cgi?id=60274 Share the default storage session between the UI and Web Processes. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): Only encode the session parameter if it is valid. (WebKit::WebProcessCreationParameters::decode): Don't try to decode a null session data. * Shared/WebProcessCreationParameters.h: Add a parameter for a serialized default storage session, used only on Windows. * Shared/win/WebCoreArgumentCodersWin.cpp: (CoreIPC::decodeResourceRequest): Make sure to set the current storage session on any requests used by the Web Process before CFNetwork has to do anything with them, in order for CFNetwork to avoid doing anything with the Web Process's default storage session. * UIProcess/win/WebContextWin.cpp: (WebKit::WebContext::platformInitializeWebProcess): Serialize the default storage session in the UI Process and add it to the WebProcessCreationParameters. * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::cachedResponseForURL): Use the cache associated with the current storage session and make sure the request has the current storage session set on it before doing anything with it. * WebProcess/win/WebProcessWin.cpp: (WebKit::WebProcess::platformSetCacheModel): Use the default storage session. (WebKit::WebProcess::platformClearResourceCaches): Ditto. (WebKit::WebProcess::platformInitializeWebProcess): Deserialize the default storage session passed in by the UI Process and hand it to the ResourceHandle. 2011-05-11 Jia Pu Reviewed by Darin Adler. CorrectionPanel sometimes hangs in dismissSoon(). https://bugs.webkit.org/show_bug.cgi?id=60599 Make sure dismissSoon() won't wait indefinitely if handleAcceptedReplacement() sets m_resultForSynchronousDismissal to nil. Added a designated variable m_isDismissing, instead of piggy-backing m_resultForSynchronousDismissal, for condition checking. * UIProcess/mac/CorrectionPanel.h: * UIProcess/mac/CorrectionPanel.mm: (WebKit::CorrectionPanel::CorrectionPanel): (WebKit::CorrectionPanel::show): (WebKit::CorrectionPanel::dismissSoon): (WebKit::CorrectionPanel::dismissInternal): (WebKit::CorrectionPanel::handleAcceptedReplacement): 2011-05-11 Sheriff Bot Unreviewed, rolling out r86255. http://trac.webkit.org/changeset/86255 https://bugs.webkit.org/show_bug.cgi?id=60660 REGRESSION (r86255): Lots of tests crashing in CFWriteStreamCreateWithAllocatedBuffers on Windows 7 Release (WebKit2 Tests) (Requested by aroben on #webkit). * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/win/WebCoreArgumentCodersWin.cpp: (CoreIPC::decodeResourceRequest): * UIProcess/win/WebContextWin.cpp: (WebKit::WebContext::platformInitializeWebProcess): * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::cachedResponseForURL): * WebProcess/win/WebProcessWin.cpp: (WebKit::WebProcess::platformSetCacheModel): (WebKit::WebProcess::platformClearResourceCaches): (WebKit::WebProcess::platformInitializeWebProcess): 2011-05-11 Adam Roben Don't notify the plugin when a targeted javascript: URL request completes This matches Mozilla and WebKit1. Fixes REGRESSION (WebKit2): Flash plugin doesn't appear on a hanes.com page Test: plugins/get-targeted-javascript-url.html Reviewed by Anders Carlsson. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performJavaScriptURLRequest): Don't call back to the plugin if the request had a target. 2011-05-11 Jessie Berlin Reviewed by Steve Falkenburg. [Windows WebKit2] Use cookies set in WebKit1 https://bugs.webkit.org/show_bug.cgi?id=60274 Share the default storage session between the UI and Web Processes. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: Add a parameter for a serialized default storage session, used only on Windows. * Shared/win/WebCoreArgumentCodersWin.cpp: (CoreIPC::decodeResourceRequest): Make sure to set the current storage session on any requests used by the Web Process before CFNetwork has to do anything with them, in order for CFNetwork to avoid doing anything with the Web Process's default storage session. * UIProcess/win/WebContextWin.cpp: (WebKit::WebContext::platformInitializeWebProcess): Serialize the default storage session in the UI Process and add it to the WebProcessCreationParameters. * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::cachedResponseForURL): Use the cache associated with the current storage session and make sure the request has the current storage session set on it before doing anything with it. * WebProcess/win/WebProcessWin.cpp: (WebKit::WebProcess::platformSetCacheModel): Use the default storage session. (WebKit::WebProcess::platformClearResourceCaches): Ditto. (WebKit::WebProcess::platformInitializeWebProcess): Deserialize the default storage session passed in by the UI Process and hand it to the ResourceHandle. 2011-05-11 Sam Weinig Reviewed by Adam Roben. WebKit2 should tell app that is unresponsive in more cases https://bugs.webkit.org/show_bug.cgi?id=60608 * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState): (WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState): Invoke the responsiveness time when forcing a backing store update to catch the cases of activating tabs, resizing the window, etc. 2011-05-11 Martin Robinson Try to fix the WinCairo build. * Shared/ShareableBitmap.h: Correctly include RefPtrCairo here and guard it with USE(CAIRO) instead of PLATFORM(CAIRO). 2011-05-11 John Sullivan Reviewed by Darin Adler. WebKit2 doesn't clear the pendingAPIRequestURL on in-page anchor navigation [60631] * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Call clearPendingAPIRequestURL(). 2011-05-11 Adam Roben Turn on strict PassOwnPtr on Windows Fixes Windows should build with strict PassOwnPtr enabled Reviewed by Adam Barth. * WebProcess/FullScreen/win/WebFullScreenManagerWin.cpp: (WebKit::WebFullScreenManagerWin::setRootFullScreenLayer): Use nullptr instead of 0. 2011-05-11 Jessie Berlin Reviewed by Darin Adler. [WebKit2] exceededDatabaseQuota function on WKPageUIClient needs to provide information about the usage for both the origin overall and the database in question. https://bugs.webkit.org/show_bug.cgi?id=60573 Add the currentOriginUsage parameter. * Platform/CoreIPC/HandleMessage.h: (CoreIPC::callMemberFunction): * UIProcess/API/C/WKPage.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::exceededDatabaseQuota): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebUIClient.cpp: (WebKit::WebUIClient::exceededDatabaseQuota): * UIProcess/WebUIClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::exceededDatabaseQuota): 2011-05-10 Oliver Hunt Reviewed by Geoffrey Garen. Assertion failure in JSC::Structure::typeInfo when reloading weather.com video page https://bugs.webkit.org/show_bug.cgi?id=60580 The plugin object map was incorrect trying to implement a weak map itself using destructors. Switch to a WeakGCMap and the problem is fixed. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::~JSNPObject): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::getOrCreateJSObject): (WebKit::NPRuntimeObjectMap::invalidate): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: 2011-05-10 Sam Weinig Reviewed by Dan Bernstein. Yet more quarantine related sandbox denial when downloading files * WebProcess/com.apple.WebProcess.sb: 2011-05-10 Sam Weinig Reviewed by Anders Carlsson. WebKit2: Coalesced wheel events should be saved to hand back to the client on unhandled return https://bugs.webkit.org/show_bug.cgi?id=60584 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleWheelEvent): (WebKit::canCoalesce): (WebKit::coalesce): (WebKit::coalescedWheelEvent): (WebKit::WebPageProxy::didReceiveEvent): (WebKit::WebPageProxy::processDidCrash): Reworks coalescing/merging code to happen on didReceiveEvent rather than in handleWheelEvent. This means we now store the pending events in a queue, and pull them out when we can. * UIProcess/WebPageProxy.h: Change single event containers to contain all pending/merged/coalesced events and remove unused flag. 2011-05-09 Jeremy Noble Reviewed by Darin Adler. WebKit2: Cancelling full screen before animation completes leads to full screen window staying up. https://bugs.webkit.org/show_bug.cgi?id=60531 Remove the (unused) _isAnimating ivar and replace it with two ivars: _isEnteringFullScreen and _isExitingFullScreen. These will ensure each is only called once per full screen request, and that if one exit/enter request interrupts another, that the required functions are called in order. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): Removed _isAnimating. (-[WKFullScreenWindowController exitFullScreen]): Ditto. (-[WKFullScreenWindowController beganEnterFullScreenAnimation]): Gate on _isEnteringFullScreen. Check _isExitingFullScreen and call [self finishedExitFullScreenAnimation:] if necessary. (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Gate on _isEnteringFullScreen. (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Gate on _isExitingFullScreen. Check _isEnteringFullScreen and call [self finishedEnterFullScreenAnimation:] if necessary. (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Gate on _isExitingFullScreen. 2011-05-10 Beth Dakin Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=60582 Crash switching overlay/non-overlay scrollbar preference still possible -and corresponding- * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2011-05-10 Jeff Miller Reviewed by Anders Carlsson. WebKit2: Windows clients need to know if the page overlay is installed https://bugs.webkit.org/show_bug.cgi?id=60562 Until we move all the UI for find on page into WebKit on Windows (specifically, drawing the find bouncy), WebKit clients need to know whether WebKit is drawing the page overlay or not. Keep track of this in the WebPageProxy in the UI process and provide a WebKit2 API to retrieve this information. * UIProcess/API/C/win/WKView.cpp: (WKViewIsPageOverlayInstalled): Added. * UIProcess/API/C/win/WKView.h: Added WKViewIsPageOverlayInstalled(). * UIProcess/PageClient.h: Added didInstallOrUninstallPageOverlay(). * UIProcess/WebPageProxy.h: Added didInstallOrUninstallPageOverlay(). * UIProcess/WebPageProxy.messages.in: Added DidInstallOrUninstallPageOverlay. * UIProcess/win/WebPageProxyWin.cpp: (WebKit::WebPageProxy::didInstallOrUninstallPageOverlay): Added. * UIProcess/win/WebView.cpp: (WebKit::WebView::WebView): Initialize m_pageOverlayInstalled. (WebKit::WebView::didInstallOrUninstallPageOverlay): Added. * UIProcess/win/WebView.h: Added didInstallOrUninstallPageOverlay() and m_pageOverlayInstalled. (WebKit::WebView::pageOverlayInstalled): Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::installPageOverlay): Send message to UI process to tell it the page overlay is installed. (WebKit::WebPage::uninstallPageOverlay): Send message to UI process to tell it the page overlay is uninstalled. 2011-05-10 Anders Carlsson Reviewed by Adam Roben. Remove incorrect ASSERTs from CoreIPC::Connection::processIncomingSyncReply https://bugs.webkit.org/show_bug.cgi?id=60567 It is possible to receive an incoming sync reply that is for a request we don't know about. This could happen if the sync message send timed out for example. * Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::processIncomingSyncReply): 2011-05-05 Brent Fulgham and Martin Robinson Reviewed by Anders Carlsson. [Cairo][WebKit2] Add an implementation of ShareableBitmap for Cairo https://bugs.webkit.org/show_bug.cgi?id=60293 * GNUmakefile.am: Remove ShareableBitmapGtk in favor of ShareableBitmapCairo. * Shared/ShareableBitmap.h: Added a couple Cairo-specific declarations. * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::createGraphicsContext): Added. (WebKit::ShareableBitmap::paint): Added. (WebKit::ShareableBitmap::createCairoSurface): Added. (WebKit::ShareableBitmap::releaseSurfaceData): Added. 2011-05-10 Anders Carlsson Reviewed by Sam Weinig. Extra sign in required to view video on MobileMe Gallery album https://bugs.webkit.org/show_bug.cgi?id=60560 Implement NPN_GetAuthenticationInfo. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::getAuthenticationInfo): Send a GetAuthenticationInfo message to the web process. * PluginProcess/PluginControllerProxy.h: * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::initializeProtectionSpace): Initialize a WebCore::ProtectionSpace object from NPAPI parameters. (WebKit::NPN_GetAuthenticationInfo): Make a ProtectionSpace object and then call NetscapePlugin::getAuthenticationInfo. Finally, copy the username/password and pass them back to the plug-in. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::getAuthenticationInfo): Call the plug-in controller. * WebProcess/Plugins/PluginController.h: Add getAuthenticationInfo pure virtual member function. * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::getAuthenticationInfo): Call the real plug-in controller's getAuthenticationInfo member function. * WebProcess/Plugins/PluginProxy.messages.in: Add GetAuthenticationInfo message. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::getAuthenticationInfo): Try to get the authentication info from the credential storage. Failing that, get it from the persistent credential storage. 2011-05-10 Adam Roben Use FontSmoothingLevelWindows by default on Windows Fixes REGRESSION (r86077): Web Inspector uses CG font rendering in WebKit2 on Windows Reviewed by Darin Adler. * Shared/WebPreferencesStore.h: Added and deployed a new DEFAULT_WEBKIT_FONT_SMOOTHING_LEVEL macro to let Windows have a different default font smoothing level from other platforms. * UIProcess/API/C/WKPreferencesPrivate.h: Updated the comment about the default font smoothing level. 2011-05-06 Tony Gentilcore Reviewed by Darin Adler. Fix some unnecessary includes in headers https://bugs.webkit.org/show_bug.cgi?id=60388 * WebProcess/FullScreen/WebFullScreenManager.cpp: 2011-05-09 Jeremy Noble Reviewed by Darin Adler. Command-~/Exposé to another window while