- Revision
- 142002
- Author
- commit-qu...@webkit.org
- Date
- 2013-02-06 08:20:58 -0800 (Wed, 06 Feb 2013)
Log Message
[WK2][Win] Fix build after MessageID.h related changes and after r141619.
https://bugs.webkit.org/show_bug.cgi?id=108612
Patch by Simon Hausmann <simon.hausm...@digia.com>, Zoltan Arvai <zar...@inf.u-szeged.hu> on 2013-02-06
Reviewed by Anders Carlsson.
* Platform/CoreIPC/win/ConnectionWin.cpp:
(CoreIPC::Connection::platformInvalidate):
(CoreIPC::Connection::readEventHandler):
(CoreIPC::Connection::open):
(CoreIPC::Connection::sendOutgoingMessage):
* Platform/WorkQueue.h:
(WorkQueue::WorkItemWin::queue):
(WorkItemWin):
* Platform/win/SharedMemoryWin.cpp:
(WebKit::SharedMemory::Handle::decode):
* Platform/win/WorkQueueWin.cpp:
(WorkQueue::handleCallback):
(WorkQueue::performWorkOnRegisteredWorkThread):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (142001 => 142002)
--- trunk/Source/WebKit2/ChangeLog 2013-02-06 16:10:32 UTC (rev 142001)
+++ trunk/Source/WebKit2/ChangeLog 2013-02-06 16:20:58 UTC (rev 142002)
@@ -1,3 +1,24 @@
+2013-02-06 Simon Hausmann <simon.hausm...@digia.com>, Zoltan Arvai <zar...@inf.u-szeged.hu>
+
+ [WK2][Win] Fix build after MessageID.h related changes and after r141619.
+ https://bugs.webkit.org/show_bug.cgi?id=108612
+
+ Reviewed by Anders Carlsson.
+
+ * Platform/CoreIPC/win/ConnectionWin.cpp:
+ (CoreIPC::Connection::platformInvalidate):
+ (CoreIPC::Connection::readEventHandler):
+ (CoreIPC::Connection::open):
+ (CoreIPC::Connection::sendOutgoingMessage):
+ * Platform/WorkQueue.h:
+ (WorkQueue::WorkItemWin::queue):
+ (WorkItemWin):
+ * Platform/win/SharedMemoryWin.cpp:
+ (WebKit::SharedMemory::Handle::decode):
+ * Platform/win/WorkQueueWin.cpp:
+ (WorkQueue::handleCallback):
+ (WorkQueue::performWorkOnRegisteredWorkThread):
+
2013-02-06 Mike West <mk...@chromium.org>
Add an ENABLE_NOSNIFF feature flag.
Modified: trunk/Source/WebKit2/Platform/CoreIPC/win/ConnectionWin.cpp (142001 => 142002)
--- trunk/Source/WebKit2/Platform/CoreIPC/win/ConnectionWin.cpp 2013-02-06 16:10:32 UTC (rev 142001)
+++ trunk/Source/WebKit2/Platform/CoreIPC/win/ConnectionWin.cpp 2013-02-06 16:20:58 UTC (rev 142002)
@@ -96,10 +96,10 @@
m_isConnected = false;
- m_connectionQueue.unregisterAndCloseHandle(m_readState.hEvent);
+ m_connectionQueue->unregisterAndCloseHandle(m_readState.hEvent);
m_readState.hEvent = 0;
- m_connectionQueue.unregisterAndCloseHandle(m_writeState.hEvent);
+ m_connectionQueue->unregisterAndCloseHandle(m_writeState.hEvent);
m_writeState.hEvent = 0;
::CloseHandle(m_connectionPipe);
@@ -161,17 +161,8 @@
if (!m_readBuffer.isEmpty()) {
// We have a message, let's dispatch it.
- // The messageID is encoded at the end of the buffer.
- // Note that we assume here that the message is the same size as m_readBuffer. We can
- // assume this because we always size m_readBuffer to exactly match the size of the message,
- // either when receiving ERROR_MORE_DATA from ::GetOverlappedResult above or when
- // ::PeekNamedPipe tells us the size below. We never set m_readBuffer to a size larger
- // than the message.
- ASSERT(m_readBuffer.size() >= sizeof(MessageID));
- size_t realBufferSize = m_readBuffer.size() - sizeof(MessageID);
-
- OwnPtr<MessageDecoder> decoder = MessageDecoder::create(DataReference(m_readBuffer.data(), realBufferSize));
- processIncomingMessage(MessageID(), decoder.release());
+ OwnPtr<MessageDecoder> decoder = MessageDecoder::create(DataReference(m_readBuffer.data(), m_readBuffer.size()));
+ processIncomingMessage(decoder.release());
}
// Find out the size of the next message in the pipe (if there is one) so that we can read
@@ -260,11 +251,11 @@
m_isConnected = true;
// Start listening for read and write state events.
- m_connectionQueue.registerHandle(m_readState.hEvent, bind(&Connection::readEventHandler, this));
- m_connectionQueue.registerHandle(m_writeState.hEvent, bind(&Connection::writeEventHandler, this));
+ m_connectionQueue->registerHandle(m_readState.hEvent, bind(&Connection::readEventHandler, this));
+ m_connectionQueue->registerHandle(m_writeState.hEvent, bind(&Connection::writeEventHandler, this));
// Schedule a read.
- m_connectionQueue.dispatch(bind(&Connection::readEventHandler, this));
+ m_connectionQueue->dispatch(bind(&Connection::readEventHandler, this));
return true;
}
@@ -277,7 +268,7 @@
return !m_pendingWriteEncoder;
}
-bool Connection::sendOutgoingMessage(MessageID messageID, PassOwnPtr<MessageEncoder> encoder)
+bool Connection::sendOutgoingMessage(PassOwnPtr<MessageEncoder> encoder)
{
ASSERT(!m_pendingWriteEncoder);
Modified: trunk/Source/WebKit2/Platform/WorkQueue.h (142001 => 142002)
--- trunk/Source/WebKit2/Platform/WorkQueue.h 2013-02-06 16:10:32 UTC (rev 142001)
+++ trunk/Source/WebKit2/Platform/WorkQueue.h 2013-02-06 16:20:58 UTC (rev 142002)
@@ -103,14 +103,14 @@
virtual ~WorkItemWin();
Function<void()>& function() { return m_function; }
- WorkQueue* queue() const { return m_queue; }
+ WorkQueue* queue() const { return m_queue.get(); }
protected:
WorkItemWin(const Function<void()>&, WorkQueue*);
private:
Function<void()> m_function;
- WorkQueue* m_queue;
+ RefPtr<WorkQueue> m_queue;
};
class HandleWorkItem : public WorkItemWin {
Modified: trunk/Source/WebKit2/Platform/win/SharedMemoryWin.cpp (142001 => 142002)
--- trunk/Source/WebKit2/Platform/win/SharedMemoryWin.cpp 2013-02-06 16:10:32 UTC (rev 142001)
+++ trunk/Source/WebKit2/Platform/win/SharedMemoryWin.cpp 2013-02-06 16:20:58 UTC (rev 142002)
@@ -84,21 +84,21 @@
return success;
}
-bool SharedMemory::Handle::decode(CoreIPC::ArgumentDecoder* decoder, Handle& handle)
+bool SharedMemory::Handle::decode(CoreIPC::ArgumentDecoder& decoder, Handle& handle)
{
ASSERT_ARG(handle, !handle.m_handle);
ASSERT_ARG(handle, !handle.m_size);
uint64_t size;
- if (!decoder->decode(size))
+ if (!decoder.decode(size))
return false;
uint64_t sourceHandle;
- if (!decoder->decode(sourceHandle))
+ if (!decoder.decode(sourceHandle))
return false;
uint32_t sourcePID;
- if (!decoder->decode(sourcePID))
+ if (!decoder.decode(sourcePID))
return false;
HANDLE duplicatedHandle;
Modified: trunk/Source/WebKit2/Platform/win/WorkQueueWin.cpp (142001 => 142002)
--- trunk/Source/WebKit2/Platform/win/WorkQueueWin.cpp 2013-02-06 16:10:32 UTC (rev 142001)
+++ trunk/Source/WebKit2/Platform/win/WorkQueueWin.cpp 2013-02-06 16:20:58 UTC (rev 142002)
@@ -67,7 +67,7 @@
ASSERT_ARG(timerOrWaitFired, !timerOrWaitFired);
WorkItemWin* item = static_cast<WorkItemWin*>(context);
- WorkQueue* queue = item->queue();
+ RefPtr<WorkQueue> queue = item->queue();
{
MutexLocker lock(queue->m_workItemQueueLock);
@@ -133,23 +133,16 @@
{
ASSERT(m_isWorkThreadRegistered);
- bool isValid = true;
-
m_workItemQueueLock.lock();
- while (isValid && !m_workItemQueue.isEmpty()) {
+ while (!m_workItemQueue.isEmpty()) {
Vector<RefPtr<WorkItemWin> > workItemQueue;
m_workItemQueue.swap(workItemQueue);
// Allow more work to be scheduled while we're not using the queue directly.
m_workItemQueueLock.unlock();
- for (size_t i = 0; i < workItemQueue.size(); ++i) {
- MutexLocker locker(m_isValidMutex);
- isValid = m_isValid;
- if (!isValid)
- break;
+ for (size_t i = 0; i < workItemQueue.size(); ++i)
workItemQueue[i]->function()();
- }
m_workItemQueueLock.lock();
}