[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 14:55:47 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 1d57d76785ada6809b3f5fbf73f651244f4af904
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Oct 25 15:14:02 2010 +0000
2010-10-25 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r70450.
http://trac.webkit.org/changeset/70450
https://bugs.webkit.org/show_bug.cgi?id=48238
Causes WTR to crash on tests which use SharedMemory.
(Requested by bbandix on #webkit).
* Platform/SharedMemory.h:
* Platform/qt/MappedMemoryPool.cpp: Removed.
* Platform/qt/SharedMemoryQt.cpp:
(WebKit::SharedMemory::Handle::Handle):
(WebKit::SharedMemory::Handle::~Handle):
(WebKit::SharedMemory::Handle::encode):
(WebKit::SharedMemory::Handle::decode):
(WebKit::SharedMemory::create):
(WebKit::SharedMemory::~SharedMemory):
(WebKit::SharedMemory::createHandle):
(WebKit::SharedMemory::systemPageSize):
* Shared/qt/MappedMemory.h: Renamed from WebKit2/Platform/qt/MappedMemoryPool.h.
(WebKit::MappedMemory::mapSize):
(WebKit::MappedMemory::markUsed):
(WebKit::MappedMemory::markFree):
(WebKit::MappedMemory::isFree):
(WebKit::MappedMemory::data):
* Shared/qt/MappedMemoryPool.cpp: Added.
(WebKit::MappedMemoryPool::MappedMemoryPool):
(WebKit::MappedMemoryPool::instance):
(WebKit::MappedMemoryPool::size):
(WebKit::MappedMemoryPool::at):
(WebKit::MappedMemoryPool::append):
(WebKit::MappedMemoryPool::cleanUp):
* Shared/qt/UpdateChunk.cpp:
(WebKit::mapMemory):
(WebKit::mapFile):
(WebKit::UpdateChunk::UpdateChunk):
(WebKit::UpdateChunk::decode):
* Shared/qt/UpdateChunk.h:
* WebKit2.pro:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 5b2f5f0..f951004 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,44 @@
+2010-10-25 Sheriff Bot <webkit.review.bot at gmail.com>
+
+ Unreviewed, rolling out r70450.
+ http://trac.webkit.org/changeset/70450
+ https://bugs.webkit.org/show_bug.cgi?id=48238
+
+ Causes WTR to crash on tests which use SharedMemory.
+ (Requested by bbandix on #webkit).
+
+ * Platform/SharedMemory.h:
+ * Platform/qt/MappedMemoryPool.cpp: Removed.
+ * Platform/qt/SharedMemoryQt.cpp:
+ (WebKit::SharedMemory::Handle::Handle):
+ (WebKit::SharedMemory::Handle::~Handle):
+ (WebKit::SharedMemory::Handle::encode):
+ (WebKit::SharedMemory::Handle::decode):
+ (WebKit::SharedMemory::create):
+ (WebKit::SharedMemory::~SharedMemory):
+ (WebKit::SharedMemory::createHandle):
+ (WebKit::SharedMemory::systemPageSize):
+ * Shared/qt/MappedMemory.h: Renamed from WebKit2/Platform/qt/MappedMemoryPool.h.
+ (WebKit::MappedMemory::mapSize):
+ (WebKit::MappedMemory::markUsed):
+ (WebKit::MappedMemory::markFree):
+ (WebKit::MappedMemory::isFree):
+ (WebKit::MappedMemory::data):
+ * Shared/qt/MappedMemoryPool.cpp: Added.
+ (WebKit::MappedMemoryPool::MappedMemoryPool):
+ (WebKit::MappedMemoryPool::instance):
+ (WebKit::MappedMemoryPool::size):
+ (WebKit::MappedMemoryPool::at):
+ (WebKit::MappedMemoryPool::append):
+ (WebKit::MappedMemoryPool::cleanUp):
+ * Shared/qt/UpdateChunk.cpp:
+ (WebKit::mapMemory):
+ (WebKit::mapFile):
+ (WebKit::UpdateChunk::UpdateChunk):
+ (WebKit::UpdateChunk::decode):
+ * Shared/qt/UpdateChunk.h:
+ * WebKit2.pro:
+
2010-10-25 Zoltan Horvath <zoltan at webkit.org>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit2/Platform/SharedMemory.h b/WebKit2/Platform/SharedMemory.h
index cb6ca15..25d9c24 100644
--- a/WebKit2/Platform/SharedMemory.h
+++ b/WebKit2/Platform/SharedMemory.h
@@ -30,10 +30,6 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
-#if PLATFORM(QT)
-#include <wtf/text/WTFString.h>
-#endif
-
namespace CoreIPC {
class ArgumentDecoder;
class ArgumentEncoder;
@@ -64,8 +60,6 @@ public:
mutable mach_port_t m_port;
#elif PLATFORM(WIN)
mutable HANDLE m_handle;
-#elif PLATFORM(QT)
- mutable String m_fileName;
#endif
size_t m_size;
};
diff --git a/WebKit2/Platform/qt/MappedMemoryPool.cpp b/WebKit2/Platform/qt/MappedMemoryPool.cpp
deleted file mode 100644
index a59aea0..0000000
--- a/WebKit2/Platform/qt/MappedMemoryPool.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2010 University of Szeged
- * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "MappedMemoryPool.h"
-
-#include "StdLibExtras.h"
-#include <QDir>
-#include <QIODevice>
-#include <QTemporaryFile>
-
-namespace WebKit {
-
-MappedMemoryPool* MappedMemoryPool::instance()
-{
- DEFINE_STATIC_LOCAL(MappedMemoryPool, singleton, ());
- return &singleton;
-}
-
-MappedMemory* MappedMemoryPool::searchForMappedMemory(uchar* p)
-{
- for (unsigned n = 0; n < m_pool.size(); ++n) {
- MappedMemory& current = m_pool.at(n);
- if (current.data() == p)
- return reinterpret_cast<MappedMemory*>(¤t);
- }
- return 0;
-}
-
-MappedMemory* MappedMemoryPool::mapMemory(size_t size, QIODevice::OpenMode openMode)
-{
- for (unsigned n = 0; n < m_pool.size(); ++n) {
- MappedMemory& current = m_pool.at(n);
- if (current.dataSize >= size && current.isFree()) {
- current.markUsed();
- return ¤t;
- }
- }
- MappedMemory newMap;
- newMap.dataSize = size;
- newMap.file = new QTemporaryFile(QDir::tempPath() + "/WebKit2UpdateChunk");
- newMap.file->open(openMode);
- newMap.file->resize(newMap.mapSize());
- newMap.mappedBytes = newMap.file->map(0, newMap.mapSize());
- newMap.file->close();
- newMap.markUsed();
- m_pool.append(newMap);
- return &m_pool.last();
-}
-
-MappedMemory* MappedMemoryPool::mapFile(QString fileName, size_t size, QIODevice::OpenMode openMode)
-{
- for (unsigned n = 0; n < m_pool.size(); ++n) {
- MappedMemory& current = m_pool.at(n);
- if (current.file->fileName() == fileName) {
- ASSERT(!current.isFree());
- return ¤t;
- }
- }
- MappedMemory newMap;
- newMap.file = new QFile(fileName);
- if (!newMap.file->open(openMode))
- return 0;
- newMap.dataSize = size;
- newMap.mappedBytes = newMap.file->map(0, newMap.mapSize());
- ASSERT(!newMap.isFree());
- newMap.file->close();
- newMap.file->remove(); // The map stays alive even when the file is unlinked.
- m_pool.append(newMap);
- return &m_pool.last();
-}
-
-} // namespace WebKit
diff --git a/WebKit2/Platform/qt/SharedMemoryQt.cpp b/WebKit2/Platform/qt/SharedMemoryQt.cpp
index aba09f5..087a2ea 100644
--- a/WebKit2/Platform/qt/SharedMemoryQt.cpp
+++ b/WebKit2/Platform/qt/SharedMemoryQt.cpp
@@ -1,7 +1,5 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
- * Copyright (c) 2010 University of Szeged
- * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,131 +25,58 @@
#include "SharedMemory.h"
-#include "ArgumentDecoder.h"
-#include "ArgumentEncoder.h"
-#include "MappedMemoryPool.h"
-#include "WebCoreArgumentCoders.h"
-#include <QIODevice>
-#include <unistd.h>
-#include <wtf/text/WTFString.h>
+#include "NotImplemented.h"
namespace WebKit {
-static MappedMemoryPool* mappedMemoryPool = MappedMemoryPool::instance();
-
SharedMemory::Handle::Handle()
- : m_fileName()
- , m_size(0)
{
+ notImplemented();
}
SharedMemory::Handle::~Handle()
{
-}
-
-bool SharedMemory::Handle::isNull() const
-{
- return m_fileName.isNull();
+ notImplemented();
}
void SharedMemory::Handle::encode(CoreIPC::ArgumentEncoder* encoder) const
{
- encoder->encodeUInt64(m_size);
- encoder->encode(m_fileName);
- m_fileName = String();
+ notImplemented();
}
bool SharedMemory::Handle::decode(CoreIPC::ArgumentDecoder* decoder, Handle& handle)
{
- ASSERT(!handle.m_size);
- ASSERT(handle.m_fileName.isEmpty());
-
- uint64_t size;
- if (!decoder->decodeUInt64(size))
- return false;
-
- String fileName;
- if (!decoder->decode(fileName))
- return false;
-
- handle.m_size = size;
- handle.m_fileName = fileName;
-
- return true;
+ notImplemented();
+ return false;
}
PassRefPtr<SharedMemory> SharedMemory::create(size_t size)
{
- MappedMemory* mm = mappedMemoryPool->mapMemory(size, QIODevice::ReadWrite);
-
- RefPtr<SharedMemory> sharedMemory(adoptRef(new SharedMemory));
- sharedMemory->m_size = size;
- sharedMemory->m_data = reinterpret_cast<void*>(mm->data());
-
- return sharedMemory.release();
-}
-
-static inline QIODevice::OpenMode mapProtection(SharedMemory::Protection protection)
-{
- switch (protection) {
- case SharedMemory::ReadOnly:
- return QIODevice::ReadOnly;
- case SharedMemory::ReadWrite:
- return QIODevice::ReadWrite;
- }
-
- ASSERT_NOT_REACHED();
- return QIODevice::NotOpen;
+ notImplemented();
+ return 0;
}
PassRefPtr<SharedMemory> SharedMemory::create(const Handle& handle, Protection protection)
{
- if (handle.isNull())
- return 0;
-
- QIODevice::OpenMode openMode = mapProtection(protection);
-
- MappedMemory* mm = mappedMemoryPool->mapFile(QString(handle.m_fileName), handle.m_size, openMode);
-
- RefPtr<SharedMemory> sharedMemory(adoptRef(new SharedMemory));
- sharedMemory->m_size = handle.m_size;
- sharedMemory->m_data = reinterpret_cast<void*>(mm->data());
-
- return sharedMemory.release();
+ notImplemented();
+ return 0;
}
SharedMemory::~SharedMemory()
{
- MappedMemory* mappedMemory = mappedMemoryPool->searchForMappedMemory(reinterpret_cast<uchar*>(m_data));
- if (mappedMemory) {
- mappedMemory->markFree();
- delete mappedMemory;
- }
+ notImplemented();
}
-
+
bool SharedMemory::createHandle(Handle& handle, Protection protection)
{
- ASSERT(handle.m_fileName.isNull());
- ASSERT(!handle.m_size);
-
- MappedMemory* mm = mappedMemoryPool->searchForMappedMemory(reinterpret_cast<uchar*>(m_data));
-
- if (!mm)
- return false;
-
- handle.m_fileName = mm->file->fileName();
- handle.m_size = m_size;
-
- return true;
+ notImplemented();
+ return false;
}
unsigned SharedMemory::systemPageSize()
{
static unsigned pageSize = 0;
- if (!pageSize)
- pageSize = getpagesize();
-
return pageSize;
}
diff --git a/WebKit2/Shared/qt/MappedMemoryPool.cpp b/WebKit2/Shared/qt/MappedMemoryPool.cpp
new file mode 100644
index 0000000..f9f2f83
--- /dev/null
+++ b/WebKit2/Shared/qt/MappedMemoryPool.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 University of Szeged
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "MappedMemory.h"
+
+#include "StdLibExtras.h"
+
+namespace WebKit {
+
+MappedMemoryPool::MappedMemoryPool()
+{
+ connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), SLOT(cleanUp()));
+}
+
+MappedMemoryPool* MappedMemoryPool::instance()
+{
+ DEFINE_STATIC_LOCAL(MappedMemoryPool, singleton, ());
+ return &singleton;
+}
+
+size_t MappedMemoryPool::size() const
+{
+ return m_pool.size();
+}
+
+MappedMemory& MappedMemoryPool::at(size_t i)
+{
+ return m_pool.at(i);
+}
+
+MappedMemory& MappedMemoryPool::append(const MappedMemory& newMap)
+{
+ m_pool.append(newMap);
+ return m_pool.last();
+}
+
+void MappedMemoryPool::cleanUp()
+{
+ size_t size = m_pool.size();
+
+ for (size_t i = 0; i < size; ++i) {
+ MappedMemory& chunk = m_pool.at(i);
+ if (!chunk.isFree())
+ chunk.file->unmap(chunk.mappedBytes);
+ chunk.file->remove();
+ }
+
+ delete this;
+}
+
+} // namespace WebKit
diff --git a/WebKit2/Shared/qt/UpdateChunk.cpp b/WebKit2/Shared/qt/UpdateChunk.cpp
index c7776ab..8dd0f61 100644
--- a/WebKit2/Shared/qt/UpdateChunk.cpp
+++ b/WebKit2/Shared/qt/UpdateChunk.cpp
@@ -29,9 +29,12 @@
#include "ArgumentDecoder.h"
#include "ArgumentEncoder.h"
+#include "Attachment.h"
#include "WebCoreArgumentCoders.h"
-#include <QIODevice>
+#include <QDebug>
+#include <QDir>
#include <QImage>
+#include <QTemporaryFile>
#include <WebCore/FloatRect.h>
#include <wtf/text/WTFString.h>
@@ -40,7 +43,48 @@ using namespace std;
namespace WebKit {
-static MappedMemoryPool* mappedMemoryPool = MappedMemoryPool::instance();
+static MappedMemory* mapMemory(size_t size)
+{
+ MappedMemoryPool* pool = MappedMemoryPool::instance();
+ for (unsigned n = 0; n < pool->size(); ++n) {
+ MappedMemory& current = pool->at(n);
+ if (current.dataSize >= size && current.isFree()) {
+ current.markUsed();
+ return ¤t;
+ }
+ }
+ MappedMemory newMap;
+ newMap.dataSize = size;
+ newMap.file = new QTemporaryFile(QDir::tempPath() + "/WebKit2UpdateChunk");
+ newMap.file->open(QIODevice::ReadWrite);
+ newMap.file->resize(newMap.mapSize());
+ newMap.mappedBytes = newMap.file->map(0, newMap.mapSize());
+ newMap.file->close();
+ newMap.markUsed();
+ return &pool->append(newMap);
+}
+
+static MappedMemory* mapFile(QString fileName, size_t size)
+{
+ MappedMemoryPool* pool = MappedMemoryPool::instance();
+ for (unsigned n = 0; n < pool->size(); ++n) {
+ MappedMemory& current = pool->at(n);
+ if (current.file->fileName() == fileName) {
+ ASSERT(!current.isFree());
+ return ¤t;
+ }
+ }
+ MappedMemory newMap;
+ newMap.file = new QFile(fileName);
+ if (!newMap.file->open(QIODevice::ReadWrite))
+ return 0;
+ newMap.dataSize = size;
+ newMap.mappedBytes = newMap.file->map(0, newMap.mapSize());
+ ASSERT(!newMap.isFree());
+ newMap.file->close();
+ newMap.file->remove(); // The map stays alive even when the file is unlinked.
+ return &pool->append(newMap);
+}
UpdateChunk::UpdateChunk()
: m_mappedMemory(0)
@@ -49,7 +93,7 @@ UpdateChunk::UpdateChunk()
UpdateChunk::UpdateChunk(const IntRect& rect)
: m_rect(rect)
- , m_mappedMemory(mappedMemoryPool->mapMemory(size()))
+ , m_mappedMemory(mapMemory(size()))
{
}
@@ -80,12 +124,12 @@ bool UpdateChunk::decode(CoreIPC::ArgumentDecoder* decoder, UpdateChunk& chunk)
if (!decoder->decode(rect))
return false;
chunk.m_rect = rect;
-
+
String fileName;
if (!decoder->decode(fileName))
return false;
- chunk.m_mappedMemory = mappedMemoryPool->mapFile(fileName, chunk.size());
+ chunk.m_mappedMemory = mapFile(fileName, chunk.size());
return chunk.m_mappedMemory->mappedBytes;
}
diff --git a/WebKit2/Shared/qt/UpdateChunk.h b/WebKit2/Shared/qt/UpdateChunk.h
index bd8a7fa..0c9286e 100644
--- a/WebKit2/Shared/qt/UpdateChunk.h
+++ b/WebKit2/Shared/qt/UpdateChunk.h
@@ -27,7 +27,7 @@
#ifndef UpdateChunk_h
#define UpdateChunk_h
-#include "MappedMemoryPool.h"
+#include "MappedMemory.h"
#include <QImage>
#include <WebCore/IntRect.h>
diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
index 954c3af..f04d52e 100644
--- a/WebKit2/WebKit2.pro
+++ b/WebKit2/WebKit2.pro
@@ -106,7 +106,6 @@ INCLUDEPATH = \
$$PWD \
Platform \
Platform/CoreIPC \
- Platform/qt \
Shared \
Shared/API/c \
Shared/CoreIPCSupport \
@@ -175,7 +174,6 @@ HEADERS += \
Platform/Logging.h \
Platform/Module.h \
Platform/PlatformProcessIdentifier.h \
- Platform/qt/MappedMemoryPool.h \
Platform/RunLoop.h \
Platform/SharedMemory.h \
Platform/WorkItem.h \
@@ -205,6 +203,7 @@ HEADERS += \
Shared/NativeWebKeyboardEvent.h \
Shared/NotImplemented.h \
Shared/StringPairVector.h \
+ Shared/qt/MappedMemory.h \
Shared/qt/PlatformCertificateInfo.h \
Shared/qt/UpdateChunk.h \
Shared/qt/WebEventFactoryQt.h \
@@ -338,7 +337,6 @@ SOURCES += \
Platform/Module.cpp \
Platform/RunLoop.cpp \
Platform/WorkQueue.cpp \
- Platform/qt/MappedMemoryPool.cpp \
Platform/qt/ModuleQt.cpp \
Platform/qt/RunLoopQt.cpp \
Platform/qt/SharedMemoryQt.cpp \
@@ -359,6 +357,7 @@ SOURCES += \
Shared/MutableArray.cpp \
Shared/MutableDictionary.cpp \
Shared/qt/BackingStoreQt.cpp \
+ Shared/qt/MappedMemoryPool.cpp \
Shared/qt/NativeWebKeyboardEventQt.cpp \
Shared/qt/UpdateChunk.cpp \
Shared/qt/WebCoreArgumentCodersQt.cpp \
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list