From: eric@webkit.org Date: Mon, 23 Nov 2009 22:55:22 +0000 (+0000) Subject: 2009-11-23 Steve Block X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=44f623e4a9c4d2ed33e7240d19b3bf135b189f1f;hp=4f28ead4e18cf5b8b9a485f5fdb3394d0c7165fa 2009-11-23 Steve Block Reviewed by Dmitry Titov. Adds MainThreadAndroid.cpp with Android-specific WTF threading functions. https://bugs.webkit.org/show_bug.cgi?id=31807 * wtf/android: Added. * wtf/android/MainThreadAndroid.cpp: Added. (WTF::timeoutFired): (WTF::initializeMainThreadPlatform): (WTF::scheduleDispatchFunctionsOnMainThread): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51323 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog index dd4493a11c3a..0188633d2c72 100644 --- a/JavaScriptCore/ChangeLog +++ b/JavaScriptCore/ChangeLog @@ -1,3 +1,16 @@ +2009-11-23 Steve Block + + Reviewed by Dmitry Titov. + + Adds MainThreadAndroid.cpp with Android-specific WTF threading functions. + https://bugs.webkit.org/show_bug.cgi?id=31807 + + * wtf/android: Added. + * wtf/android/MainThreadAndroid.cpp: Added. + (WTF::timeoutFired): + (WTF::initializeMainThreadPlatform): + (WTF::scheduleDispatchFunctionsOnMainThread): + 2009-11-23 Alexey Proskuryakov Reviewed by Brady Eidson. diff --git a/JavaScriptCore/wtf/android/MainThreadAndroid.cpp b/JavaScriptCore/wtf/android/MainThreadAndroid.cpp new file mode 100644 index 000000000000..c28f953b8745 --- /dev/null +++ b/JavaScriptCore/wtf/android/MainThreadAndroid.cpp @@ -0,0 +1,50 @@ +/* + * 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 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. + */ + +#include "config.h" +#include "MainThread.h" + +#include "JavaSharedClient.h" + +using namespace android; + +namespace WTF { + +// Callback in the main thread. +static void timeoutFired(void*) +{ + dispatchFunctionsFromMainThread(); +} + +void initializeMainThreadPlatform() +{ +} + +void scheduleDispatchFunctionsOnMainThread() +{ + JavaSharedClient::EnqueueFunctionPtr(timeoutFired, 0); +} + +} // namespace WTF