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

Unified Diff: extensions/browser/extension_host.cc

Issue 1169223002: [Extensions] Clean up the handling of ExtensionHostMsg_Request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 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: extensions/browser/extension_host.cc
diff --git a/extensions/browser/extension_host.cc b/extensions/browser/extension_host.cc
index 124a8fd2ddf3c4ca1502ec2369beb1676c774073..c3e041ae9bf92e005425f71520c98a92bcd0d5b5 100644
--- a/extensions/browser/extension_host.cc
+++ b/extensions/browser/extension_host.cc
@@ -27,6 +27,7 @@
#include "extensions/browser/extension_host_queue.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
+#include "extensions/browser/extension_web_contents_observer.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/load_monitoring_extension_host_queue.h"
#include "extensions/browser/notification_types.h"
@@ -62,7 +63,6 @@ ExtensionHost::ExtensionHost(const Extension* extension,
has_loaded_once_(false),
document_element_available_(false),
initial_url_(url),
- extension_function_dispatcher_(browser_context_, this),
extension_host_type_(host_type) {
// Not used for panels, see PanelHost.
DCHECK(host_type == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE ||
@@ -82,6 +82,9 @@ ExtensionHost::ExtensionHost(const Extension* extension,
// Set up web contents observers and pref observers.
delegate_->OnExtensionHostCreated(host_contents());
+
+ ExtensionWebContentsObserver::GetForWebContents(host_contents())->
+ dispatcher()->set_delegate(this);
}
ExtensionHost::~ExtensionHost() {
@@ -321,7 +324,6 @@ void ExtensionHost::CloseContents(WebContents* contents) {
bool ExtensionHost::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ExtensionHost, message)
- IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest)
IPC_MESSAGE_HANDLER(ExtensionHostMsg_EventAck, OnEventAck)
IPC_MESSAGE_HANDLER(ExtensionHostMsg_IncrementLazyKeepaliveCount,
OnIncrementLazyKeepaliveCount)
@@ -332,10 +334,6 @@ bool ExtensionHost::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-void ExtensionHost::OnRequest(const ExtensionHostMsg_Request_Params& params) {
- extension_function_dispatcher_.Dispatch(params, render_view_host());
-}
-
void ExtensionHost::OnEventAck(int event_id) {
EventRouter* router = EventRouter::Get(browser_context_);
if (router)

Powered by Google App Engine
This is Rietveld 408576698