diff options
author | Ben Murdoch <benm@google.com> | 2010-05-18 12:40:50 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-05-21 10:18:18 +0100 |
commit | 7b52283c1a7f90ff5441d7bc30677c91af016b22 (patch) | |
tree | d7f831bcec87066d040c8d876bada22365719ada /WebKit/android/jni/WebCoreFrameBridge.cpp | |
parent | 92bec5fddeb29963e6b950dc26452b6976ff42e0 (diff) | |
download | external_webkit-7b52283c1a7f90ff5441d7bc30677c91af016b22.zip external_webkit-7b52283c1a7f90ff5441d7bc30677c91af016b22.tar.gz external_webkit-7b52283c1a7f90ff5441d7bc30677c91af016b22.tar.bz2 |
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
Diffstat (limited to 'WebKit/android/jni/WebCoreFrameBridge.cpp')
-rw-r--r-- | WebKit/android/jni/WebCoreFrameBridge.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index 9ecb121..d1efe07 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -320,19 +320,6 @@ static jobject createJavaMapFromHTTPHeaders(JNIEnv* env, const WebCore::HTTPHead return hashMap; } -// In WebViewCore.java, we artificially append the filename to the URI so that -// webkit treats the actual display name of the file as the filename, rather -// than the last segment of the URI (which will simply be a number). When we -// pass the URI up to BrowserFrame, we no longer need the appended name (in fact -// it causes problems), so remove it here. -// FIXME: If we rewrite pathGetFileName (the current version is in -// FileSystemPOSIX), we can get the filename that way rather than appending it. -static jstring uriFromUriFileName(JNIEnv* env, const WebCore::String& name) -{ - const WebCore::String fileName = name.left(name.reverseFind('/')); - return env->NewString(fileName.characters(), fileName.length()); -} - // This class stores the URI and the size of each file for upload. The URI is // stored so we do not have to create it again. The size is stored so we can // compare the actual size of the file with the stated size. If the actual size @@ -341,7 +328,7 @@ static jstring uriFromUriFileName(JNIEnv* env, const WebCore::String& name) class FileInfo { public: FileInfo(JNIEnv* env, const WebCore::String& name) { - m_uri = uriFromUriFileName(env, name); + m_uri = env->NewString(name.characters(), name.length()); checkException(env); m_size = 0; m_env = env; |