[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
eric at webkit.org
eric at webkit.org
Wed Mar 17 18:26:13 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit af3f1468e44e2a316d5624742197c8094d059b62
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Mar 6 13:57:23 2010 +0000
2010-03-06 Kwang Yul Seo <skyul at company100.net>
Reviewed by Eric Seidel.
[BREWMP] Share OwnPtr.
https://bugs.webkit.org/show_bug.cgi?id=35776
Share OwnPtr implementation with BREW MP and remove OwnPtrBrew.
* wtf/OwnPtrBrew.cpp: Added.
(WTF::deleteOwnedPtr):
* wtf/OwnPtrCommon.h:
* wtf/brew/OwnPtrBrew.cpp: Removed.
* wtf/brew/OwnPtrBrew.h: Removed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 0775a4f..f875a1c 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-03-06 Kwang Yul Seo <skyul at company100.net>
+
+ Reviewed by Eric Seidel.
+
+ [BREWMP] Share OwnPtr.
+ https://bugs.webkit.org/show_bug.cgi?id=35776
+
+ Share OwnPtr implementation with BREW MP and remove OwnPtrBrew.
+
+ * wtf/OwnPtrBrew.cpp: Added.
+ (WTF::deleteOwnedPtr):
+ * wtf/OwnPtrCommon.h:
+ * wtf/brew/OwnPtrBrew.cpp: Removed.
+ * wtf/brew/OwnPtrBrew.h: Removed.
+
2010-03-06 Patrick Gansterer <paroga at paroga.com>
Reviewed by Eric Seidel.
diff --git a/JavaScriptCore/wtf/OwnPtrBrew.cpp b/JavaScriptCore/wtf/OwnPtrBrew.cpp
new file mode 100644
index 0000000..c8384e1
--- /dev/null
+++ b/JavaScriptCore/wtf/OwnPtrBrew.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 Company 100 Inc. 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 APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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 "config.h"
+#include "OwnPtr.h"
+
+#include <AEEBitmap.h>
+#include <AEEFile.h>
+#include <AEEStdLib.h>
+
+namespace WTF {
+
+void deleteOwnedPtr(IFileMgr* ptr)
+{
+ if (ptr)
+ IFILEMGR_Release(ptr);
+}
+
+void deleteOwnedPtr(IFile* ptr)
+{
+ if (ptr)
+ IFILE_Release(ptr);
+}
+
+void deleteOwnedPtr(IBitmap* ptr)
+{
+ if (ptr)
+ IBitmap_Release(ptr);
+}
+
+}
diff --git a/JavaScriptCore/wtf/OwnPtrCommon.h b/JavaScriptCore/wtf/OwnPtrCommon.h
index 6d91a54..c59fdc5 100644
--- a/JavaScriptCore/wtf/OwnPtrCommon.h
+++ b/JavaScriptCore/wtf/OwnPtrCommon.h
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009 Apple Inc. All rights reserved.
* Copyright (C) 2009 Torch Mobile, Inc.
+ * Copyright (C) 2010 Company 100 Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -37,6 +38,14 @@ typedef struct HPEN__* HPEN;
typedef struct HRGN__* HRGN;
#endif
+#if PLATFORM(BREWMP)
+// Forward delcarations at this point avoid the need to include BREW includes
+// in WTF headers.
+typedef struct _IFileMgr IFileMgr;
+typedef struct _IFile IFile;
+typedef struct IBitmap IBitmap;
+#endif
+
namespace WTF {
template <typename T> inline void deleteOwnedPtr(T* ptr)
@@ -56,6 +65,12 @@ namespace WTF {
void deleteOwnedPtr(HRGN);
#endif
+#if PLATFORM(BREWMP)
+ void deleteOwnedPtr(IFileMgr*);
+ void deleteOwnedPtr(IFile*);
+ void deleteOwnedPtr(IBitmap*);
+#endif
+
} // namespace WTF
#endif // WTF_OwnPtrCommon_h
diff --git a/JavaScriptCore/wtf/brew/OwnPtrBrew.cpp b/JavaScriptCore/wtf/brew/OwnPtrBrew.cpp
deleted file mode 100644
index dadd82e..0000000
--- a/JavaScriptCore/wtf/brew/OwnPtrBrew.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2010 Company 100, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "OwnPtrBrew.h"
-
-#include <AEEBitmap.h>
-#include <AEEFile.h>
-#include <AEEStdLib.h>
-
-namespace WTF {
-
-template <> void freeOwnedPtrBrew<IFileMgr>(IFileMgr* ptr)
-{
- if (ptr)
- IFILEMGR_Release(ptr);
-}
-
-template <> void freeOwnedPtrBrew<IFile>(IFile* ptr)
-{
- if (ptr)
- IFILE_Release(ptr);
-}
-
-template <> void freeOwnedPtrBrew<IBitmap>(IBitmap* ptr)
-{
- if (ptr)
- IBitmap_Release(ptr);
-}
-
-template <typename T> void freeOwnedPtrBrew(T* ptr)
-{
- FREEIF(ptr);
-}
-
-} // namespace WTF
diff --git a/JavaScriptCore/wtf/brew/OwnPtrBrew.h b/JavaScriptCore/wtf/brew/OwnPtrBrew.h
deleted file mode 100644
index 1bb44fc..0000000
--- a/JavaScriptCore/wtf/brew/OwnPtrBrew.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Collabora Ltd.
- * Copyright (C) 2010 Company 100, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef OwnPtrBrew_h
-#define OwnPtrBrew_h
-
-#include <algorithm>
-#include <wtf/Assertions.h>
-#include <wtf/Noncopyable.h>
-
-// Forward delcarations at this point avoid the need to include BREW includes
-// in WTF headers.
-typedef struct _IFileMgr IFileMgr;
-typedef struct _IFile IFile;
-typedef struct IBitmap IBitmap;
-
-namespace WTF {
-
-template <typename T> void freeOwnedPtrBrew(T* ptr);
-template<> void freeOwnedPtrBrew<IFileMgr>(IFileMgr*);
-template<> void freeOwnedPtrBrew<IFile>(IFile*);
-template<> void freeOwnedPtrBrew<IBitmap>(IBitmap*);
-
-template <typename T> class OwnPtrBrew : public Noncopyable {
-public:
- explicit OwnPtrBrew(T* ptr = 0) : m_ptr(ptr) { }
- ~OwnPtrBrew() { freeOwnedPtrBrew(m_ptr); }
-
- T* get() const { return m_ptr; }
- T* release()
- {
- T* ptr = m_ptr;
- m_ptr = 0;
- return ptr;
- }
-
- T*& outPtr()
- {
- ASSERT(!m_ptr);
- return m_ptr;
- }
-
- void set(T* ptr)
- {
- ASSERT(!ptr || m_ptr != ptr);
- freeOwnedPtrBrew(m_ptr);
- m_ptr = ptr;
- }
-
- void clear()
- {
- freeOwnedPtrBrew(m_ptr);
- m_ptr = 0;
- }
-
- T& operator*() const
- {
- ASSERT(m_ptr);
- return *m_ptr;
- }
-
- T* operator->() const
- {
- ASSERT(m_ptr);
- return m_ptr;
- }
-
- bool operator!() const { return !m_ptr; }
-
- // This conversion operator allows implicit conversion to bool but not to other integer types.
- typedef T* OwnPtrBrew::*UnspecifiedBoolType;
- operator UnspecifiedBoolType() const { return m_ptr ? &OwnPtrBrew::m_ptr : 0; }
-
- void swap(OwnPtrBrew& o) { std::swap(m_ptr, o.m_ptr); }
-
-private:
- T* m_ptr;
-};
-
-template <typename T> inline void swap(OwnPtrBrew<T>& a, OwnPtrBrew<T>& b)
-{
- a.swap(b);
-}
-
-template <typename T, typename U> inline bool operator==(const OwnPtrBrew<T>& a, U* b)
-{
- return a.get() == b;
-}
-
-template <typename T, typename U> inline bool operator==(T* a, const OwnPtrBrew<U>& b)
-{
- return a == b.get();
-}
-
-template <typename T, typename U> inline bool operator!=(const OwnPtrBrew<T>& a, U* b)
-{
- return a.get() != b;
-}
-
-template <typename T, typename U> inline bool operator!=(T* a, const OwnPtrBrew<U>& b)
-{
- return a != b.get();
-}
-
-template <typename T> inline typename OwnPtrBrew<T>::PtrType getPtr(const OwnPtrBrew<T>& p)
-{
- return p.get();
-}
-
-} // namespace WTF
-
-using WTF::OwnPtrBrew;
-
-#endif // OwnPtrBrew_h
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list