OSDN Git Service

Modify AndroidWebHistoryBridge to prepare uploading
authorGrace Kloba <klobag@google.com>
Mon, 7 Dec 2009 22:27:17 +0000 (14:27 -0800)
committerGrace Kloba <klobag@google.com>
Mon, 7 Dec 2009 22:27:17 +0000 (14:27 -0800)
detachHistoryItem() to WebKit.

I think it is easy to read this way that the constructor
sets the m_historyItem and the new method will detach it.

WebCore/history/android/AndroidWebHistoryBridge.h
WebKit/android/jni/WebHistory.cpp
WebKit/android/jni/WebHistory.h

index b15cc86..b401933 100644 (file)
@@ -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;
 
index 3741e03..71cd416 100644 (file)
@@ -225,12 +225,9 @@ jbyteArray WebHistory::Flatten(JNIEnv* env, WTF::Vector<char>& v, WebCore::Histo
 }
 
 WebHistoryItem::WebHistoryItem(JNIEnv* env, jobject obj,
-        WebCore::HistoryItem* item) {
+        WebCore::HistoryItem* item) : WebCore::AndroidWebHistoryBridge(item) {
     m_object = adoptGlobalRef(env, obj);
     m_parent = 0;
-    m_scale = 100;
-    m_active = false;
-    m_historyItem = item;
 }
 
 WebHistoryItem::~WebHistoryItem() {
index baba1fd..b961872 100644 (file)
@@ -50,7 +50,7 @@ public:
 class WebHistoryItem : public WebCore::AndroidWebHistoryBridge {
 public:
     WebHistoryItem(WebHistoryItem* parent)
-        : WebCore::AndroidWebHistoryBridge()
+        : WebCore::AndroidWebHistoryBridge(0)
         , m_parent(parent)
         , m_object(NULL) { }
     WebHistoryItem(JNIEnv*, jobject, WebCore::HistoryItem*);