Changeset 71409 in webkit
- Timestamp:
- Nov 5, 2010 5:03:50 AM (13 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r71385 r71409 1 2010-11-05 Balazs Kelemen <kbalazs@webkit.org> 2 3 Reviewed by Andreas Kling. 4 5 [Qt][WK2] Left over files and shared memory segments 6 https://bugs.webkit.org/show_bug.cgi?id=48985 7 8 * Platform/qt/SharedMemoryQt.cpp: 9 (WebKit::SharedMemory::create): Force deletion of the QSharedMemory 10 object on terminate by connecting QCoreApplication::aboutToQuit with 11 deleteLater. Add the object to the CrashHandler as well to release the 12 shared memory segment even on crash. 13 (WebKit::SharedMemory::~SharedMemory): 14 * Shared/qt/CrashHandler.cpp: Added. 15 CrashHandler has a container for QObjects that we want to 16 destroy on crash. When we got a signal that we interpret as 17 a crash then it destroys those objects. 18 (WebKit::CrashHandler::CrashHandler): 19 (WebKit::CrashHandler::signalHandler): 20 (WebKit::CrashHandler::deleteObjects): 21 * Shared/qt/CrashHandler.h: Added. 22 (WebKit::CrashHandler::instance): 23 (WebKit::CrashHandler::didDelete): 24 (WebKit::CrashHandler::markForDeletionOnCrash): 25 * UIProcess/Launcher/qt/ProcessLauncherQt.cpp: 26 (WebKit::ProcessLauncherHelper::ProcessLauncherHelper): 27 Add the object itself to the CrashHandler to close the QLocalServer 28 even on crash. Without that the QLocalServer leaves over socket files on the disk. 29 (WebKit::ProcessLauncherHelper::~ProcessLauncherHelper): 30 * WebKit2.pro: 31 1 32 2010-11-04 Jia Pu <jpu@apple.com> 2 33 -
trunk/WebKit2/Platform/qt/SharedMemoryQt.cpp
r71118 r71409 30 30 #include "ArgumentDecoder.h" 31 31 #include "ArgumentEncoder.h" 32 #include "CrashHandler.h" 32 33 #include "WebCoreArgumentCoders.h" 33 34 #include <unistd.h> 35 #include <QCoreApplication> 34 36 #include <QLatin1String> 35 37 #include <QSharedMemory> … … 93 95 bool created = impl->create(size); 94 96 ASSERT_UNUSED(created, created); 97 95 98 sharedMemory->m_impl = impl; 96 99 sharedMemory->m_size = size; 97 100 sharedMemory->m_data = impl->data(); 101 102 impl->connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), SLOT(deleteLater())); 103 104 // Release the shared memory segment even on crash! 105 CrashHandler::instance()->markForDeletionOnCrash(impl); 98 106 99 107 return sharedMemory.release(); … … 122 130 bool attached = impl->attach(accessMode(protection)); 123 131 ASSERT_UNUSED(attached, attached); 132 124 133 sharedMemory->m_impl = impl; 125 134 ASSERT(handle.m_size == impl->size()); 126 135 sharedMemory->m_size = handle.m_size; 127 136 sharedMemory->m_data = impl->data(); 137 138 impl->connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), SLOT(deleteLater())); 139 140 // Release the shared memory segment even on crash! 141 CrashHandler::instance()->markForDeletionOnCrash(impl); 128 142 129 143 return sharedMemory.release(); … … 135 149 ASSERT(qobject_cast<QSharedMemory*>(m_impl)); 136 150 delete m_impl; 151 CrashHandler::instance()->didDelete(m_impl); 137 152 } 138 153 -
trunk/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp
r68515 r71409 30 30 #include "NotImplemented.h" 31 31 #include "RunLoop.h" 32 #include "CrashHandler.h" 32 33 #include "WebProcess.h" 33 34 #include <runtime/InitializeThreading.h> … … 103 104 { 104 105 m_server.close(); 106 CrashHandler::instance()->didDelete(this); 105 107 } 106 108 … … 114 116 connect(&m_server, SIGNAL(newConnection()), this, SLOT(newConnection())); 115 117 connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), SLOT(deleteLater()), Qt::QueuedConnection); 118 119 // Do not leave socket files on the disk even on crash! 120 CrashHandler::instance()->markForDeletionOnCrash(this); 116 121 } 117 122 -
trunk/WebKit2/WebKit2.pro
r71343 r71409 214 214 Shared/NotImplemented.h \ 215 215 Shared/StringPairVector.h \ 216 Shared/qt/CrashHandler.h \ 216 217 Shared/qt/PlatformCertificateInfo.h \ 217 218 Shared/qt/UpdateChunk.h \ … … 380 381 Shared/MutableDictionary.cpp \ 381 382 Shared/qt/BackingStoreQt.cpp \ 383 Shared/qt/CrashHandler.cpp \ 382 384 Shared/qt/NativeWebKeyboardEventQt.cpp \ 383 385 Shared/qt/UpdateChunk.cpp \
Note: See TracChangeset
for help on using the changeset viewer.