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

Unified Diff: chrome/browser/component_updater/pnacl/pnacl_component_installer.cc

Issue 12928004: Add nacl_arch to data we send in omaha update checks for extensions/components (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing includes to fix windows compile error Created 7 years, 9 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 | chrome/common/omaha_query_params.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
diff --git a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
index aa78dfd3d18c5d3a23d52604360ac2b6aaab3c6b..f26ef1a3a0853d0df632a32b0545174a074591e4 100644
--- a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
+++ b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
@@ -21,8 +21,10 @@
#include "chrome/browser/component_updater/component_updater_service.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/omaha_query_params.h"
#include "content/public/browser/browser_thread.h"
+using chrome::OmahaQueryParams;
using content::BrowserThread;
namespace {
@@ -42,29 +44,7 @@ const char kPnaclCompilerFileName[] = "llc_nexe";
// Name of the Pnacl component specified in the manifest.
const char kPnaclManifestNamePrefix[] = "PNaCl";
-// Returns the name of the Pnacl architecture supported by an install.
-// NOTE: this is independent of the Omaha "arch" query parameter.
-const char* PnaclArch() {
-#if defined(ARCH_CPU_X86_FAMILY)
-#if defined(ARCH_CPU_X86_64)
- return "x86-64";
-#elif defined(OS_WIN)
- bool x86_64 = (base::win::OSInfo::GetInstance()->wow64_status() ==
- base::win::OSInfo::WOW64_ENABLED);
- return x86_64 ? "x86-64" : "x86-32";
-#else
- return "x86-32";
-#endif
-#elif defined(ARCH_CPU_ARMEL)
- return "arm";
-#elif defined(ARCH_CPU_MIPSEL)
- return "mips32";
-#else
-#error "Add support for your architecture to Pnacl Component Installer."
-#endif
-}
-
-// Sanitize characters given by PnaclArch so that they can be used
+// Sanitize characters from Pnacl Arch value so that they can be used
// in path names. This should only be characters in the set: [a-z0-9_].
// Keep in sync with chrome/browser/nacl_host/pnacl_file_host.
std::string SanitizeForPath(const std::string& input) {
@@ -220,9 +200,9 @@ bool CheckPnaclComponentManifest(base::DictionaryValue* manifest,
std::string arch;
pnacl_manifest->GetStringASCII("pnacl-arch", &arch);
- if (arch.compare(PnaclArch()) != 0) {
+ if (arch.compare(OmahaQueryParams::getNaclArch()) != 0) {
LOG(WARNING) << "'pnacl-arch' field in manifest is invalid ("
- << arch << " vs " << PnaclArch() << ")";
+ << arch << " vs " << OmahaQueryParams::getNaclArch() << ")";
return false;
}
@@ -259,7 +239,7 @@ namespace {
bool PathContainsPnacl(const base::FilePath& base_path) {
// Check that at least one of the compiler files exists, for the current ISA.
std::string expected_filename("pnacl_public_");
- std::string arch = PnaclArch();
+ std::string arch = OmahaQueryParams::getNaclArch();
expected_filename = expected_filename + SanitizeForPath(arch) +
"_" + kPnaclCompilerFileName;
return file_util::PathExists(base_path.AppendASCII(expected_filename));
« no previous file with comments | « no previous file | chrome/common/omaha_query_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698