OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h" | 5 #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // Name of the Pnacl component specified in the manifest. | 43 // Name of the Pnacl component specified in the manifest. |
44 const char kPnaclManifestName[] = "PNaCl"; | 44 const char kPnaclManifestName[] = "PNaCl"; |
45 | 45 |
46 // Name of the Pnacl architecture in the component manifest. | 46 // Name of the Pnacl architecture in the component manifest. |
47 // NOTE: this is independent of the Omaha query parameter. | 47 // NOTE: this is independent of the Omaha query parameter. |
48 // TODO(jvoung): Will the Omaha query do the right thing for windows | 48 // TODO(jvoung): Will the Omaha query do the right thing for windows |
49 // on x86-64? If it doesn't, will we need two separate Omaha queries (ouch)? | 49 // on x86-64? If it doesn't, will we need two separate Omaha queries (ouch)? |
50 const char* PnaclArch() { | 50 const char* PnaclArch() { |
51 #if defined(ARCH_CPU_X86_FAMILY) | 51 #if defined(ARCH_CPU_X86_FAMILY) |
52 #if defined(ARCH_CPU_X86_64) | 52 #if defined(ARCH_CPU_X86_64) |
53 bool x86_64 = true; | 53 return "x86-64"; |
54 #elif defined(OS_WIN) | 54 #elif defined(OS_WIN) |
55 bool x86_64 = (base::win::OSInfo::GetInstance()->wow64_status() == | 55 bool x86_64 = (base::win::OSInfo::GetInstance()->wow64_status() == |
56 base::win::OSInfo::WOW64_ENABLED); | 56 base::win::OSInfo::WOW64_ENABLED); |
| 57 return x86_64 ? "x86-64" : "x86-32"; |
57 #else | 58 #else |
58 bool x86_64 = false; | 59 return "x86-32"; |
59 #endif | 60 #endif |
60 return x86_64 ? "x86-64" : "x86-32"; | |
61 #elif defined(ARCH_CPU_ARMEL) | 61 #elif defined(ARCH_CPU_ARMEL) |
62 // Eventually we'll need to distinguish arm32 vs thumb2. | 62 // Eventually we'll need to distinguish arm32 vs thumb2. |
63 // That may need to be based on the actual nexe rather than a static | 63 // That may need to be based on the actual nexe rather than a static |
64 // choice, which would require substantial refactoring. | 64 // choice, which would require substantial refactoring. |
65 return "arm"; | 65 return "arm"; |
66 #else | 66 #else |
67 #error "Add support for your architecture to Pnacl Component Installer." | 67 #error "Add support for your architecture to Pnacl Component Installer." |
68 #endif | 68 #endif |
69 } | 69 } |
70 | 70 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 296 } |
297 } | 297 } |
298 | 298 |
299 } // namespace | 299 } // namespace |
300 | 300 |
301 void RegisterPnaclComponent(ComponentUpdateService* cus) { | 301 void RegisterPnaclComponent(ComponentUpdateService* cus) { |
302 BrowserThread::PostTask( | 302 BrowserThread::PostTask( |
303 BrowserThread::FILE, FROM_HERE, | 303 BrowserThread::FILE, FROM_HERE, |
304 base::Bind(&StartPnaclUpdateRegistration, cus)); | 304 base::Bind(&StartPnaclUpdateRegistration, cus)); |
305 } | 305 } |
OLD | NEW |