Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1425)

Unified Diff: chrome/browser/extensions/extension_page_actions_module.cc

Issue 377036: Fix memory leak in AsyncExtensionFunction. (Closed)
Patch Set: feedback Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_page_actions_module.cc
diff --git a/chrome/browser/extensions/extension_page_actions_module.cc b/chrome/browser/extensions/extension_page_actions_module.cc
index 528f5a44f4f56cdd42e1b6942adc8dd5f7cf3aa4..ace93174c21d3146f3a193ef30993595959670ce 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));
« no previous file with comments | « chrome/browser/extensions/extension_history_api.cc ('k') | chrome/browser/extensions/extension_popup_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698