diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 07:59:56 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 07:59:56 +0000 |
commit | 0dd4f5fa7b9b01132c1b8609f2b9e474544938f0 (patch) | |
tree | 980120c427f57dc11695ffe390c99c5d84435a5b /chrome | |
parent | cc91e16a9b3da5ccf96c4b929b60400be966e9fe (diff) | |
download | chromium_src-0dd4f5fa7b9b01132c1b8609f2b9e474544938f0.zip chromium_src-0dd4f5fa7b9b01132c1b8609f2b9e474544938f0.tar.gz chromium_src-0dd4f5fa7b9b01132c1b8609f2b9e474544938f0.tar.bz2 |
Fixed invalid read in ExtensionsServiceTest.ReloadExtensions.
BUG=47843,47863
TEST=unittests, valgrind
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=51215
Review URL: http://codereview.chromium.org/2872024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/extensions/extension_updater.cc | 10 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_updater.h | 1 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_updater_unittest.cc | 3 | ||||
-rw-r--r-- | chrome/browser/sync/glue/extension_util.cc | 5 | ||||
-rw-r--r-- | chrome/browser/sync/glue/extension_util_unittest.cc | 6 |
5 files changed, 4 insertions, 21 deletions
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc index c3b1907..ef064cd 100644 --- a/chrome/browser/extensions/extension_updater.cc +++ b/chrome/browser/extensions/extension_updater.cc @@ -161,7 +161,6 @@ void ManifestFetchesBuilder::AddExtension(const Extension& extension) { AddExtensionData(extension.location(), extension.id(), *extension.version(), - extension.converted_from_user_script(), extension.is_theme(), extension.update_url()); } @@ -175,7 +174,7 @@ void ManifestFetchesBuilder::AddPendingExtension( scoped_ptr<Version> version( Version::GetVersionFromString("0.0.0.0")); AddExtensionData(Extension::INTERNAL, id, *version, - false, info.is_theme, info.update_url); + info.is_theme, info.update_url); } void ManifestFetchesBuilder::ReportStats() const { @@ -209,7 +208,6 @@ void ManifestFetchesBuilder::AddExtensionData( Extension::Location location, const std::string& id, const Version& version, - bool converted_from_user_script, bool is_theme, GURL update_url) { // Only internal and external extensions can be autoupdated. @@ -231,12 +229,6 @@ void ManifestFetchesBuilder::AddExtensionData( return; } - // Skip extensions with empty update URLs converted from user - // scripts. - if (converted_from_user_script && update_url.is_empty()) { - return; - } - if (update_url.DomainIs("google.com")) { url_stats_.google_url_count++; } else if (update_url.is_empty()) { diff --git a/chrome/browser/extensions/extension_updater.h b/chrome/browser/extensions/extension_updater.h index 968aa2b..2b7dec3 100644 --- a/chrome/browser/extensions/extension_updater.h +++ b/chrome/browser/extensions/extension_updater.h @@ -110,7 +110,6 @@ class ManifestFetchesBuilder { void AddExtensionData(Extension::Location location, const std::string& id, const Version& version, - bool converted_from_user_script, bool is_theme, GURL update_url); diff --git a/chrome/browser/extensions/extension_updater_unittest.cc b/chrome/browser/extensions/extension_updater_unittest.cc index 416a395..0895501 100644 --- a/chrome/browser/extensions/extension_updater_unittest.cc +++ b/chrome/browser/extensions/extension_updater_unittest.cc @@ -891,9 +891,6 @@ TEST(ExtensionUpdaterTest, TestManifestFetchesBuilderAddExtension) { "", PendingExtensionInfo(GURL(), false, false, true, false)); EXPECT_TRUE(builder.GetFetches().empty()); - // TODO(akalin): Test that extensions with empty update URLs - // converted from user scripts are rejected. - // Extensions with empty update URLs should have a default one // filled in. builder.AddPendingExtension( diff --git a/chrome/browser/sync/glue/extension_util.cc b/chrome/browser/sync/glue/extension_util.cc index 0ff226c..d34eafe 100644 --- a/chrome/browser/sync/glue/extension_util.cc +++ b/chrome/browser/sync/glue/extension_util.cc @@ -27,11 +27,6 @@ bool IsExtensionSyncable(const Extension& extension) { return false; } - if (extension.converted_from_user_script()) { - // User scripts currently don't have auto-update URLs. - return false; - } - // TODO(akalin): Figure out if we need to allow some other types. if (extension.location() != Extension::INTERNAL) { // We have a non-standard location. diff --git a/chrome/browser/sync/glue/extension_util_unittest.cc b/chrome/browser/sync/glue/extension_util_unittest.cc index 17305acd..e439f08b 100644 --- a/chrome/browser/sync/glue/extension_util_unittest.cc +++ b/chrome/browser/sync/glue/extension_util_unittest.cc @@ -72,14 +72,14 @@ TEST_F(ExtensionUtilTest, IsSyncableExtension) { { FilePath file_path(kExtensionFilePath); Extension extension(file_path); - MakePossiblySyncableExtension(true, GURL(), false, + MakePossiblySyncableExtension(false, GURL(), true, Extension::INTERNAL, &extension); - EXPECT_FALSE(IsExtensionSyncable(extension)); + EXPECT_TRUE(IsExtensionSyncable(extension)); } { FilePath file_path(kExtensionFilePath); Extension extension(file_path); - MakePossiblySyncableExtension(false, GURL(), true, + MakePossiblySyncableExtension(true, GURL(), false, Extension::INTERNAL, &extension); EXPECT_FALSE(IsExtensionSyncable(extension)); } |