diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-01 22:31:35 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-01 22:31:35 +0000 |
commit | de56f378336660dcc848763c80267a5e063ae47d (patch) | |
tree | 7f551b88923b35bc4022ce6ab3a3f602fb60d91c /webkit/glue/glue_serialize.cc | |
parent | dc4f63c80cb90efe594131030aad6776e5945fcc (diff) | |
download | chromium_src-de56f378336660dcc848763c80267a5e063ae47d.zip chromium_src-de56f378336660dcc848763c80267a5e063ae47d.tar.gz chromium_src-de56f378336660dcc848763c80267a5e063ae47d.tar.bz2 |
Merge the chrome_webkit_merge_branch back on to trunk. This brings us
up to webkit@36102.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/glue_serialize.cc')
-rw-r--r-- | webkit/glue/glue_serialize.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/webkit/glue/glue_serialize.cc b/webkit/glue/glue_serialize.cc index 6ec5e7f..925da42 100644 --- a/webkit/glue/glue_serialize.cc +++ b/webkit/glue/glue_serialize.cc @@ -200,12 +200,12 @@ static void WriteFormData(const FormData* form_data, SerializeObject* obj) { } } -static FormData* ReadFormData(const SerializeObject* obj) { +static PassRefPtr<FormData> ReadFormData(const SerializeObject* obj) { int num_elements = ReadInteger(obj); if (num_elements == 0) return NULL; - FormData* form_data = new FormData(); + RefPtr<FormData> form_data = FormData::create(); for (int i = 0; i < num_elements; ++i) { int type = ReadInteger(obj); @@ -219,7 +219,7 @@ static FormData* ReadFormData(const SerializeObject* obj) { } } - return form_data; + return form_data.release(); } // Writes the HistoryItem data into the SerializeObject object for @@ -259,14 +259,14 @@ static void WriteHistoryItem(const HistoryItem* item, SerializeObject* obj) { // Creates a new HistoryItem tree based on the serialized string. // Assumes the data is in the format returned by WriteHistoryItem. -static HistoryItem* ReadHistoryItem(const SerializeObject* obj) { +static PassRefPtr<HistoryItem> ReadHistoryItem(const SerializeObject* obj) { // See note in WriteHistoryItem. on this. obj->version = ReadInteger(obj); if (obj->version > kVersion) return NULL; - HistoryItem* item = new HistoryItem(); + RefPtr<HistoryItem> item = HistoryItem::create(); item->setURLString(ReadString(obj)); item->setOriginalURLString(ReadString(obj)); @@ -302,7 +302,7 @@ static HistoryItem* ReadHistoryItem(const SerializeObject* obj) { for (int i = 0; i < num_children; ++i) item->addChildItem(ReadHistoryItem(obj)); - return item; + return item.release(); } // Serialize a HistoryItem to a string, using our JSON Value serializer. @@ -351,7 +351,8 @@ void HistoryItemToVersionedString(PassRefPtr<HistoryItem> item, int version, } std::string CreateHistoryStateForURL(const GURL& url) { - RefPtr<HistoryItem> item(new HistoryItem(GURLToKURL(url), String())); + // TODO(eseide): We probably should be passing a list visit time other than 0 + RefPtr<HistoryItem> item(HistoryItem::create(GURLToKURL(url), String(), 0)); std::string data; HistoryItemToString(item, &data); return data; |