summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_page_actions_module.cc
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-10 00:24:38 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-10 00:24:38 +0000
commit30294edf064e3d5ee3bd2eb3c9e9f8bf4a7696fd (patch)
tree68b98989aba41f5120cd87f16a1c169a9f886150 /chrome/browser/extensions/extension_page_actions_module.cc
parentbed4d801800e5331d24a7328e0caee74b06861c6 (diff)
downloadchromium_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_page_actions_module.cc')
-rw-r--r--chrome/browser/extensions/extension_page_actions_module.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/extensions/extension_page_actions_module.cc b/chrome/browser/extensions/extension_page_actions_module.cc
index 528f5a4..ace9317 100644
--- a/chrome/browser/extensions/extension_page_actions_module.cc
+++ b/chrome/browser/extensions/extension_page_actions_module.cc
@@ -32,7 +32,7 @@ const char kNoIconSpecified[] = "Page action has no icons to show.";
// TODO(EXTENSIONS_DEPRECATED): obsolete API.
bool PageActionFunction::SetPageActionEnabled(bool enable) {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_LIST));
- const ListValue* args = static_cast<const ListValue*>(args_);
+ const ListValue* args = args_as_list();
std::string page_action_id;
EXTENSION_FUNCTION_VALIDATE(args->GetString(0, &page_action_id));
@@ -141,7 +141,7 @@ bool PageActionHideFunction::RunImpl() {
bool PageActionSetIconFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY));
- const DictionaryValue* args = static_cast<const DictionaryValue*>(args_);
+ const DictionaryValue* args = args_as_dictionary();
int tab_id;
EXTENSION_FUNCTION_VALIDATE(args->GetInteger(L"tabId", &tab_id));
@@ -177,7 +177,7 @@ bool PageActionSetIconFunction::RunImpl() {
bool PageActionSetTitleFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY));
- const DictionaryValue* args = static_cast<const DictionaryValue*>(args_);
+ const DictionaryValue* args = args_as_dictionary();
int tab_id;
EXTENSION_FUNCTION_VALIDATE(args->GetInteger(L"tabId", &tab_id));
@@ -196,7 +196,7 @@ bool PageActionSetTitleFunction::RunImpl() {
// extension_function_dispatcher.
bool PageActionSetBadgeBackgroundColorFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY));
- const DictionaryValue* args = static_cast<const DictionaryValue*>(args_);
+ const DictionaryValue* args = args_as_dictionary();
int tab_id;
EXTENSION_FUNCTION_VALIDATE(args->GetInteger(L"tabId", &tab_id));
@@ -222,7 +222,7 @@ bool PageActionSetBadgeBackgroundColorFunction::RunImpl() {
// extension_function_dispatcher.
bool PageActionSetBadgeTextColorFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY));
- const DictionaryValue* args = static_cast<const DictionaryValue*>(args_);
+ const DictionaryValue* args = args_as_dictionary();
int tab_id;
EXTENSION_FUNCTION_VALIDATE(args->GetInteger(L"tabId", &tab_id));
@@ -248,7 +248,7 @@ bool PageActionSetBadgeTextColorFunction::RunImpl() {
// extension_function_dispatcher.
bool PageActionSetBadgeTextFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY));
- const DictionaryValue* args = static_cast<const DictionaryValue*>(args_);
+ const DictionaryValue* args = args_as_dictionary();
int tab_id;
EXTENSION_FUNCTION_VALIDATE(args->GetInteger(L"tabId", &tab_id));