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

Unified Diff: chrome/browser/extensions/updater/extension_updater.cc

Issue 596193002: Check multi-crx path for force update based on manifest entries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 6 years, 3 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 | « no previous file | extensions/common/manifest_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/updater/extension_updater.cc
diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc
index 76d9e29f092d93f10840387b58c86cfbe129713a..ecbbcf5329f8ddf3adca9c2461ffe9f285b7940d 100644
--- a/chrome/browser/extensions/updater/extension_updater.cc
+++ b/chrome/browser/extensions/updater/extension_updater.cc
@@ -8,7 +8,6 @@
#include <set>
#include "base/bind.h"
-#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
@@ -37,6 +36,7 @@
#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/manifest.h"
+#include "extensions/common/manifest_constants.h"
using base::RandDouble;
using base::RandInt;
@@ -119,15 +119,29 @@ void DetermineForcedUpdatesOnBlockingPool(
extensions::kPlatformSpecificFolder);
if (base::PathExists(platform_specific_path)) {
bool force = true;
- base::FileEnumerator all_archs(platform_specific_path,
- false,
- base::FileEnumerator::DIRECTORIES);
- base::FilePath arch;
- while (!(arch = all_archs.Next()).empty()) {
- std::string arch_name = arch.BaseName().AsUTF8Unsafe();
- std::replace(arch_name.begin(), arch_name.end(), '_', '-');
- if (arch_name == OmahaQueryParams::GetNaclArch())
- force = false;
+ const base::ListValue* platforms;
+ if (extension->manifest()->GetList(extensions::manifest_keys::kPlatforms,
+ &platforms)) {
+ for (size_t i = 0; i < platforms->GetSize(); ++i) {
+ const base::DictionaryValue* p;
+ if (platforms->GetDictionary(i, &p)) {
+ std::string nacl_arch;
+ if (p->GetString(extensions::manifest_keys::kNaClArch,
+ &nacl_arch) &&
+ nacl_arch == OmahaQueryParams::GetNaclArch()) {
+ std::string subpath;
+ if (p->GetString(extensions::manifest_keys::kSubPackagePath,
+ &subpath)) {
+ // _platform_specific is part of the sub_package_path entry.
+ base::FilePath platform_specific_subpath =
+ extension->path().AppendASCII(subpath);
+ if (base::PathExists(platform_specific_subpath)) {
+ force = false;
+ }
+ }
+ }
+ }
+ }
}
if (force)
« no previous file with comments | « no previous file | extensions/common/manifest_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698