Changeset 73142 in webkit
- Timestamp:
- Dec 2, 2010 9:34:02 AM (13 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r73140 r73142 1 2010-11-30 Amruth Raj <amruthraj@motorola.com> and Ravi Kasibhatla <ravi.kasibhatla@motorola.com> 2 3 Reviewed by Martin Robinson. 4 5 [GTK] Implement RunLoop, WorkQueue, Connection classes for WebKit2 6 https://bugs.webkit.org/show_bug.cgi?id=48507 7 8 * Platform/CoreIPC/Connection.h: UNIX_X11 specific changes for GTK port. 9 (CoreIPC::Connection::messageProcessingCompleted): 10 * Platform/CoreIPC/gtk: Added. 11 * Platform/CoreIPC/gtk/ConnectionGtk.cpp: Added. Connection class implementation for GTK port (UNIX_X11 specific). 12 (CoreIPC::readBytesFromSocket): 13 (CoreIPC::writeBytesToSocket): 14 (CoreIPC::Connection::platformInitialize): 15 (CoreIPC::Connection::platformInvalidate): 16 (CoreIPC::Connection::processCompletedMessage): 17 (CoreIPC::Connection::readEventHandler): 18 (CoreIPC::Connection::open): 19 (CoreIPC::Connection::platformCanSendOutgoingMessages): 20 (CoreIPC::Connection::sendOutgoingMessage): 21 * Platform/PlatformProcessIdentifier.h: UNIX_X11 specific changes for GTK port. 22 * Platform/RunLoop.h: GTK port specific changes. 23 * Platform/WorkQueue.h: GTK port specific changes. 24 * Platform/gtk/RunLoopGtk.cpp: Added. Runs an event loop using GMainLoop and handles the incoming messages. 25 (RunLoop::RunLoop): 26 (RunLoop::~RunLoop): 27 (RunLoop::run): 28 (RunLoop::mainLoop): 29 (RunLoop::stop): 30 (RunLoop::queueWork): 31 (RunLoop::wakeUp): 32 (RunLoop::TimerBase::TimerBase): 33 (RunLoop::TimerBase::~TimerBase): 34 (RunLoop::TimerBase::resetTimerSource): 35 (RunLoop::TimerBase::oneShotTimerFired): 36 (RunLoop::TimerBase::repeatingTimerFired): 37 (RunLoop::TimerBase::start): 38 (RunLoop::TimerBase::stop): 39 (RunLoop::TimerBase::isActive): 40 * Platform/gtk/WorkQueueGtk.cpp: Added. Creates a thread and polls on a given fd using GIOChannel. 41 Dispatches the obtained messages to RunLoop's GMainLoop. 42 (WorkQueue::EventSource::EventSource): 43 (WorkQueue::EventSource::dispatchSource): 44 (WorkQueue::EventSource::performWorkOnce): 45 (WorkQueue::EventSource::performWork): 46 (WorkQueue::EventSource::deleteEventSource): 47 (WorkQueue::platformInitialize): 48 (WorkQueue::platformInvalidate): 49 (WorkQueue::startWorkQueueThread): 50 (WorkQueue::workQueueThreadBody): 51 (WorkQueue::registerEventSourceHandler): 52 (WorkQueue::unregisterEventSourceHandler): 53 (WorkQueue::scheduleWork): 54 1 55 2010-12-02 Steve Falkenburg <sfalken@apple.com> 2 56 -
trunk/WebKit2/Platform/CoreIPC/Connection.h
r71931 r73142 2 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 4 * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved. 4 5 * 5 6 * Redistribution and use in source and binary forms, with or without … … 91 92 #elif PLATFORM(QT) 92 93 typedef const QString Identifier; 94 #elif PLATFORM(GTK) 95 typedef int Identifier; 93 96 #endif 94 97 … … 264 267 QLocalSocket* m_socket; 265 268 QString m_serverName; 269 #elif PLATFORM(GTK) 270 void readEventHandler(); 271 void processCompletedMessage(); 272 bool messageProcessingCompleted() { return !m_currentMessageSize; } 273 274 int m_socket; 275 Vector<uint8_t> m_readBuffer; 276 size_t m_currentMessageSize; 277 size_t m_pendingBytes; 266 278 #endif 267 279 }; -
trunk/WebKit2/Platform/PlatformProcessIdentifier.h
r62790 r73142 40 40 #elif PLATFORM(QT) 41 41 typedef QProcess* PlatformProcessIdentifier; 42 #elif PLATFORM(GTK) 43 typedef pid_t PlatformProcessIdentifier; 42 44 #endif 43 45 -
trunk/WebKit2/Platform/RunLoop.h
r72816 r73142 2 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 4 * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved. 4 5 * 5 6 * Redistribution and use in source and binary forms, with or without … … 33 34 #include <wtf/Threading.h> 34 35 #include <wtf/Vector.h> 36 #if PLATFORM(GTK) 37 typedef struct _GSource GSource; 38 typedef struct _GMainLoop GMainLoop; 39 typedef struct _GMainContext GMainContext; 40 typedef int gboolean; 41 #endif 35 42 36 43 class WorkItem; … … 79 86 int m_ID; 80 87 bool m_isRepeating; 88 #elif PLATFORM(GTK) 89 static gboolean oneShotTimerFired(RunLoop::TimerBase*); 90 static gboolean repeatingTimerFired(RunLoop::TimerBase*); 91 void resetTimerSource(); 92 GSource* m_timerSource; 81 93 #endif 82 94 }; … … 130 142 class TimerObject; 131 143 TimerObject* m_timerObject; 144 #elif PLATFORM(GTK) 145 public: 146 static gboolean queueWork(RunLoop*); 147 GMainLoop* mainLoop(); 148 private: 149 GMainContext* m_runLoopContext; 150 GMainLoop* m_runLoopMain; 132 151 #endif 133 152 }; -
trunk/WebKit2/Platform/WorkQueue.h
r71456 r73142 1 1 /* 2 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 44 45 class QObject; 45 46 class QThread; 47 #elif PLATFORM(GTK) 48 typedef struct _GMainContext GMainContext; 49 typedef struct _GMainLoop GMainLoop; 46 50 #endif 47 51 … … 80 84 81 85 void moveSocketToWorkThread(QLocalSocket*); 86 #elif PLATFORM(GTK) 87 void registerEventSourceHandler(int, int, PassOwnPtr<WorkItem>); 88 void unregisterEventSourceHandler(int); 82 89 #endif 83 90 … … 152 159 QThread* m_workThread; 153 160 friend class WorkItemQt; 161 #elif PLATFORM(GTK) 162 static void* startWorkQueueThread(WorkQueue*); 163 void workQueueThreadBody(); 164 165 ThreadIdentifier m_workQueueThread; 166 GMainContext* m_eventContext; 167 Mutex m_eventLoopLock; 168 GMainLoop* m_eventLoop; 169 Mutex m_eventSourcesLock; 170 class EventSource; 171 HashMap<int, Vector<EventSource*> > m_eventSources; 172 typedef HashMap<int, Vector<EventSource*> >::iterator EventSourceIterator; 154 173 #endif 155 174 };
Note: See TracChangeset
for help on using the changeset viewer.