DescriptionAlways destroy CrxInstaller on the UI Thread
CrxInstaller currently just guarantees that its ExtensionInstallPrompt
|client_| data member is destroyed on the UI Thread. But this is not
enough -- CrxInstaller is the InstallPrompt's delegate via a weak
reference, so it can't be destroyed first.
This changes CrxInstaller from a RefCountedThreadSafe to a
RefCountedDeleteOnMessageLoop to ensure the whole thing is destroyed on
the UI thread when all references are gone.
Note that CrxInstaller also owns a ChromeRequirementsChecker which is a
WeakReferenceOwner. WeakReferenceOwners must be destroyed on the thread
that created them, so CrxInstaller being destroyed on the FILE thread
also hits a DCHECK at weak_ptr.cc:20.
Since SandboxedUnpackerClient is the base class that "is" the
RefCountedThreadSafe other classes derived from SandboxedUnpackerClient
are affected. To keep things simple and consistent, they all become
RefCountedDeleteOnMessageLoop.
BUG=410415
TEST=At the webstore: {show an install dialog, then cancel it}. Repeat
many times. Chrome should not crash. Previously a race condition could
be triggered causing Chrome to crash (maybe a 1-in-20 chance).
Committed: https://crrev.com/1e394abd91dbfa362d139fbc7b10fa5d5d2e0631
Cr-Commit-Position: refs/heads/master@{#325339}
Patch Set 1 #Patch Set 2 : Update ownership #Patch Set 3 : Fix test #Patch Set 4 : Fix CrOZ #
Total comments: 4
Patch Set 5 : Less plumbing. More comments #
Messages
Total messages: 14 (6 generated)
|