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

Side by Side Diff: components/nacl/renderer/sandbox_isa.cc

Issue 193313002: Pepper: Move GetSandboxISA() to PPB_NaCl_Private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for dmichael 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // The list of supported ISA strings for x86. See issue:
6 // http://code.google.com/p/nativeclient/issues/detail?id=1040 for more
7 // information. Note that these string are to be case-insensitive compared.
8
9 #include "base/logging.h"
10 #if defined(OS_WIN) && ARCH_CPU_32_BITS
11 #include "base/win/windows_version.h"
12 #endif
13
14 const char* const kNexeArchARM = "arm";
15 const char* const kNexeArchMIPS = "mips32";
16 const char* const kNexeArchX86_32 = "x86-32";
17 const char* const kNexeArchX86_64 = "x86-64";
18
19 namespace nacl {
20
21 const char* GetSandboxISA() {
22 #if defined(ARCH_CPU_ARM_FAMILY)
23 return kNexeArchArm;
24 #elif defined(ARCH_CPU_MIPS_FAMILY)
25 return kNexeArchMIPS;
26 #elif defined(ARCH_CPU_X86_FAMILY)
27
28 #if defined(OS_WIN) && ARCH_CPU_32_BITS
29 // 32-bit Windows build, so we have to determine the OS architecture.
30 if (base::win::OSInfo::GetInstance()->architecture() == X64_ARCHITECTURE)
31 return kNexeArchX86_64;
32 else
33 return kNexeArchX86_32;
34 #else
35 return kNexeArchX86_64;
dmichael (off chromium) 2014/03/11 19:00:16 That doesn't seem right for Linux 32 and possibly
36 #endif // defined(OS_WIN) && ARCH_CPU_32_BITS
37
38 #else
39 #error Architecture not supported.
40 NOTREACHED();
41 return NULL;
42 #endif
43 }
44
45 } // namespace nacl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698