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

Issue 1521039: Allow extension overinstall (Closed)

Created:
10 years, 8 months ago by Aaron Boodman
Modified:
9 years, 6 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Allow extensions to be overinstalled with extensions of same version. This is useful during development, for switching themes, and for user scripts (since user scripts have no development mode). Since we can't always immediately delete the version directory for an extension after unloading it (because some files might be in use), this required changing the directory layout of the extensions directory to allow multiple copies of the same version of the same extension to be present at once. This was done by adding a counter to the version directory name. Also get rid of all the old "Current Version" cruft, since we no longer use that. BUG=26538 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=47740

Patch Set 1 #

Total comments: 9

Patch Set 2 : rebase #

Patch Set 3 : fixes #

Total comments: 15

Patch Set 4 : blargh #

Unified diffs Side-by-side diffs Delta from patch set Stats (+192 lines, -435 lines) Patch
M chrome/browser/automation/automation_provider_observers.cc View 1 2 4 chunks +0 lines, -8 lines 0 comments Download
M chrome/browser/extensions/crx_installer.h View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/extensions/crx_installer.cc View 1 2 3 3 chunks +17 lines, -40 lines 0 comments Download
M chrome/browser/extensions/extension_browsertest.cc View 1 3 chunks +0 lines, -9 lines 0 comments Download
M chrome/browser/extensions/extension_install_ui.h View 1 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extension_install_ui.cc View 1 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/extensions/extension_management_browsertest.cc View 1 2 3 2 chunks +13 lines, -5 lines 0 comments Download
M chrome/browser/extensions/extensions_service.h View 1 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extensions_service.cc View 1 2 5 chunks +35 lines, -81 lines 0 comments Download
M chrome/browser/extensions/extensions_service_unittest.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/common/extensions/extension_file_util.h View 1 2 3 2 chunks +21 lines, -52 lines 0 comments Download
M chrome/common/extensions/extension_file_util.cc View 1 2 3 5 chunks +52 lines, -119 lines 0 comments Download
M chrome/common/extensions/extension_file_util_unittest.cc View 1 2 3 1 chunk +48 lines, -91 lines 0 comments Download
M chrome/common/notification_type.h View 1 2 2 chunks +1 line, -6 lines 0 comments Download
M chrome/test/automation/automation_constants.h View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/automation/automation_messages.h View 1 2 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Aaron Boodman
Recommended review order: The meat of this change is in extension_file_util.*. Start at InstallExtension() and ...
10 years, 8 months ago (2010-04-17 00:22:11 UTC) #1
Erik does not do reviews
Nice cleanup. It's nice to see that nothing else was depending on the version number ...
10 years, 8 months ago (2010-04-19 19:59:35 UTC) #2
Aaron Boodman
PTAL http://codereview.chromium.org/1521039/diff/1/2 File chrome/browser/automation/automation_provider_observers.cc (left): http://codereview.chromium.org/1521039/diff/1/2#oldcode376 chrome/browser/automation/automation_provider_observers.cc:376: registrar_.Add(this, NotificationType::EXTENSION_OVERINSTALL_ERROR, On 2010/04/19 19:59:36, Erik Kay wrote: ...
10 years, 7 months ago (2010-05-19 01:07:40 UTC) #3
rafaelw
lgtm w/ nits. http://codereview.chromium.org/1521039/diff/10001/11002 File chrome/browser/extensions/crx_installer.cc (right): http://codereview.chromium.org/1521039/diff/10001/11002#newcode226 chrome/browser/extensions/crx_installer.cc:226: unpacked_extension_root_, extension_->id(), extension_->VersionString(), these should all ...
10 years, 7 months ago (2010-05-19 20:15:47 UTC) #4
Aaron Boodman
10 years, 7 months ago (2010-05-19 21:44:21 UTC) #5
fyi

http://codereview.chromium.org/1521039/diff/10001/11002
File chrome/browser/extensions/crx_installer.cc (right):

http://codereview.chromium.org/1521039/diff/10001/11002#newcode226
chrome/browser/extensions/crx_installer.cc:226: unpacked_extension_root_,
extension_->id(), extension_->VersionString(),
On 2010/05/19 20:15:47, rafaelw wrote:
> these should all go on separate lines (darin beat this one into me):
> 
>
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Functi...

Done.

http://codereview.chromium.org/1521039/diff/10001/11002#newcode230
chrome/browser/extensions/crx_installer.cc:230: "Could not copy unpacked
extension to install location.");
On 2010/05/19 20:15:47, rafaelw wrote:
> Did you intentionally ditch the
> i10n_util::GetStringUTF8(IDS_EXTENSION_MOVE_DIRECTORY_TO_PROFILE_FAILED) ?
> 
> if so, does the resource string need to be garbage collected?

Done.

http://codereview.chromium.org/1521039/diff/10001/11007
File chrome/browser/extensions/extension_management_browsertest.cc (right):

http://codereview.chromium.org/1521039/diff/10001/11007#newcode21
chrome/browser/extensions/extension_management_browsertest.cc:21: // as well as
asking the extension itself.
On 2010/05/19 20:15:47, rafaelw wrote:
> Can you add a note here explaining the difference between the manifest version
> and then "version()" as reported by the background page?

Done.

http://codereview.chromium.org/1521039/diff/10001/11011
File chrome/common/extensions/extension_file_util.cc (right):

http://codereview.chromium.org/1521039/diff/10001/11011#newcode55
chrome/common/extensions/extension_file_util.cc:55: } else if (i ==
(kMaxAttempts - 1)) {
On 2010/05/19 20:15:47, rafaelw wrote:
> consider declaring |i| outside the for loop and doing this test when the loop
> completes, to avoid having to do this test for each iteration?

Good idea. Makes it easier to read too.

http://codereview.chromium.org/1521039/diff/10001/11012
File chrome/common/extensions/extension_file_util.h (right):

http://codereview.chromium.org/1521039/diff/10001/11012#newcode31
chrome/common/extensions/extension_file_util.h:31: // Removes all versions from
the extension |id| from |extensions_dir|.
On 2010/05/19 20:15:47, rafaelw wrote:
> "Removes all versions of the extension with |id| from |extensions_dir|" ?

Done.

http://codereview.chromium.org/1521039/diff/10001/11012#newcode45
chrome/common/extensions/extension_file_util.h:45: // Clean up directories that
aren't valid extensions from the install directory.
On 2010/05/19 20:15:47, rafaelw wrote:
> Can you add commentary about the input params?

Done.

http://codereview.chromium.org/1521039/diff/10001/11013
File chrome/common/extensions/extension_file_util_unittest.cc (right):

http://codereview.chromium.org/1521039/diff/10001/11013#newcode60
chrome/common/extensions/extension_file_util_unittest.cc:60:
extension_file_util::GarbageCollectExtensions(all_extensions,extension_paths);
On 2010/05/19 20:15:47, rafaelw wrote:
> nit: space after first arg.

Done.

Powered by Google App Engine
This is Rietveld 408576698