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

Unified Diff: chrome/browser/extensions/extension_event_router.cc

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
« no previous file with comments | « chrome/browser/extensions/extension_event_router.h ('k') | chrome/browser/extensions/extension_function.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_event_router.cc
diff --git a/chrome/browser/extensions/extension_event_router.cc b/chrome/browser/extensions/extension_event_router.cc
index a86bf1c54d8b3ce6eabcf4b3daf5908a117ef4a7..a5e617a3359dd31493e0fe22ae1ea3816baebc0b 100644
--- a/chrome/browser/extensions/extension_event_router.cc
+++ b/chrome/browser/extensions/extension_event_router.cc
@@ -22,18 +22,6 @@ namespace {
const char kDispatchEvent[] = "Event.dispatchJSON";
-static void DispatchEvent(RenderProcessHost* renderer,
- const std::string& extension_id,
- const std::string& event_name,
- const std::string& event_args,
- const GURL& event_url) {
- ListValue args;
- args.Set(0, Value::CreateStringValue(event_name));
- args.Set(1, Value::CreateStringValue(event_args));
- renderer->Send(new ExtensionMsg_MessageInvoke(MSG_ROUTING_CONTROL,
- extension_id, kDispatchEvent, args, event_url));
-}
-
static void NotifyEventListenerRemovedOnIOThread(
ProfileId profile_id,
const std::string& extension_id,
@@ -62,22 +50,16 @@ struct ExtensionEventRouter::EventListener {
};
// static
-bool ExtensionEventRouter::CanCrossIncognito(Profile* profile,
- const std::string& extension_id) {
- const Extension* extension =
- profile->GetExtensionService()->GetExtensionById(extension_id, false);
- return CanCrossIncognito(profile, extension);
-}
-
-// static
-bool ExtensionEventRouter::CanCrossIncognito(Profile* profile,
- const Extension* extension) {
- // We allow the extension to see events and data from another profile iff it
- // uses "spanning" behavior and it has incognito access. "split" mode
- // extensions only see events for a matching profile.
- return
- (profile->GetExtensionService()->IsIncognitoEnabled(extension->id()) &&
- !extension->incognito_split_mode());
+void ExtensionEventRouter::DispatchEvent(IPC::Message::Sender* ipc_sender,
+ const std::string& extension_id,
+ const std::string& event_name,
+ const std::string& event_args,
+ const GURL& event_url) {
+ ListValue args;
+ args.Set(0, Value::CreateStringValue(event_name));
+ args.Set(1, Value::CreateStringValue(event_args));
+ ipc_sender->Send(new ExtensionMsg_MessageInvoke(MSG_ROUTING_CONTROL,
+ extension_id, kDispatchEvent, args, event_url));
}
ExtensionEventRouter::ExtensionEventRouter(Profile* profile)
« no previous file with comments | « chrome/browser/extensions/extension_event_router.h ('k') | chrome/browser/extensions/extension_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698