summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/android
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/android')
-rw-r--r--WebCore/platform/android/FileChooserAndroid.cpp5
-rw-r--r--WebCore/platform/android/FileSystemAndroid.cpp31
-rw-r--r--WebCore/platform/android/SharedTimerAndroid.cpp4
-rw-r--r--WebCore/platform/android/SoundAndroid.cpp36
-rw-r--r--WebCore/platform/android/SystemTimeAndroid.cpp28
-rw-r--r--WebCore/platform/android/TemporaryLinkStubs.cpp49
6 files changed, 100 insertions, 53 deletions
diff --git a/WebCore/platform/android/FileChooserAndroid.cpp b/WebCore/platform/android/FileChooserAndroid.cpp
index 2c75373..a8c4150 100644
--- a/WebCore/platform/android/FileChooserAndroid.cpp
+++ b/WebCore/platform/android/FileChooserAndroid.cpp
@@ -31,7 +31,10 @@
namespace WebCore {
String FileChooser::basenameForWidth(const Font& font, int width) const
-{
+{
+ if (m_filenames.size() == 0) {
+ return String();
+ }
// FIXME: This could be a lot faster, but assuming the data will not
// often be much longer than the provided width, this may be fast enough.
String output = m_filenames[0].copy();
diff --git a/WebCore/platform/android/FileSystemAndroid.cpp b/WebCore/platform/android/FileSystemAndroid.cpp
index b6d58bc..fcb0413 100644
--- a/WebCore/platform/android/FileSystemAndroid.cpp
+++ b/WebCore/platform/android/FileSystemAndroid.cpp
@@ -29,7 +29,9 @@
#include "FileSystem.h"
#include "CString.h"
+#include <fnmatch.h>
#include <dlfcn.h>
+#include <dirent.h>
#include <errno.h>
#include <sys/stat.h>
#include "cutils/log.h"
@@ -98,4 +100,33 @@ String homeDirectoryPath()
return sPluginPath;
}
+// new as of webkit4, Feb 28, 2009
+Vector<String> listDirectory(const String& path, const String& filter)
+{
+ Vector<String> entries;
+ CString cpath = path.utf8();
+ CString cfilter = filter.utf8();
+ DIR* dir = opendir(cpath.data());
+ if (dir) {
+ struct dirent * dp;
+ while ((dp = readdir(dir)) != NULL) {
+ const char* name = dp->d_name;
+ if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) {
+ continue;
+ }
+ if (fnmatch(cfilter.data(), name, 0) != 0) {
+ continue;
+ }
+ char filePath[1024];
+ if ((int) (sizeof(filePath) - 1) < snprintf(filePath,
+ sizeof(filePath), "%s/%s", cpath.data(), name)) {
+ continue; // buffer overflow
+ }
+ entries.append(filePath);
+ }
+ closedir(dir);
+ }
+ return entries;
+}
+
}
diff --git a/WebCore/platform/android/SharedTimerAndroid.cpp b/WebCore/platform/android/SharedTimerAndroid.cpp
index d797cfb..3ff9705 100644
--- a/WebCore/platform/android/SharedTimerAndroid.cpp
+++ b/WebCore/platform/android/SharedTimerAndroid.cpp
@@ -27,10 +27,10 @@
#include "config.h"
#include "SharedTimer.h"
-#include "SystemTime.h"
#include "JavaSharedClient.h"
#include "TimerClient.h"
#include <utils/Log.h>
+#include <wtf/CurrentTime.h>
using namespace android;
@@ -48,7 +48,7 @@ void setSharedTimerFiredFunction(void (*f)())
// as the result of currentTime() is.
void setSharedTimerFireTime(double fireTime)
{
- long long timeInMS = (long long)((fireTime - currentTime()) * 1000);
+ long long timeInMS = (long long)((fireTime - WTF::currentTime()) * 1000);
LOGV("setSharedTimerFireTime: in %ld millisec", timeInMS);
if (JavaSharedClient::GetTimerClient())
diff --git a/WebCore/platform/android/SoundAndroid.cpp b/WebCore/platform/android/SoundAndroid.cpp
new file mode 100644
index 0000000..50cbfa5
--- /dev/null
+++ b/WebCore/platform/android/SoundAndroid.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2009, 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 APPLE COMPUTER, INC. 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.
+ */
+
+#include "config.h"
+#include "Sound.h"
+
+namespace WebCore {
+
+void systemBeep()
+{
+ // do nothing
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/android/SystemTimeAndroid.cpp b/WebCore/platform/android/SystemTimeAndroid.cpp
index 9ac32dc..a9c862a 100644
--- a/WebCore/platform/android/SystemTimeAndroid.cpp
+++ b/WebCore/platform/android/SystemTimeAndroid.cpp
@@ -26,34 +26,12 @@
#include "config.h"
#include "SystemTime.h"
-#include <sys/time.h>
-
namespace WebCore {
-double currentTime()
-{
- struct timeval tv;
-
- gettimeofday(&tv, (struct timezone *) NULL);
- double now = tv.tv_sec + (tv.tv_usec / 1000000.0);
-
- return now;
-}
-
-uint32_t get_thread_msec()
+float userIdleTime()
{
-#if defined(HAVE_POSIX_CLOCKS)
- struct timespec tm;
-
- clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tm);
-
- return tm.tv_sec * 1000LL + tm.tv_nsec / 1000000;
-#else
- struct timeval tv;
-
- gettimeofday(&tv, NULL);
- return tv.tv_sec * 1000LL + tv.tv_usec / 1000;
-#endif
+ // Needed for PageCache, which we currently have disabled.
+ return 0.0F;
}
} // namespace WebCore
diff --git a/WebCore/platform/android/TemporaryLinkStubs.cpp b/WebCore/platform/android/TemporaryLinkStubs.cpp
index 01789f4..5d71dd0 100644
--- a/WebCore/platform/android/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/android/TemporaryLinkStubs.cpp
@@ -424,6 +424,12 @@ String contextMenuItemTagRightToLeft()
return String();
}
+String contextMenuItemTagTextDirectionMenu()
+{
+ ASSERT(0);
+ return String();
+}
+
} // namespace WebCore
// FIXME, no support for spelling yet.
@@ -601,14 +607,6 @@ void ContextMenuItem::setEnabled(bool)
notImplemented();
}
-namespace WebCore {
-
-float userIdleTime()
-{
- notImplemented();
- return 0;
-}
-
// systemBeep() is called by the Editor to indicate that there was nothing to copy, and may be called from
// other places too.
void systemBeep()
@@ -616,8 +614,6 @@ void systemBeep()
notImplemented();
}
-}
-
// functions new to Jun-07 tip of tree merge:
// void WebCore::CachedPage::close() {}
@@ -750,14 +746,14 @@ PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String&)
namespace JSC { namespace Bindings {
-bool dispatchJNICall(ExecState*, void const*, _jobject*, bool, JNIType,
- _jmethodID*, jvalue*, jvalue&, char const*, JSValue*&)
+bool dispatchJNICall(ExecState*, const void* targetAppletView, jobject obj, bool isStatic, JNIType returnType,
+ jmethodID methodID, jvalue* args, jvalue& result, const char* callingURL, JSValuePtr& exceptionDescription)
{
notImplemented();
return false;
}
-} } // namespace JSC::Bindings
+} } // namespace Bindings
char* dirname(const char*)
{
@@ -811,12 +807,6 @@ ScrollbarTheme* ScrollbarTheme::nativeTheme()
return &theme;
}
-JSC::JSValue* toJS(JSC::ExecState*, JSC::Profile*)
-{
- notImplemented();
- return 0;
-}
-
} // namespace WebCore
FileList::FileList()
@@ -862,30 +852,38 @@ OpaqueJSClassContextData::~OpaqueJSClassContextData()
notImplemented();
}
+// as we don't use inspector/*.cpp, add stub here.
+
namespace WebCore {
-JSC::JSValue* JavaScriptCallFrame::evaluate(JSC::UString const&, JSC::JSValue*&) const
+JSValuePtr toJS(ExecState*, Profile*)
{
notImplemented();
- return 0;
+ return jsNull();
+}
+
+JSValuePtr JavaScriptCallFrame::evaluate(const UString& script, JSValuePtr& exception) const
+{
+ notImplemented();
+ return jsNull();
}
-const JSC::ScopeChainNode* JavaScriptCallFrame::scopeChain() const
+const ScopeChainNode* JavaScriptCallFrame::scopeChain() const
{
notImplemented();
return 0;
}
-JSC::JSObject* JavaScriptCallFrame::thisObject() const
+JSObject* JavaScriptCallFrame::thisObject() const
{
notImplemented();
return 0;
}
-JSC::DebuggerCallFrame::Type JavaScriptCallFrame::type() const
+DebuggerCallFrame::Type JavaScriptCallFrame::type() const
{
notImplemented();
- return (JSC::DebuggerCallFrame::Type) 0;
+ return (DebuggerCallFrame::Type) 0;
}
JavaScriptCallFrame* JavaScriptCallFrame::caller()
@@ -899,6 +897,7 @@ String JavaScriptCallFrame::functionName() const
notImplemented();
return String();
}
+
}
JavaScriptDebugServer::JavaScriptDebugServer() :