From 7b52283c1a7f90ff5441d7bc30677c91af016b22 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 18 May 2010 12:40:50 +0100 Subject: Add a method to the PlatformBridge to resolve the filename of a file given its representation as a content:// URI, and the associated JNI plumbing. Requires a frameworks/base change. Change-Id: I9b8b8bb3fbfa31c86f4212f91c140fe62c6c6682 --- WebKit/android/WebCoreSupport/FileSystemClient.h | 41 ++++++++++++++++++++++++ WebKit/android/WebCoreSupport/PlatformBridge.cpp | 7 ++++ 2 files changed, 48 insertions(+) create mode 100644 WebKit/android/WebCoreSupport/FileSystemClient.h (limited to 'WebKit/android/WebCoreSupport') diff --git a/WebKit/android/WebCoreSupport/FileSystemClient.h b/WebKit/android/WebCoreSupport/FileSystemClient.h new file mode 100644 index 0000000..8847bda --- /dev/null +++ b/WebKit/android/WebCoreSupport/FileSystemClient.h @@ -0,0 +1,41 @@ +/* + * Copyright 2010, The Android Open Source Project + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER 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 FILESYSTEM_CLIENT_H +#define FILESYSTEM_CLIENT_H + +#include "PlatformString.h" + +using namespace WebCore; + +namespace android { + +class FileSystemClient { +public: + virtual ~FileSystemClient() { } + virtual String resolveFileNameForContentUri(const String&) = 0; +}; +} +#endif diff --git a/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/WebKit/android/WebCoreSupport/PlatformBridge.cpp index 13bbf38..c64bb9d 100644 --- a/WebKit/android/WebCoreSupport/PlatformBridge.cpp +++ b/WebKit/android/WebCoreSupport/PlatformBridge.cpp @@ -27,6 +27,7 @@ #include #include "CookieClient.h" +#include "FileSystemClient.h" #include "FrameView.h" #include "JavaSharedClient.h" #include "KeyGeneratorClient.h" @@ -153,6 +154,12 @@ bool PlatformBridge::popupsAllowed(NPP) return false; } +String PlatformBridge::resolveFileNameForContentUri(const String& contentUri) +{ + FileSystemClient* client = JavaSharedClient::GetFileSystemClient(); + return client->resolveFileNameForContentUri(contentUri); +} + } // namespace WebCore -- cgit v1.1