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

Unified Diff: components/nacl/renderer/sandbox_arch.cc

Issue 193313002: Pepper: Move GetSandboxISA() to PPB_NaCl_Private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nacl_interface threading fix Created 6 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 | « components/nacl/renderer/sandbox_arch.h ('k') | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/sandbox_arch.cc
diff --git a/components/nacl/renderer/sandbox_arch.cc b/components/nacl/renderer/sandbox_arch.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3a297495bcd751f6120249354f4abfb61abe8dcf
--- /dev/null
+++ b/components/nacl/renderer/sandbox_arch.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/logging.h"
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
+
+namespace nacl {
+
+const char* GetSandboxArch() {
+#if defined(ARCH_CPU_ARM_FAMILY)
+ return "arm";
+#elif defined(ARCH_CPU_MIPS_FAMILY)
+ return "mips32";
+#elif defined(ARCH_CPU_X86_FAMILY)
+
+#if defined(OS_WIN)
+ // We have to check the host architecture on Windows.
+ // See sandbox_isa.h for an explanation why.
+ if (base::win::OSInfo::GetInstance()->architecture() ==
+ base::win::OSInfo::X64_ARCHITECTURE)
+ return "x86-64";
+ else
+ return "x86-32";
+#elif ARCH_CPU_64_BITS
+ return "x86-64";
+#else
+ return "x86-32";
+#endif // defined(OS_WIN)
+
+#else
+#error Architecture not supported.
+#endif
+}
+
+} // namespace nacl
« no previous file with comments | « components/nacl/renderer/sandbox_arch.h ('k') | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698