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

Unified Diff: chrome/browser/extensions/extension_history_api.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_history_api.cc
diff --git a/chrome/browser/extensions/extension_history_api.cc b/chrome/browser/extensions/extension_history_api.cc
index ee856de5bb1c2a86bf9edfd19e04137b76460f41..80897add392269bf13b1a95fd55ee0a477e7341f 100644
--- a/chrome/browser/extensions/extension_history_api.cc
+++ b/chrome/browser/extensions/extension_history_api.cc
@@ -201,7 +201,7 @@ void HistoryFunctionWithCallback::SendResponseToCallback() {
bool GetVisitsHistoryFunction::RunAsyncImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY));
- DictionaryValue* json = static_cast<DictionaryValue*>(args_);
+ const DictionaryValue* json = args_as_dictionary();
Value* value;
EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kUrlKey, &value));
@@ -238,7 +238,7 @@ void GetVisitsHistoryFunction::QueryComplete(
bool SearchHistoryFunction::RunAsyncImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY));
- DictionaryValue* json = static_cast<DictionaryValue*>(args_);
+ const DictionaryValue* json = args_as_dictionary();
// Initialize the HistoryQuery
std::wstring search_text;
@@ -288,7 +288,7 @@ void SearchHistoryFunction::SearchComplete(
bool AddUrlHistoryFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY));
- DictionaryValue* json = static_cast<DictionaryValue*>(args_);
+ const DictionaryValue* json = args_as_dictionary();
Value* value;
EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kUrlKey, &value));
@@ -306,7 +306,7 @@ bool AddUrlHistoryFunction::RunImpl() {
bool DeleteUrlHistoryFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY));
- DictionaryValue* json = static_cast<DictionaryValue*>(args_);
+ const DictionaryValue* json = args_as_dictionary();
Value* value;
EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kUrlKey, &value));
@@ -324,7 +324,7 @@ bool DeleteUrlHistoryFunction::RunImpl() {
bool DeleteRangeHistoryFunction::RunAsyncImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY));
- DictionaryValue* json = static_cast<DictionaryValue*>(args_);
+ const DictionaryValue* json = args_as_dictionary();
Value* value = NULL;
EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kStartTimeKey, &value));
« no previous file with comments | « chrome/browser/extensions/extension_function.cc ('k') | chrome/browser/extensions/extension_page_actions_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698