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

Unified Diff: chrome/browser/extensions/external_registry_extension_loader_win.cc

Issue 6293006: Allow relative paths to external extension files for some providers, error out for others. (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: Rebase for commit. Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/external_pref_extension_loader.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/external_registry_extension_loader_win.cc
diff --git a/chrome/browser/extensions/external_registry_extension_loader_win.cc b/chrome/browser/extensions/external_registry_extension_loader_win.cc
index b3037c815fcf920160b0abf71f3eaf4885bdeb65..c78a41b6f15e73b2861f4679a223a0307c201a06 100644
--- a/chrome/browser/extensions/external_registry_extension_loader_win.cc
+++ b/chrome/browser/extensions/external_registry_extension_loader_win.cc
@@ -49,10 +49,18 @@ void ExternalRegistryExtensionLoader::LoadOnFileThread() {
std::wstring key_path = ASCIIToWide(kRegistryExtensions);
key_path.append(L"\\");
key_path.append(iterator.Name());
- if (key.Open(kRegRoot, key_path.c_str(), KEY_READ) == ERROR_SUCCESS) {
- std::wstring extension_path;
- if (key.ReadValue(kRegistryExtensionPath, &extension_path)
+ if (key.Open(kRegRoot, key_path.c_str(), KEY_READ) == ERROR_SUCCESS) {
+ std::wstring extension_path_str;
+ if (key.ReadValue(kRegistryExtensionPath, &extension_path_str)
== ERROR_SUCCESS) {
+ FilePath extension_path(extension_path_str);
+ if (!extension_path.IsAbsolute()) {
+ LOG(ERROR) << "Path " << extension_path_str
+ << " needs to be absolute in key "
+ << key_path;
+ ++iterator;
+ continue;
+ }
std::wstring extension_version;
if (key.ReadValue(kRegistryExtensionVersion, &extension_version)
== ERROR_SUCCESS) {
@@ -81,7 +89,7 @@ void ExternalRegistryExtensionLoader::LoadOnFileThread() {
WideToASCII(extension_version));
prefs->SetString(
id + "." + ExternalExtensionProviderImpl::kExternalCrx,
- extension_path);
+ extension_path_str);
} else {
// TODO(erikkay): find a way to get this into about:extensions
LOG(ERROR) << "Missing value " << kRegistryExtensionVersion
« no previous file with comments | « chrome/browser/extensions/external_pref_extension_loader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698