diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 00:24:38 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 00:24:38 +0000 |
commit | 30294edf064e3d5ee3bd2eb3c9e9f8bf4a7696fd (patch) | |
tree | 68b98989aba41f5120cd87f16a1c169a9f886150 /chrome/browser/extensions/extension_bookmarks_module.cc | |
parent | bed4d801800e5331d24a7328e0caee74b06861c6 (diff) | |
download | chromium_src-30294edf064e3d5ee3bd2eb3c9e9f8bf4a7696fd.zip chromium_src-30294edf064e3d5ee3bd2eb3c9e9f8bf4a7696fd.tar.gz chromium_src-30294edf064e3d5ee3bd2eb3c9e9f8bf4a7696fd.tar.bz2 |
Fix memory leak in AsyncExtensionFunction.
BUG=27196
Review URL: http://codereview.chromium.org/377036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_bookmarks_module.cc')
-rw-r--r-- | chrome/browser/extensions/extension_bookmarks_module.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/extensions/extension_bookmarks_module.cc b/chrome/browser/extensions/extension_bookmarks_module.cc index ee5257c..fb9bc47 100644 --- a/chrome/browser/extensions/extension_bookmarks_module.cc +++ b/chrome/browser/extensions/extension_bookmarks_module.cc @@ -277,7 +277,7 @@ bool GetBookmarksFunction::RunImpl() { BookmarkModel* model = profile()->GetBookmarkModel(); scoped_ptr<ListValue> json(new ListValue()); if (args_->IsType(Value::TYPE_LIST)) { - ListValue* ids = static_cast<ListValue*>(args_); + const ListValue* ids = args_as_list(); size_t count = ids->GetSize(); EXTENSION_FUNCTION_VALIDATE(count > 0); for (size_t i = 0; i < count; ++i) { @@ -379,7 +379,7 @@ bool RemoveBookmarkFunction::RunImpl() { return ExtensionBookmarks::RemoveNode(model, id, recursive, &error_); } else { EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_LIST)); - ListValue* ids = static_cast<ListValue*>(args_); + const ListValue* ids = args_as_list(); size_t count = ids->GetSize(); EXTENSION_FUNCTION_VALIDATE(count > 0); for (size_t i = 0; i < count; ++i) { @@ -395,7 +395,7 @@ bool RemoveBookmarkFunction::RunImpl() { bool CreateBookmarkFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY)); - DictionaryValue* json = static_cast<DictionaryValue*>(args_); + const DictionaryValue* json = args_as_dictionary(); BookmarkModel* model = profile()->GetBookmarkModel(); int64 parentId; @@ -459,7 +459,7 @@ bool CreateBookmarkFunction::RunImpl() { bool MoveBookmarkFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_LIST)); - const ListValue* args = static_cast<const ListValue*>(args_); + const ListValue* args = args_as_list(); int64 id; std::string id_string; EXTENSION_FUNCTION_VALIDATE(args->GetString(0, &id_string)); @@ -527,7 +527,7 @@ bool MoveBookmarkFunction::RunImpl() { bool UpdateBookmarkFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_LIST)); - const ListValue* args = static_cast<const ListValue*>(args_); + const ListValue* args = args_as_list(); int64 id; std::string id_string; EXTENSION_FUNCTION_VALIDATE(args->GetString(0, &id_string)); |