[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

benm at google.com benm at google.com
Thu Apr 8 00:32:18 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit daada5f1baf3dea2427ad9c1d4a8b95d8a8eefc8
Author: benm at google.com <benm at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 11 12:20:43 2009 +0000

    [Android] Add detachHistoryItem() to AndroidWebHistoryBridge. And the constructor takes
    HistoryItem* now. As AndroidWebHistoryBridge holds a dumb pointer of HistoryItem and
    HistoryItem holds a RefPtr of AndroidWebHistoryBridge, the dumb pointer needs to be cleared
    when HistoryItem is deleted to avoid potential crash.
    https://bugs.webkit.org/show_bug.cgi?id=32251
    
    Patch by Grace Kloba <klobag at gmail.com> on 2009-12-11
    Reviewed by Darin Adler.
    
    * history/HistoryItem.cpp:
    (WebCore::HistoryItem::~HistoryItem):
    * history/android/AndroidWebHistoryBridge.h:
    (WebCore::AndroidWebHistoryBridge::AndroidWebHistoryBridge):
    (WebCore::AndroidWebHistoryBridge::detachHistoryItem):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51980 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 94b2056..f43f368 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2009-12-11  Grace Kloba  <klobag at gmail.com>
+
+        Reviewed by Darin Adler.
+
+        [Android] Add detachHistoryItem() to AndroidWebHistoryBridge. And the constructor takes
+        HistoryItem* now. As AndroidWebHistoryBridge holds a dumb pointer of HistoryItem and
+        HistoryItem holds a RefPtr of AndroidWebHistoryBridge, the dumb pointer needs to be cleared
+        when HistoryItem is deleted to avoid potential crash.
+        https://bugs.webkit.org/show_bug.cgi?id=32251
+
+        * history/HistoryItem.cpp:
+        (WebCore::HistoryItem::~HistoryItem):
+        * history/android/AndroidWebHistoryBridge.h:
+        (WebCore::AndroidWebHistoryBridge::AndroidWebHistoryBridge):
+        (WebCore::AndroidWebHistoryBridge::detachHistoryItem):
+
+
 2009-12-11  Fumitoshi Ukai  <ukai at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/history/HistoryItem.cpp b/WebCore/history/HistoryItem.cpp
index 88e4c7b..21e67ca 100644
--- a/WebCore/history/HistoryItem.cpp
+++ b/WebCore/history/HistoryItem.cpp
@@ -102,6 +102,10 @@ HistoryItem::~HistoryItem()
     ASSERT(!m_cachedPage);
     ASSERT(!m_document);
     iconDatabase()->releaseIconForPageURL(m_urlString);
+#if PLATFORM(ANDROID)
+    if (m_bridge)
+        m_bridge->detachHistoryItem();
+#endif
 }
 
 inline HistoryItem::HistoryItem(const HistoryItem& item)
diff --git a/WebCore/history/android/AndroidWebHistoryBridge.h b/WebCore/history/android/AndroidWebHistoryBridge.h
index 338f37c..b401933 100644
--- a/WebCore/history/android/AndroidWebHistoryBridge.h
+++ b/WebCore/history/android/AndroidWebHistoryBridge.h
@@ -34,11 +34,11 @@ class HistoryItem;
 
 class AndroidWebHistoryBridge : public RefCounted<AndroidWebHistoryBridge> {
 public:
-    AndroidWebHistoryBridge()
+    AndroidWebHistoryBridge(HistoryItem* item)
         : m_scale(100)
         , m_screenWidthScale(100)
         , m_active(false)
-        , m_historyItem(0) { }
+        , m_historyItem(item) { }
     virtual ~AndroidWebHistoryBridge() { }
     virtual void updateHistoryItem(HistoryItem* item) = 0;
 
@@ -46,6 +46,7 @@ public:
     void setScreenWidthScale(int s) { m_screenWidthScale = s; }
     int scale() const { return m_scale; }
     int screenWidthScale() const { return m_screenWidthScale; }
+    void detachHistoryItem() { m_historyItem = 0; }
     HistoryItem* historyItem() const { return m_historyItem; }
     void setActive() { m_active = true; }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list