diff options
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/Android.derived.jscbindings.mk | 2 | ||||
-rw-r--r-- | WebCore/Android.derived.v8bindings.mk | 2 | ||||
-rw-r--r-- | WebCore/Android.mk | 4 | ||||
-rw-r--r-- | WebCore/config.h | 4 | ||||
-rw-r--r-- | WebCore/html/FileStream.cpp | 2 | ||||
-rw-r--r-- | WebCore/platform/android/FileSystemAndroid.cpp | 18 | ||||
-rw-r--r-- | WebCore/platform/android/PlatformBridge.h | 2 | ||||
-rw-r--r-- | WebCore/platform/posix/FileSystemPOSIX.cpp | 7 |
8 files changed, 31 insertions, 10 deletions
diff --git a/WebCore/Android.derived.jscbindings.mk b/WebCore/Android.derived.jscbindings.mk index 70ef7cd..001472e 100644 --- a/WebCore/Android.derived.jscbindings.mk +++ b/WebCore/Android.derived.jscbindings.mk @@ -49,7 +49,7 @@ js_binding_scripts := $(addprefix $(LOCAL_PATH)/,\ bindings/scripts/generate-bindings.pl \ ) -FEATURE_DEFINES := ENABLE_ORIENTATION_EVENTS=1 ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_GEOLOCATION=1 ENABLE_CONNECTION=1 ENABLE_APPLICATION_INSTALLED=1 ENABLE_XPATH=1 ENABLE_XSLT=1 ENABLE_DEVICE_ORIENTATION=1 +FEATURE_DEFINES := ENABLE_ORIENTATION_EVENTS=1 ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_GEOLOCATION=1 ENABLE_CONNECTION=1 ENABLE_APPLICATION_INSTALLED=1 ENABLE_XPATH=1 ENABLE_XSLT=1 ENABLE_DEVICE_ORIENTATION=1 ENABLE_FILE_READER=1 ENABLE_BLOB_SLICE=1 # CSS GEN := \ diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk index 4b06dd2..4788f00 100644 --- a/WebCore/Android.derived.v8bindings.mk +++ b/WebCore/Android.derived.v8bindings.mk @@ -32,7 +32,7 @@ js_binding_scripts := \ # Add ACCELERATED_COMPOSITING=1 and ENABLE_3D_RENDERING=1 for layers support FEATURE_DEFINES := ENABLE_ORIENTATION_EVENTS=1 ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_GEOLOCATION=1 ENABLE_CONNECTION=1 ENABLE_APPLICATION_INSTALLED=1 ENABLE_XPATH=1 ENABLE_XSLT=1 ENABLE_DEVICE_ORIENTATION=1 -FEATURE_DEFINES += V8_BINDING +FEATURE_DEFINES += V8_BINDING ENABLE_FILE_READER=1 ENABLE_BLOB_SLICE=1 # CSS GEN := \ diff --git a/WebCore/Android.mk b/WebCore/Android.mk index 98b7b16..373c70f 100644 --- a/WebCore/Android.mk +++ b/WebCore/Android.mk @@ -253,6 +253,9 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ html/File.cpp \ html/FileList.cpp \ html/FileReader.cpp \ + html/FileStream.cpp \ + html/FileStreamProxy.cpp \ + html/FileThread.cpp \ html/FormDataList.cpp \ html/HTML5Lexer.cpp \ html/HTML5Tokenizer.cpp \ @@ -408,6 +411,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ platform/ThreadGlobalData.cpp \ platform/ThreadTimers.cpp \ platform/Timer.cpp \ + platform/UUID.cpp \ platform/Widget.cpp \ \ platform/android/ClipboardAndroid.cpp \ diff --git a/WebCore/config.h b/WebCore/config.h index 6fa0c73..48f9543 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -130,6 +130,9 @@ #undef ENABLE_COMPOSITED_FIXED_ELEMENTS // Disabled by default in Platform.h #define ENABLE_COMPOSITED_FIXED_ELEMENTS 1 +#define ENABLE_FILE_READER 1 +#define ENABLE_BLOB_SLICE 1 + #define ANDROID_FLATTEN_FRAMESET #define ANDROID_FLATTEN_IFRAME @@ -200,6 +203,7 @@ // Enable hit test with point plus a size #define ANDROID_HITTEST_WITHSIZE + #endif /* PLATFORM(ANDROID) */ #ifdef __cplusplus diff --git a/WebCore/html/FileStream.cpp b/WebCore/html/FileStream.cpp index 7089f61..9a06eed 100644 --- a/WebCore/html/FileStream.cpp +++ b/WebCore/html/FileStream.cpp @@ -111,7 +111,7 @@ void FileStream::openForRead(Blob* blob) if (m_totalBytesToRead == Blob::toEndOfFile) m_totalBytesToRead = blob->size() - blob->start(); #else - m_total = blob->size(); + m_totalBytesToRead = blob->size(); #endif m_client->didGetSize(m_totalBytesToRead); diff --git a/WebCore/platform/android/FileSystemAndroid.cpp b/WebCore/platform/android/FileSystemAndroid.cpp index cf9830e..3513958 100644 --- a/WebCore/platform/android/FileSystemAndroid.cpp +++ b/WebCore/platform/android/FileSystemAndroid.cpp @@ -46,6 +46,12 @@ String sPluginPath; CString fileSystemRepresentation(const String& path) { + // If the path is a content:// URI then ask Java to resolve it for us. + if (path.startsWith("content://")) + return PlatformBridge::resolveFilePathForContentUri(path).utf8(); + else if (path.startsWith("file://")) + return path.substring(strlen("file://")).utf8(); + return path.utf8(); } @@ -107,13 +113,15 @@ Vector<String> listDirectory(const String& path, const String& filter) return entries; } +// We define our own pathGetFileName rather than use the POSIX versions as we +// may get passed a content URI representing the path to the file. We pass +// the input through fileSystemRepresentation before using it to resolve it if +// it is a content URI. String pathGetFileName(const String& path) { - // If the path is a content:// URI then ask Java to resolve it for us. - if (path.startsWith("content://")) - return PlatformBridge::resolveFileNameForContentUri(path); - else - return path.substring(path.reverseFind('/') + 1); + CString fsRep = fileSystemRepresentation(path); + String fsPath = String(fsRep.data()); + return fsPath.substring(fsPath.reverseFind('/') + 1); } diff --git a/WebCore/platform/android/PlatformBridge.h b/WebCore/platform/android/PlatformBridge.h index 64984db..80aada6 100644 --- a/WebCore/platform/android/PlatformBridge.h +++ b/WebCore/platform/android/PlatformBridge.h @@ -136,7 +136,7 @@ public: static bool isWebViewPaused(const FrameView*); static bool canScroll(const FrameView*); - static String resolveFileNameForContentUri(const String&); + static String resolveFilePathForContentUri(const String&); }; } diff --git a/WebCore/platform/posix/FileSystemPOSIX.cpp b/WebCore/platform/posix/FileSystemPOSIX.cpp index b7fcd71..c035310 100644 --- a/WebCore/platform/posix/FileSystemPOSIX.cpp +++ b/WebCore/platform/posix/FileSystemPOSIX.cpp @@ -75,12 +75,17 @@ bool deleteFile(const String& path) PlatformFileHandle openFile(const String& path, FileOpenMode mode) { + CString fsRep = fileSystemRepresentation(path); + + if (fsRep.isNull()) + return invalidPlatformFileHandle; + int platformFlag = 0; if (mode == OpenForRead) platformFlag |= O_RDONLY; else if (mode == OpenForWrite) platformFlag |= (O_WRONLY | O_CREAT | O_TRUNC); - return open(path.utf8().data(), platformFlag, 0666); + return open(fsRep.data(), platformFlag, 0666); } void closeFile(PlatformFileHandle& handle) |