Changeset 112353 in webkit
- Timestamp:
- Mar 27, 2012 7:02:18 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r112347 r112353 1 2012-03-27 YoungTaeck Song <youngtaeck.song@samsung.com> 2 3 [EFL][WK2] Add RunLoopEfl and WorkQueueEfl 4 https://bugs.webkit.org/show_bug.cgi?id=62777 5 6 Reviewed by Hajime Morita. 7 8 Add initial version RunLoopEfl for WebKit2 Efl. 9 10 * platform/RunLoop.h: 11 (TimerBase): 12 (RunLoop): 13 * platform/efl/RunLoopEfl.cpp: 14 (WebCore::RunLoop::RunLoop): 15 (WebCore::RunLoop::~RunLoop): 16 (WebCore): 17 (WebCore::RunLoop::run): 18 (WebCore::RunLoop::stop): 19 (WebCore::RunLoop::wakeUpEvent): 20 (WebCore::RunLoop::wakeUp): 21 (WebCore::RunLoop::TimerBase::TimerBase): 22 (WebCore::RunLoop::TimerBase::~TimerBase): 23 (WebCore::RunLoop::TimerBase::timerFired): 24 (WebCore::RunLoop::TimerBase::start): 25 (WebCore::RunLoop::TimerBase::stop): 26 (WebCore::RunLoop::TimerBase::isActive): 27 1 28 2012-03-27 Benjamin Poulain <bpoulain@apple.com> 2 29 -
trunk/Source/WebCore/platform/RunLoop.h
r109161 r112353 38 38 #if PLATFORM(GTK) 39 39 #include <wtf/gobject/GRefPtr.h> 40 #endif 41 42 #if PLATFORM(EFL) 43 #include <Ecore.h> 40 44 #endif 41 45 … … 96 100 GRefPtr<GSource> m_timerSource; 97 101 gboolean m_isRepeating; 102 #elif PLATFORM(EFL) 103 static bool timerFired(void* data); 104 OwnPtr<Ecore_Timer> m_timer; 105 bool m_isRepeating; 98 106 #endif 99 107 }; … … 158 166 GRefPtr<GMainContext> m_runLoopContext; 159 167 Vector<GRefPtr<GMainLoop> > m_runLoopMainLoops; 168 #elif PLATFORM(EFL) 169 bool m_initEfl; 170 OwnPtr<Ecore_Pipe> m_pipe; 171 static void wakeUpEvent(void* data, void*, unsigned int); 160 172 #endif 161 173 }; -
trunk/Source/WebCore/platform/efl/RunLoopEfl.cpp
r109031 r112353 1 1 /* 2 2 * Copyright (C) 2012 ProFUSION embedded systems. All rights reserved. 3 * Copyright (C) 2012 Samsung Electronics 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 27 28 #include "RunLoop.h" 28 29 29 #include "NotImplemented.h" 30 #include <Ecore.h> 31 #include <Ecore_Evas.h> 32 #include <Ecore_File.h> 33 #include <Edje.h> 34 #include <wtf/OwnPtr.h> 35 #include <wtf/PassOwnPtr.h> 36 37 static const int ecorePipeMessageSize = 1; 38 static const char wakupEcorePipeMessage[] = "W"; 30 39 31 40 namespace WebCore { 32 41 33 42 RunLoop::RunLoop() 43 : m_initEfl(false) 34 44 { 35 notImplemented(); 45 if (!ecore_init()) { 46 LOG_ERROR("could not init ecore."); 47 return; 48 } 49 50 if (!ecore_evas_init()) { 51 LOG_ERROR("could not init ecore_evas."); 52 goto errorEcoreEvas; 53 } 54 55 if (!ecore_file_init()) { 56 LOG_ERROR("could not init ecore_file."); 57 goto errorEcoreFile; 58 } 59 60 if (!edje_init()) { 61 LOG_ERROR("could not init edje."); 62 goto errorEdje; 63 } 64 65 m_pipe = adoptPtr(ecore_pipe_add(wakeUpEvent, this)); 66 m_initEfl = true; 67 68 return; 69 70 errorEdje: 71 ecore_file_shutdown(); 72 errorEcoreFile: 73 ecore_evas_shutdown(); 74 errorEcoreEvas: 75 ecore_shutdown(); 36 76 } 37 77 38 78 RunLoop::~RunLoop() 39 79 { 40 notImplemented(); 80 if (m_initEfl) { 81 edje_shutdown(); 82 ecore_file_shutdown(); 83 ecore_evas_shutdown(); 84 ecore_shutdown(); 85 } 86 } 87 88 void RunLoop::run() 89 { 90 ecore_main_loop_begin(); 91 } 92 93 void RunLoop::stop() 94 { 95 ecore_main_loop_quit(); 96 } 97 98 void RunLoop::wakeUpEvent(void* data, void*, unsigned int) 99 { 100 static_cast<RunLoop*>(data)->performWork(); 41 101 } 42 102 43 103 void RunLoop::wakeUp() 44 104 { 45 notImplemented(); 105 ecore_pipe_write(m_pipe.get(), wakupEcorePipeMessage, ecorePipeMessageSize); 106 } 107 108 RunLoop::TimerBase::TimerBase(RunLoop*) 109 : m_isRepeating(false) 110 { 111 } 112 113 RunLoop::TimerBase::~TimerBase() 114 { 115 stop(); 116 } 117 118 bool RunLoop::TimerBase::timerFired(void* data) 119 { 120 RunLoop::TimerBase* timer = static_cast<RunLoop::TimerBase*>(data); 121 122 timer->fired(); 123 124 if (!timer->m_isRepeating) { 125 timer->m_timer = nullptr; 126 return ECORE_CALLBACK_CANCEL; 127 } 128 129 return ECORE_CALLBACK_RENEW; 130 } 131 132 void RunLoop::TimerBase::start(double nextFireInterval, bool repeat) 133 { 134 m_isRepeating = repeat; 135 m_timer = adoptPtr(ecore_timer_add(nextFireInterval, reinterpret_cast<Ecore_Task_Cb>(timerFired), this)); 136 } 137 138 void RunLoop::TimerBase::stop() 139 { 140 m_timer = nullptr; 141 } 142 143 bool RunLoop::TimerBase::isActive() const 144 { 145 return (m_timer) ? true : false; 46 146 } 47 147 -
trunk/Source/WebKit2/ChangeLog
r112338 r112353 1 2012-03-27 YoungTaeck Song <youngtaeck.song@samsung.com> 2 3 [EFL][WK2] Add RunLoopEfl and WorkQueueEfl 4 https://bugs.webkit.org/show_bug.cgi?id=62777 5 6 Reviewed by Hajime Morita. 7 8 Add initial version WorkQueueEfl for WebKit2 Efl. 9 10 * Platform/CoreIPC/Connection.h: 11 * Platform/CoreIPC/unix/ConnectionUnix.cpp: 12 (CoreIPC::Connection::platformInvalidate): 13 (CoreIPC::Connection::open): 14 * Platform/PlatformProcessIdentifier.h: 15 (WebKit): 16 * Platform/WorkQueue.h: 17 (WorkQueue): 18 * Platform/efl/WorkQueueEfl.cpp: Added. 19 (TimerWorkItem): 20 (TimerWorkItem::TimerWorkItem): 21 (TimerWorkItem::~TimerWorkItem): 22 (TimerWorkItem::function): 23 (TimerWorkItem::queue): 24 (TimerWorkItem::timerID): 25 (WorkQueue::platformInitialize): 26 (WorkQueue::platformInvalidate): 27 (WorkQueue::performWork): 28 (WorkQueue::performFdWork): 29 (WorkQueue::sendMessageToThread): 30 (WorkQueue::workQueueThread): 31 (WorkQueue::registerSocketEventHandler): 32 (WorkQueue::unregisterSocketEventHandler): 33 (WorkQueue::dispatch): 34 (WorkQueue::timerFired): 35 (WorkQueue::dispatchAfterDelay): 36 * PlatformEfl.cmake: 37 1 38 2012-03-27 Anders Carlsson <andersca@apple.com> 2 39 -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.h
r105475 r112353 47 47 #endif 48 48 49 #if PLATFORM(QT) || PLATFORM(GTK) 49 #if PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL) 50 50 #include "PlatformProcessIdentifier.h" 51 51 #endif -
trunk/Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp
r103178 r112353 154 154 #endif 155 155 156 #if PLATFORM(EFL) 157 m_connectionQueue.unregisterSocketEventHandler(m_socketDescriptor); 158 #endif 159 156 160 m_socketDescriptor = -1; 157 161 m_isConnected = false; … … 424 428 m_connectionQueue.registerEventSourceHandler(m_socketDescriptor, (G_IO_HUP | G_IO_ERR), bind(&Connection::connectionDidClose, this)); 425 429 m_connectionQueue.registerEventSourceHandler(m_socketDescriptor, G_IO_IN, bind(&Connection::readyReadHandler, this)); 430 #elif PLATFORM(EFL) 431 m_connectionQueue.registerSocketEventHandler(m_socketDescriptor, bind(&Connection::readyReadHandler, this)); 426 432 #endif 427 433 -
trunk/Source/WebKit2/Platform/PlatformProcessIdentifier.h
r95901 r112353 47 47 #endif 48 48 typedef GPid PlatformProcessIdentifier; 49 #elif PLATFORM(EFL) 50 typedef pid_t PlatformProcessIdentifier; 49 51 #endif 50 52 -
trunk/Source/WebKit2/Platform/WorkQueue.h
r109129 r112353 42 42 #include <wtf/Vector.h> 43 43 44 #if (PLATFORM(QT) && !OS(DARWIN)) || PLATFORM(GTK) || PLATFORM(EFL) 45 #include "PlatformProcessIdentifier.h" 46 #endif 47 44 48 #if PLATFORM(QT) && !OS(DARWIN) 45 49 #include <QSocketNotifier> 46 #include "PlatformProcessIdentifier.h"47 50 class QObject; 48 51 class QThread; 49 52 #elif PLATFORM(GTK) 50 #include "PlatformProcessIdentifier.h"51 53 #include <wtf/gobject/GRefPtr.h> 52 54 typedef gboolean (*GSourceFunc) (gpointer data); 55 #elif PLATFORM(EFL) 56 #include <Ecore.h> 53 57 #endif 54 58 … … 91 95 void unregisterEventSourceHandler(int); 92 96 void dispatchOnTermination(WebKit::PlatformProcessIdentifier, const Function<void()>&); 97 #elif PLATFORM(EFL) 98 void registerSocketEventHandler(int, const Function<void()>&); 99 void unregisterSocketEventHandler(int); 93 100 #endif 94 101 … … 178 185 HashMap<int, Vector<EventSource*> > m_eventSources; 179 186 typedef HashMap<int, Vector<EventSource*> >::iterator EventSourceIterator; 187 #elif PLATFORM(EFL) 188 fd_set m_fileDescriptorSet; 189 int m_maxFileDescriptor; 190 int m_readFromPipeDescriptor; 191 int m_writeToPipeDescriptor; 192 bool m_threadLoop; 193 194 Vector<Function<void()> > m_workItemQueue; 195 Mutex m_workItemQueueLock; 196 197 int m_socketDescriptor; 198 Function<void()> m_socketEventHandler; 199 200 HashMap<int, OwnPtr<Ecore_Timer> > m_timers; 201 202 void sendMessageToThread(const char*); 203 static void* workQueueThread(WorkQueue*); 204 void performWork(); 205 void performFileDescriptorWork(); 206 static bool timerFired(void*); 180 207 #endif 181 208 }; -
trunk/Source/WebKit2/PlatformEfl.cmake
r107747 r112353 8 8 LIST(APPEND WebKit2_SOURCES 9 9 Platform/efl/ModuleEfl.cpp 10 Platform/efl/RunLoopEfl.cpp11 10 Platform/efl/WorkQueueEfl.cpp 12 11 Platform/unix/SharedMemoryUnix.cpp
Note: See TracChangeset
for help on using the changeset viewer.