diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-12 01:06:19 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-12 01:06:19 +0000 |
commit | 16095bf0140c955960f2a4a99cc344d2b519b064 (patch) | |
tree | 2f78023b02e97174b4d05895c6256212e160ed57 /chrome/browser/extensions/extension_function.h | |
parent | f0b739902f5235c47637c3ef3a0554189c7e7fbc (diff) | |
download | chromium_src-16095bf0140c955960f2a4a99cc344d2b519b064.zip chromium_src-16095bf0140c955960f2a4a99cc344d2b519b064.tar.gz chromium_src-16095bf0140c955960f2a4a99cc344d2b519b064.tar.bz2 |
Revert "Re-land r84928: Move ExtensionFunctionDispatcher to"
Breaks installation on webstore.
This reverts commit 73ad030f2c57a444b81351b2a1cd8546a6dbddc8.
TBR=mpcomplete@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85084 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_function.h')
-rw-r--r-- | chrome/browser/extensions/extension_function.h | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/chrome/browser/extensions/extension_function.h b/chrome/browser/extensions/extension_function.h index 9ec4ea8..7913703 100644 --- a/chrome/browser/extensions/extension_function.h +++ b/chrome/browser/extensions/extension_function.h @@ -12,9 +12,6 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/extensions/extension_function_dispatcher.h" -#include "content/browser/browser_thread.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" class ExtensionFunctionDispatcher; class ListValue; @@ -40,14 +37,10 @@ class Value; // Abstract base class for extension functions the ExtensionFunctionDispatcher // knows how to dispatch to. -class ExtensionFunction - : public base::RefCountedThreadSafe<ExtensionFunction, - BrowserThread::DeleteOnUIThread> { +class ExtensionFunction : public base::RefCountedThreadSafe<ExtensionFunction> { public: ExtensionFunction(); - virtual ~ExtensionFunction(); - // Specifies the name of the function. void set_name(const std::string& name) { name_ = name; } const std::string name() const { return name_; } @@ -63,9 +56,6 @@ class ExtensionFunction } std::string extension_id() const { return extension_id_; } - void SetRenderViewHost(RenderViewHost* render_view_host); - RenderViewHost* render_view_host() const { return render_view_host_; } - // Specifies the raw arguments to the function, as a JSON value. virtual void SetArgs(const ListValue* args) = 0; @@ -112,6 +102,8 @@ class ExtensionFunction protected: friend class base::RefCountedThreadSafe<ExtensionFunction>; + virtual ~ExtensionFunction(); + // Gets the extension that called this function. This can return NULL for // async functions, for example if the extension is unloaded while the // function is running. @@ -138,9 +130,6 @@ class ExtensionFunction // The peer to the dispatcher that will service this extension function call. scoped_refptr<ExtensionFunctionDispatcher::Peer> peer_; - // The RenderViewHost we will send responses too. - RenderViewHost* render_view_host_; - // Id of this request, used to map the response back to the caller. int request_id_; @@ -169,26 +158,6 @@ class ExtensionFunction // True if the call was made in response of user gesture. bool user_gesture_; - private: - // Helper class to track the lifetime of ExtensionFunction's RenderViewHost - // pointer and NULL it out when it dies. We use this separate class (instead - // of implementing NotificationObserver on ExtensionFunction) because it is - // common for subclasses of ExtensionFunction to be NotificationObservers, and - // it would be an easy error to forget to call the base class's Observe() - // method. - class RenderViewHostTracker : public NotificationObserver { - public: - explicit RenderViewHostTracker(ExtensionFunction* extension_function); - private: - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - ExtensionFunction* function_; - NotificationRegistrar registrar_; - }; - - scoped_ptr<RenderViewHostTracker> tracker_; - DISALLOW_COPY_AND_ASSIGN(ExtensionFunction); }; @@ -235,13 +204,6 @@ class AsyncExtensionFunction : public ExtensionFunction { // returning. The calling renderer process will be killed. bool bad_message_; - private: - // Called when we receive an extension api request that is invalid in a way - // that JSON validation in the renderer should have caught. This should never - // happen and could be an attacker trying to exploit the browser, so we crash - // the renderer instead. - void HandleBadMessage(); - DISALLOW_COPY_AND_ASSIGN(AsyncExtensionFunction); }; |