diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 06:24:35 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 06:24:35 +0000 |
commit | 474a38fc5b87adffa43cb75d1cb81114ec5a0843 (patch) | |
tree | b1ba7e3bb714a33485ed0037cacdad747a1b2244 /chrome/browser/extensions/extension_function.h | |
parent | 76b6d6a9d0bfd4331cd13c77aede5df81bccda97 (diff) | |
download | chromium_src-474a38fc5b87adffa43cb75d1cb81114ec5a0843.zip chromium_src-474a38fc5b87adffa43cb75d1cb81114ec5a0843.tar.gz chromium_src-474a38fc5b87adffa43cb75d1cb81114ec5a0843.tar.bz2 |
Looks like this introduced leaks in sync ui tests. Sigh.
Revert "Move ExtensionFunctionDispatcher to ExtensionTabHelper. This"
This reverts commit 4f08bad13a0cb2e40835869a9a7d9edb16a5be9a.
Revert "Fix clang warning."
This reverts commit 1663f72a9360677aad91a9417b44afd03a41181f.
Revert "Fix chrome os"
This reverts commit 1abb1afe1b78de4bc92a82fdd1e266166bc74707.
TBR=mpcomplete@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84941 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 2148f8a..7913703 100644 --- a/chrome/browser/extensions/extension_function.h +++ b/chrome/browser/extensions/extension_function.h @@ -11,9 +11,6 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "content/browser/browser_thread.h" -#include "content/common/notification_observer.h" -#include "content/common/notification_registrar.h" #include "chrome/browser/extensions/extension_function_dispatcher.h" class ExtensionFunctionDispatcher; @@ -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); }; |