Index: chrome/browser/extensions/extension_function.h |
diff --git a/chrome/browser/extensions/extension_function.h b/chrome/browser/extensions/extension_function.h |
index 02bab68335e1a1e332ae53ebaa965959dc6f1e45..d763696231c78a61685b1f7198df3a3e163f8d45 100644 |
--- a/chrome/browser/extensions/extension_function.h |
+++ b/chrome/browser/extensions/extension_function.h |
@@ -66,6 +66,15 @@ class ExtensionFunction : public base::RefCounted<ExtensionFunction> { |
virtual void Run() = 0; |
protected: |
+ // Gets the extension that called this function. This can return NULL for |
+ // async functions. |
+ Extension* GetExtension() { |
+ if (dispatcher()) |
+ return dispatcher()->GetExtension(); |
+ else |
+ return NULL; |
+ } |
+ |
// The peer to the dispatcher that will service this extension function call. |
scoped_refptr<ExtensionFunctionDispatcher::Peer> peer_; |