2011-04-08 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Apr 2011 00:04:50 +0000 (00:04 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Apr 2011 00:04:50 +0000 (00:04 +0000)
commitae4e921596c12927a2b1282ba9b9f6a523a38840
tree9c50443865bbcfe51aa7208b7b6f4322f1643e4f
parentbb40aeb2358232b25d3f1caa687b979c62b63be6
2011-04-08  Anders Carlsson  <andersca@apple.com>

        Reviewed by Dan Bernstein.

        Sandboxing doesn't work if a local file is dropped on the content area
        https://bugs.webkit.org/show_bug.cgi?id=58177
        <rdar://problem/9019253>

        When performing a drag and the dragging pasteboard contains a local file, create a
        sandbox extension and pass it along. If we end up loading the file, the sandbox extension
        tracker will consume the extension.

        * UIProcess/API/mac/WKView.mm:
        (maybeCreateSandboxExtensionFromPasteboard):
        Add helper function.

        (-[WKView performDragOperation:]):
        Create a sandbox extension handle and pass it to performDrag.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dragEntered):
        (WebKit::WebPageProxy::dragUpdated):
        (WebKit::WebPageProxy::dragExited):
        Pass an empty sandbox extension handle to performDragControllerAction.

        (WebKit::WebPageProxy::performDrag):
        Pass the sandbox extension handle along to performDragControllerAction.

        (WebKit::WebPageProxy::performDragControllerAction):
        Send along the sandbox extension handle.

        * WebProcess/WebCoreSupport/WebDragClient.cpp:
        (WebKit::WebDragClient::willPerformDragDestinationAction):
        If the destination action is a load action, call WebPage::willPerformLoadDragDestinationAction.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::performDragControllerAction):
        Create a sandbox extension.

        (WebKit::WebPage::willPerformLoadDragDestinationAction):
        If we have a sandbox extension, pass it along to the sandbox extension tracker.

        (WebKit::WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction):
        Call setPendingProvisionalSandboxExtension.

        (WebKit::WebPage::SandboxExtensionTracker::beginLoad):
        Call setPendingProvisionalSandboxExtension.

        (WebKit::WebPage::SandboxExtensionTracker::setPendingProvisionalSandboxExtension):
        Factor code from beginLoad out into a separate function.

        * WebProcess/WebPage/WebPage.messages.in:
        PerformDragControllerAction now takes a sandbox extension handle.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in