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

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: fix broken test 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..5dd8f48ae23b8182580cc672444fcd07ddc0ed30 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,23 @@ 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 creates an ExtensionFunction to handle the function given by
+ // |params|. Can be called on any thread.
+ // Does not set all properties - particularly, RenderViewHost, Profile, and
Mihai Parparita -not on Chrome 2011/06/08 01:11:59 RenderViewHost, Profile and dispatcher are all UIT
Matt Perry 2011/06/08 20:47:00 Done.
+ // dispatcher.
+ 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_;

Powered by Google App Engine
This is Rietveld 408576698