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

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

Issue 399983002: Pepper: Refactor cpu feature attributes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes for bbudge Created 6 years, 5 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
« no previous file with comments | « components/nacl/renderer/sandbox_arch.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 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 #include "base/logging.h"
6 #if defined(OS_WIN)
7 #include "base/win/windows_version.h"
8 #endif
9
10 namespace nacl {
11
12 const char* GetSandboxArch() {
13 #if defined(ARCH_CPU_ARM_FAMILY)
14 return "arm";
15 #elif defined(ARCH_CPU_MIPS_FAMILY)
16 return "mips32";
17 #elif defined(ARCH_CPU_X86_FAMILY)
18
19 #if defined(OS_WIN)
20 // We have to check the host architecture on Windows.
21 // See sandbox_isa.h for an explanation why.
22 if (base::win::OSInfo::GetInstance()->architecture() ==
23 base::win::OSInfo::X64_ARCHITECTURE)
24 return "x86-64";
25 else
26 return "x86-32";
27 #elif ARCH_CPU_64_BITS
28 return "x86-64";
29 #else
30 return "x86-32";
31 #endif // defined(OS_WIN)
32
33 #else
34 #error Architecture not supported.
35 #endif
36 }
37
38 } // namespace nacl
OLDNEW
« no previous file with comments | « components/nacl/renderer/sandbox_arch.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698