diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 00:24:38 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 00:24:38 +0000 |
commit | 30294edf064e3d5ee3bd2eb3c9e9f8bf4a7696fd (patch) | |
tree | 68b98989aba41f5120cd87f16a1c169a9f886150 /chrome/browser/extensions/extension_function.h | |
parent | bed4d801800e5331d24a7328e0caee74b06861c6 (diff) | |
download | chromium_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_function.h')
-rw-r--r-- | chrome/browser/extensions/extension_function.h | 9 |
1 files changed, 8 insertions, 1 deletions
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<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. |