summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_function_dispatcher.h
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-09 20:52:42 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-09 20:52:42 +0000
commitc357acb4058ca346d8e22d29a9d12c72f5d327b4 (patch)
tree8951ca281e3a73c14e5defc119a6ec8723bff67e /chrome/browser/extensions/extension_function_dispatcher.h
parent34d38beaec22c3c958a477097df274669d023aa2 (diff)
downloadchromium_src-c357acb4058ca346d8e22d29a9d12c72f5d327b4.zip
chromium_src-c357acb4058ca346d8e22d29a9d12c72f5d327b4.tar.gz
chromium_src-c357acb4058ca346d8e22d29a9d12c72f5d327b4.tar.bz2
Handle extension webrequest API on the IO thread. This speeds up blocking event
dispatch and handling. BUG=no TEST=should not change functionality Review URL: http://codereview.chromium.org/7024056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88583 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_function_dispatcher.h')
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_function_dispatcher.h b/chrome/browser/extensions/extension_function_dispatcher.h
index a59890e..5ebd6a2 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.h
+++ b/chrome/browser/extensions/extension_function_dispatcher.h
@@ -10,10 +10,13 @@
#include <vector>
#include "base/memory/weak_ptr.h"
+#include "chrome/browser/profiles/profile.h"
+#include "ipc/ipc_message.h"
#include "googleurl/src/gurl.h"
#include "ui/gfx/native_widget_types.h"
class Browser;
+class ChromeRenderMessageFilter;
class Extension;
class ExtensionFunction;
class ListValue;
@@ -72,6 +75,16 @@ class ExtensionFunctionDispatcher
// Resets all functions to their initial implementation.
static void ResetFunctions();
+ // Dispatches an IO-thread extension function. Only used for specific
+ // functions that must be handled on the IO-thread.
+ static void DispatchOnIOThread(
+ const ExtensionInfoMap* extension_info_map,
+ ProfileId profile_id,
+ int render_process_id,
+ base::WeakPtr<ChromeRenderMessageFilter> ipc_sender,
+ int routing_id,
+ const ExtensionHostMsg_Request_Params& params);
+
// Public constructor. Callers must ensure that:
// - |delegate| outlives this object.
// - This object outlives any RenderViewHost's passed to created
@@ -99,8 +112,22 @@ class ExtensionFunctionDispatcher
Profile* profile() { return profile_; }
private:
- // Helper to send an access denied error to the requesting render view.
- void SendAccessDenied(RenderViewHost* render_view_host, int request_id);
+ // Helper to create an ExtensionFunction to handle the function given by
+ // |params|. Can be called on any thread.
+ // Does not set subclass properties, or include_incognito.
+ static ExtensionFunction* CreateExtensionFunction(
+ const ExtensionHostMsg_Request_Params& params,
+ const Extension* extension,
+ ProfileId profile_id,
+ int render_process_id,
+ IPC::Message::Sender* ipc_sender,
+ int routing_id);
+
+ // Helper to send an access denied error to the requesting renderer. Can be
+ // called on any thread.
+ static void SendAccessDenied(IPC::Message::Sender* ipc_sender,
+ int routing_id,
+ int request_id);
Profile* profile_;