From 30294edf064e3d5ee3bd2eb3c9e9f8bf4a7696fd Mon Sep 17 00:00:00 2001 From: "mpcomplete@chromium.org" Date: Tue, 10 Nov 2009 00:24:38 +0000 Subject: 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 --- chrome/browser/extensions/extension_function.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'chrome/browser/extensions/extension_function.h') diff --git a/chrome/browser/extensions/extension_function.h b/chrome/browser/extensions/extension_function.h index 2766eb7..be74f36 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(args_.get()); + } + const DictionaryValue* args_as_dictionary() { + return static_cast(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 args_; // The result of the API. This should be populated by the derived class before // SendResponse() is called. -- cgit v1.1