Commit 1daebe76 authored by mukai@chromium.org's avatar mukai@chromium.org

Do not invoke SetNaClArch if the hotword extension is new enough.

This would be essentially harmless, but setting 'nacl arch'
in StartPageHandler means allowing embed of the hotword plugin,
which consumes memory and CPU. Because it communicates with
the hotword extension directly, this plugin is unused at all.

BUG=393321
R=xiyuan@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283745 0039d316-1c4b-4281-b951-d872f2087c98
parent 5ba56f05
......@@ -177,11 +177,20 @@ void StartPageHandler::HandleInitialize(const base::ListValue* args) {
extension_registry_observer_.Add(
extensions::ExtensionRegistry::Get(profile));
}
#endif
extensions::ExtensionRegistry* registry =
extensions::ExtensionRegistry::Get(profile);
const extensions::Extension* hotword_extension =
registry->GetExtensionById(extension_misc::kHotwordExtensionId,
extensions::ExtensionRegistry::ENABLED);
if (hotword_extension &&
hotword_extension->version()->CompareTo(
base::Version(kOldHotwordExtensionVersionString)) <= 0) {
web_ui()->CallJavascriptFunction(
"appList.startPage.setNaclArch",
base::StringValue(omaha_query_params::OmahaQueryParams::GetNaclArch()));
}
#endif
if (!app_list::switches::IsExperimentalAppListEnabled()) {
web_ui()->CallJavascriptFunction(
......
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