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

Unified Diff: chrome/browser/extensions/extension_function.h

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_function.h
diff --git a/chrome/browser/extensions/extension_function.h b/chrome/browser/extensions/extension_function.h
index 2766eb7b6c71b5eb36560c0cdf1e37cd615a4f7c..be74f36509c57c09784868bb6deda342e00f2a27 100644
--- a/chrome/browser/extensions/extension_function.h
+++ b/chrome/browser/extensions/extension_function.h
@@ -124,13 +124,20 @@ class AsyncExtensionFunction : public ExtensionFunction {
void SendResponse(bool success);
+ const ListValue* args_as_list() {
+ return static_cast<ListValue*>(args_.get());
+ }
+ const DictionaryValue* args_as_dictionary() {
+ return static_cast<DictionaryValue*>(args_.get());
+ }
+
// Note: After Run() returns, dispatcher() can be NULL. Since these getters
// rely on dispatcher(), make sure it is valid before using them.
std::string extension_id();
Profile* profile();
// The arguments to the API. Only non-null if argument were specified.
- Value* args_;
+ scoped_ptr<Value> args_;
// The result of the API. This should be populated by the derived class before
// SendResponse() is called.
« no previous file with comments | « chrome/browser/extensions/extension_browser_actions_api.cc ('k') | chrome/browser/extensions/extension_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698