#ifndef LayerMessage_h
#define LayerMessage_h
#include <BlackBerryPlatformExecutableMessage.h>
#include <BlackBerryPlatformMessage.h>
#include <BlackBerryPlatformMessageClient.h>
typedef BlackBerry::Platform::Message PlatformMessage;
namespace WebCore {
inline bool isCompositingThread()
{
return BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread();
}
inline pthread_t compositingThread()
{
return BlackBerry::Platform::userInterfaceThreadMessageClient()->threadIdentifier();
}
inline bool isWebKitThread()
{
return BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread();
}
inline pthread_t webKitThread()
{
return BlackBerry::Platform::webKitThreadMessageClient()->threadIdentifier();
}
inline void dispatchCompositingMessage(PlatformMessage* msg)
{
BlackBerry::Platform::userInterfaceThreadMessageClient()->dispatchMessage(msg);
}
inline void dispatchSyncCompositingMessage(PlatformMessage* msg)
{
BlackBerry::Platform::userInterfaceThreadMessageClient()->dispatchSyncMessage(msg);
}
enum PlatformMessagePriority { PlatformMessagePriorityLow = -1, PlatformMessagePriorityNormal = 0, PlatformMessagePriorityHigh = 1 };
inline void dispatchWebKitMessage(PlatformMessage* msg, PlatformMessagePriority priority = PlatformMessagePriorityNormal)
{
if (priority != PlatformMessagePriorityNormal)
msg->setPriority(BlackBerry::Platform::webKitThreadMessageClient()->threadPriority() + priority);
BlackBerry::Platform::webKitThreadMessageClient()->dispatchMessage(msg);
}
}
#endif // LayerMessage_h