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

Issue 6965018: Install CRX updates one at a time. (Closed)

Created:
9 years, 6 months ago by Sam Kerner (Chrome)
Modified:
9 years, 6 months ago
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Install CRX updates one at a time. When we raise the size limit on CRXes, it will become possible to have an extension that takes a long time and lots of CPU to unpack. To avoid starting many resource-intensive unpack jobs at once, update one extension at a time. BUG=80012 TEST=ExtensionUpdaterTest.TestMultipleExtensionDownloadingUpdates*

Patch Set 1 #

Total comments: 17

Patch Set 2 : Address review comments. #

Patch Set 3 : + #

Patch Set 4 : Address review comments. #

Patch Set 5 : Undo moving struct into cc file: Windows compilers choke on it. #

Patch Set 6 : Polish #

Unified diffs Side-by-side diffs Delta from patch set Stats (+247 lines, -36 lines) Patch
M chrome/browser/extensions/crx_installer.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_service.h View 1 2 chunks +13 lines, -6 lines 0 comments Download
M chrome/browser/extensions/extension_service.cc View 1 3 chunks +12 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extension_service_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_updater.h View 1 2 3 4 5 chunks +37 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_updater.cc View 1 2 3 4 8 chunks +73 lines, -11 lines 0 comments Download
M chrome/browser/extensions/extension_updater_unittest.cc View 1 2 3 4 5 10 chunks +94 lines, -7 lines 0 comments Download
M chrome/browser/extensions/test_extension_service.h View 1 2 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/extensions/test_extension_service.cc View 1 2 chunks +7 lines, -3 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Sam Kerner (Chrome)
9 years, 6 months ago (2011-05-31 18:29:08 UTC) #1
Matt Perry
http://codereview.chromium.org/6965018/diff/1/chrome/browser/extensions/crx_installer.cc File chrome/browser/extensions/crx_installer.cc (right): http://codereview.chromium.org/6965018/diff/1/chrome/browser/extensions/crx_installer.cc#newcode127 chrome/browser/extensions/crx_installer.cc:127: // |frontend_weak| can be NULL at this point in ...
9 years, 6 months ago (2011-05-31 21:34:24 UTC) #2
Sam Kerner (Chrome)
Ready for another look. http://codereview.chromium.org/6965018/diff/1/chrome/browser/extensions/crx_installer.cc File chrome/browser/extensions/crx_installer.cc (right): http://codereview.chromium.org/6965018/diff/1/chrome/browser/extensions/crx_installer.cc#newcode127 chrome/browser/extensions/crx_installer.cc:127: // |frontend_weak| can be NULL ...
9 years, 6 months ago (2011-05-31 23:16:15 UTC) #3
Matt Perry
LGTM http://codereview.chromium.org/6965018/diff/1/chrome/browser/extensions/crx_installer.cc File chrome/browser/extensions/crx_installer.cc (right): http://codereview.chromium.org/6965018/diff/1/chrome/browser/extensions/crx_installer.cc#newcode127 chrome/browser/extensions/crx_installer.cc:127: // |frontend_weak| can be NULL at this point ...
9 years, 6 months ago (2011-05-31 23:41:38 UTC) #4
Sam Kerner (Chrome)
http://codereview.chromium.org/6965018/diff/1/chrome/browser/extensions/crx_installer.cc File chrome/browser/extensions/crx_installer.cc (right): http://codereview.chromium.org/6965018/diff/1/chrome/browser/extensions/crx_installer.cc#newcode127 chrome/browser/extensions/crx_installer.cc:127: // |frontend_weak| can be NULL at this point in ...
9 years, 6 months ago (2011-06-01 00:15:10 UTC) #5
Matt Perry
9 years, 6 months ago (2011-06-01 00:20:20 UTC) #6
http://codereview.chromium.org/6965018/diff/1/chrome/browser/extensions/crx_i...
File chrome/browser/extensions/crx_installer.cc (right):

http://codereview.chromium.org/6965018/diff/1/chrome/browser/extensions/crx_i...
chrome/browser/extensions/crx_installer.cc:127: // |frontend_weak| can be NULL
at this point in unit tests.
On 2011/06/01 00:15:11, Sam Kerner (Chrome) wrote:
> On 2011/05/31 23:41:38, Matt Perry wrote:
> > On 2011/05/31 23:16:15, Sam Kerner (Chrome) wrote:
> > > On 2011/05/31 21:34:25, Matt Perry wrote:
> > > > Can we instead pass in a mock ExtensionService in the test? Allowing
NULL
> > for
> > > > unit tests is problematic. It can become confusing when required
> interfaces
> > > can
> > > > be NULL.
> > > 
> > > There is ExtensionServiceInterface, which allows easy mocking.  Sadly,
> > > CrxInstaller uses many methods not in that interface, and adding them all
> > makes
> > > the interface a lot bigger and harder to reason about.  I started down
this
> > > road, and gave up.
> > > 
> > > I could make the mock service used in the test inherit from the real
> extension
> > > service.  This brings in a bunch of behavior the existing tests don't
want.
> > > 
> > > I created an extension service on the testing profile, and used it to
> generate
> > > some CrxInstallers.  Any action the CrxInstallers take is on the testing
> > > profile's extensions service, but I don't want them to take an action.
> > 
> > But I'm confused.. The rest of the code does not NULL-check frontend_weak.
> That
> > seems to indicate it's not actually getting used.
> 
> Not sure what you mean:  There are checks for frontend_weak before every user
> other than the constructor.  They are in the start of
> CrxInstaller::ConfirmInstall() and CrxInstaller::ReportSuccessFromUIThread(). 
> No check is done in the constructor because construction is done by
> ExtensionService::MakeCrxInstaller(), and if you can get there the extension
> service is not null.

Ah, of course, sorry. That makes sense.

> > Also, we don't set install_directory_ or extensions_enabled_. What is the
> > behavior of CrxInstaller if those are unset?
> 
> I reverted all changes to this file after the first round of reviews, so there
> is no case where these two variables will be unset.  We will dereference a
null
> pointer while setting them if frontend_weak is null, but that can't happen in
> the constructor.

I didn't realize you reverted the changes. Carry on, then!

Powered by Google App Engine
This is Rietveld 408576698