Commit 21246404 authored by ericzeng@chromium.org's avatar ericzeng@chromium.org

Remove unneccessary arguments from extensions::DispatcherDelegate

This CL removes three arguments from the RequireAdditionalModules method
since only the ScriptContext is needed to get those values.

BUG=todo

Review URL: https://codereview.chromium.org/442553002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287480 0039d316-1c4b-4281-b951-d872f2087c98
parent c9a896b1
......@@ -262,10 +262,11 @@ void ChromeExtensionsDispatcherDelegate::PopulateSourceMap(
}
void ChromeExtensionsDispatcherDelegate::RequireAdditionalModules(
extensions::ModuleSystem* module_system,
const extensions::Extension* extension,
extensions::Feature::Context context_type,
extensions::ScriptContext* context,
bool is_within_platform_app) {
extensions::ModuleSystem* module_system = context->module_system();
extensions::Feature::Context context_type = context->context_type();
// TODO(kalman, fsamuel): Eagerly calling Require on context startup is
// expensive. It would be better if there were a light way of detecting when
// a webview or appview is created and only then set up the infrastructure.
......@@ -277,6 +278,8 @@ void ChromeExtensionsDispatcherDelegate::RequireAdditionalModules(
module_system->Require("windowControls");
}
const extensions::Extension* extension = context->extension();
// We used to limit WebView to |BLESSED_EXTENSION_CONTEXT| within platform
// apps. An ext/app runs in a blessed extension context, if it is the active
// extension in the current process, in other words, if it is loaded in a top
......
......@@ -30,11 +30,8 @@ class ChromeExtensionsDispatcherDelegate
extensions::ScriptContext* context) OVERRIDE;
virtual void PopulateSourceMap(
extensions::ResourceBundleSourceMap* source_map) OVERRIDE;
virtual void RequireAdditionalModules(
extensions::ModuleSystem* module_system,
const extensions::Extension* extension,
extensions::Feature::Context context_type,
bool is_within_platform_app) OVERRIDE;
virtual void RequireAdditionalModules(extensions::ScriptContext* context,
bool is_within_platform_app) OVERRIDE;
virtual void OnActiveExtensionsUpdated(
const std::set<std::string>& extensions_ids) OVERRIDE;
virtual void SetChannel(int channel) OVERRIDE;
......
......@@ -304,8 +304,7 @@ void Dispatcher::DidCreateScriptContext(
module_system->Require("platformApp");
}
delegate_->RequireAdditionalModules(
module_system, extension, context_type, is_within_platform_app);
delegate_->RequireAdditionalModules(context, is_within_platform_app);
VLOG(1) << "Num tracked contexts: " << script_context_set_.size();
}
......
......@@ -42,7 +42,7 @@ class DispatcherDelegate {
virtual void InitOriginPermissions(const Extension* extension,
bool is_extension_active) {}
// Includes additional native handlers in a given ModuleSystem.
// Includes additional native handlers in a ScriptContext's ModuleSystem.
virtual void RegisterNativeHandlers(Dispatcher* dispatcher,
ModuleSystem* module_system,
ScriptContext* context) {}
......@@ -51,9 +51,7 @@ class DispatcherDelegate {
virtual void PopulateSourceMap(ResourceBundleSourceMap* source_map) {}
// Requires additional modules within an extension context's module system.
virtual void RequireAdditionalModules(ModuleSystem* module_system,
const Extension* extension,
Feature::Context context_type,
virtual void RequireAdditionalModules(ScriptContext* context,
bool is_within_platform_app) {}
// Allows the delegate to respond to an updated set of active extensions in
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment