Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6795)

Unified Diff: chrome/browser/extensions/extension_function_dispatcher.h

Issue 7024056: Handle extension webrequest API on the IO thread. This speeds up blocking event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_function_dispatcher.h
diff --git a/chrome/browser/extensions/extension_function_dispatcher.h b/chrome/browser/extensions/extension_function_dispatcher.h
index a59890e1ba05995d4deb30e268850104994c94c1..5ebd6a22eb302238d0a82ab5f66667a77623aece 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_;
« no previous file with comments | « chrome/browser/extensions/extension_function.cc ('k') | chrome/browser/extensions/extension_function_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698