Changeset 37556 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 13, 2008, 4:44:35 AM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37553 r37556 1 2008-10-13 Marco Barisione <[email protected]> 2 3 Reviewed by Darin Adler. Landed by Jan Alonzo. 4 5 WebKit GTK Port needs a smartpointer to handle g_free (GFreePtr?) 6 http://bugs.webkit.org/show_bug.cgi?id=20483 7 8 Add a GOwnPtr smart pointer (similar to OwnPtr) to handle memory 9 allocated by GLib and start the conversion to use it. 10 11 * GNUmakefile.am: 12 * wtf/GOwnPtr.cpp: Added. 13 (WTF::GError): 14 (WTF::GList): 15 (WTF::GCond): 16 (WTF::GMutex): 17 (WTF::GPatternSpec): 18 (WTF::GDir): 19 * wtf/GOwnPtr.h: Added. 20 (WTF::freeOwnedPtr): 21 (WTF::GOwnPtr::GOwnPtr): 22 (WTF::GOwnPtr::~GOwnPtr): 23 (WTF::GOwnPtr::get): 24 (WTF::GOwnPtr::release): 25 (WTF::GOwnPtr::rawPtr): 26 (WTF::GOwnPtr::set): 27 (WTF::GOwnPtr::clear): 28 (WTF::GOwnPtr::operator*): 29 (WTF::GOwnPtr::operator->): 30 (WTF::GOwnPtr::operator!): 31 (WTF::GOwnPtr::operator UnspecifiedBoolType): 32 (WTF::GOwnPtr::swap): 33 (WTF::swap): 34 (WTF::operator==): 35 (WTF::operator!=): 36 (WTF::getPtr): 37 * wtf/Threading.h: 38 * wtf/ThreadingGtk.cpp: 39 (WTF::Mutex::~Mutex): 40 (WTF::Mutex::lock): 41 (WTF::Mutex::tryLock): 42 (WTF::Mutex::unlock): 43 (WTF::ThreadCondition::~ThreadCondition): 44 (WTF::ThreadCondition::wait): 45 (WTF::ThreadCondition::timedWait): 46 (WTF::ThreadCondition::signal): 47 (WTF::ThreadCondition::broadcast): 48 1 49 2008-10-12 Gabriella Toth <[email protected]> 2 50 -
trunk/JavaScriptCore/GNUmakefile.am
r37457 r37556 241 241 JavaScriptCore/wtf/Forward.h \ 242 242 JavaScriptCore/wtf/GetPtr.h \ 243 JavaScriptCore/wtf/GOwnPtr.cpp \ 244 JavaScriptCore/wtf/GOwnPtr.h \ 243 245 JavaScriptCore/wtf/HashCountedSet.h \ 244 246 JavaScriptCore/wtf/HashFunctions.h \ -
trunk/JavaScriptCore/wtf/Threading.h
r37409 r37556 63 63 #include <wtf/Locker.h> 64 64 #include <wtf/Noncopyable.h> 65 #if PLATFORM(GTK) 66 #include <wtf/GOwnPtr.h> 67 #endif 65 68 66 69 #if PLATFORM(WIN_OS) … … 118 121 typedef pthread_cond_t PlatformCondition; 119 122 #elif PLATFORM(GTK) 120 typedef G Mutex*PlatformMutex;121 typedef G Cond*PlatformCondition;123 typedef GOwnPtr<GMutex> PlatformMutex; 124 typedef GOwnPtr<GCond> PlatformCondition; 122 125 #elif PLATFORM(QT) 123 126 typedef QT_PREPEND_NAMESPACE(QMutex)* PlatformMutex; -
trunk/JavaScriptCore/wtf/ThreadingGtk.cpp
r36846 r37556 158 158 Mutex::~Mutex() 159 159 { 160 g_mutex_free(m_mutex);161 160 } 162 161 163 162 void Mutex::lock() 164 163 { 165 g_mutex_lock(m_mutex );164 g_mutex_lock(m_mutex.get()); 166 165 } 167 166 168 167 bool Mutex::tryLock() 169 168 { 170 return g_mutex_trylock(m_mutex );169 return g_mutex_trylock(m_mutex.get()); 171 170 } 172 171 173 172 void Mutex::unlock() 174 173 { 175 g_mutex_unlock(m_mutex );174 g_mutex_unlock(m_mutex.get()); 176 175 } 177 176 … … 183 182 ThreadCondition::~ThreadCondition() 184 183 { 185 g_cond_free(m_condition);186 184 } 187 185 188 186 void ThreadCondition::wait(Mutex& mutex) 189 187 { 190 g_cond_wait(m_condition , mutex.impl());188 g_cond_wait(m_condition.get(), mutex.impl().get()); 191 189 } 192 190 … … 211 209 } 212 210 213 return g_cond_timed_wait(m_condition , mutex.impl(), &targetTime);211 return g_cond_timed_wait(m_condition.get(), mutex.impl().get(), &targetTime); 214 212 } 215 213 216 214 void ThreadCondition::signal() 217 215 { 218 g_cond_signal(m_condition );216 g_cond_signal(m_condition.get()); 219 217 } 220 218 221 219 void ThreadCondition::broadcast() 222 220 { 223 g_cond_broadcast(m_condition );224 } 225 226 227 } 221 g_cond_broadcast(m_condition.get()); 222 } 223 224 225 }
Note:
See TracChangeset
for help on using the changeset viewer.