Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Install enabled by default
Browse files Browse the repository at this point in the history
We were sending an async message to the extension system to
install the extension, and then calling the callback sync which would
enable.  But enable wouldn't find the extension because it wasn't loaded
yet.

This fixes that race condition as reported in #4425.

I know we may want to load without enabling at some point,
but we don't do that today, so I didn't bother adding a different event
for that yet.

There is also a browser-laptop issue coming soon.

Auditors: @bridiver
  • Loading branch information
bbondy committed Oct 2, 2016
1 parent 05c0198 commit 43f9830
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion atom/browser/extensions/atom_extension_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,10 @@ void AtomExtensionSystem::Shared::Observe(int type,
const Extension* extension =
content::Details<const Extension>(details).ptr();

if (extension)
if (extension) {
AddExtension(extension);
EnableExtension(extension->id());

This comment has been minimized.

Copy link
@bridiver

bridiver Oct 2, 2016

Collaborator

this doesn't seem right to me. AddExtension already enables the extension at line 368. I think if anything you want to call EnableExtension in place of registry_->AddEnabled(extension); on that line

}

break;
}
Expand Down

0 comments on commit 43f9830

Please sign in to comment.