diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 22:10:01 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 22:10:01 +0000 |
commit | dd19d64a0d55eea06060c1f0a4b2d48d0c6d94cc (patch) | |
tree | 71db4e553ffbe6281efa339273645a2354c1eb43 /chrome | |
parent | 27937bdc5b5199c82784c90fb2af4746a7054895 (diff) | |
download | chromium_src-dd19d64a0d55eea06060c1f0a4b2d48d0c6d94cc.zip chromium_src-dd19d64a0d55eea06060c1f0a4b2d48d0c6d94cc.tar.gz chromium_src-dd19d64a0d55eea06060c1f0a4b2d48d0c6d94cc.tar.bz2 |
Fix build.
TBR=erikkay
Review URL: http://codereview.chromium.org/118337
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/extensions/extensions_service.cc | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index 2d8b039..bf38f97 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -330,10 +330,10 @@ void ExtensionsService::OnExtensionsLoaded(ExtensionList* new_extensions) { iter != new_extensions->end(); ++iter) { std::wstring extension_id = ASCIIToWide((*iter)->id()); pref = GetOrCreateExtensionPref(extension_id); - Extension::Location location; - Extension::State state; - if (!pref->GetInteger(kLocation, reinterpret_cast<int*>(&location)) || - !pref->GetInteger(kState, reinterpret_cast<int*>(&state))) { + int location; + int state; + if (!pref->GetInteger(kLocation, &location) || + !pref->GetInteger(kState, &state)) { UpdateExtensionPref(extension_id, kLocation, Value::CreateIntegerValue(Extension::INTERNAL), false); UpdateExtensionPref(extension_id, @@ -342,8 +342,10 @@ void ExtensionsService::OnExtensionsLoaded(ExtensionList* new_extensions) { // The kill-bit only applies to External extensions so this check fails // for internal locations that have the kill-bit set. In other words, // the kill-bit cannot be set unless the extension is external. + Extension::Location ext_location = + static_cast<Extension::Location>(location); DCHECK(state != Extension::KILLBIT || - Extension::IsExternalLocation(location)); + Extension::IsExternalLocation(ext_location)); } } @@ -437,8 +439,8 @@ void ExtensionsService::GetExternalExtensions( } // Check to see if the extension has been killed. - Extension::State state; - if (extension->GetInteger(kState, reinterpret_cast<int*>(&state)) && + int state; + if (extension->GetInteger(kState, &state) && state == static_cast<int>(Extension::KILLBIT)) { if (killed_extensions) { StringToLowerASCII(&key_name); @@ -566,15 +568,17 @@ void ExtensionsServiceBackend::LoadExtensionsFromInstallDirectory( if (!ReadCurrentVersion(extension_path, ¤t_version)) continue; - Extension::Location location; + int location; DictionaryValue* pref = NULL; external_extensions->GetDictionary(ASCIIToWide(extension_id), &pref); if (!pref || - !pref->GetInteger(kLocation, reinterpret_cast<int*>(&location))) { + !pref->GetInteger(kLocation, &location)) { location = Extension::INTERNAL; } + Extension::Location ext_location = + static_cast<Extension::Location>(location); FilePath version_path = extension_path.AppendASCII(current_version); - if (Extension::IsExternalLocation(location) && + if (Extension::IsExternalLocation(ext_location) && CheckExternalUninstall(external_extensions.get(), version_path, extension_id)) { // TODO(erikkay): Possibly defer this operation to avoid slowing initial @@ -1103,13 +1107,13 @@ void ExtensionsServiceBackend::CheckForExternalUpdates( continue; } - Extension::Location location; - if (extension->GetInteger(kLocation, reinterpret_cast<int*>(&location)) && + int location; + if (extension->GetInteger(kLocation, &location) && location != Extension::EXTERNAL_PREF) { continue; } - Extension::State state; - if (extension->GetInteger(kState, reinterpret_cast<int*>(&state)) && + int state; + if (extension->GetInteger(kState, &state) && state == Extension::KILLBIT) { continue; } @@ -1174,13 +1178,13 @@ bool ExtensionsServiceBackend::CheckExternalUninstall( DictionaryValue* extension_prefs, const FilePath& version_path, const std::string& id) { // First check the preferences for the kill-bit. - Extension::Location location = Extension::INVALID; + int location = Extension::INVALID; DictionaryValue* extension = NULL; if (extension_prefs->GetDictionary(ASCIIToWide(id), &extension)) { - Extension::State state; - if (extension->GetInteger(kLocation, reinterpret_cast<int*>(&location)) && + int state; + if (extension->GetInteger(kLocation, &location) && location == Extension::EXTERNAL_PREF) { - return extension->GetInteger(kState, reinterpret_cast<int*>(&state)) && + return extension->GetInteger(kState, &state) && state == Extension::KILLBIT; } } |