| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // choice, which would require substantial refactoring. | 62 // choice, which would require substantial refactoring. |
| 63 return "arm"; | 63 return "arm"; |
| 64 #elif defined(ARCH_CPU_MIPSEL) | 64 #elif defined(ARCH_CPU_MIPSEL) |
| 65 return "mips32"; | 65 return "mips32"; |
| 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 |
| 71 // If we don't have Pnacl installed, this is the version we claim. | 71 // If we don't have Pnacl installed, this is the version we claim. |
| 72 // TODO(jvoung): Is there a way to trick the configurator to ping the server | |
| 73 // earlier if there are components that are not yet installed (version 0.0.0.0), | |
| 74 // So that they will be available ASAP? Be careful not to hurt startup speed. | |
| 75 // Make kNullVersion part of ComponentUpdater in that case, to avoid skew? | |
| 76 const char kNullVersion[] = "0.0.0.0"; | 72 const char kNullVersion[] = "0.0.0.0"; |
| 77 | 73 |
| 78 // Pnacl components have the version encoded in the path itself: | 74 // Pnacl components have the version encoded in the path itself: |
| 79 // <profile>\AppData\Local\Google\Chrome\User Data\Pnacl\0.1.2.3\. | 75 // <profile>\AppData\Local\Google\Chrome\User Data\Pnacl\0.1.2.3\. |
| 80 // and the base directory will be: | 76 // and the base directory will be: |
| 81 // <profile>\AppData\Local\Google\Chrome\User Data\Pnacl\. | 77 // <profile>\AppData\Local\Google\Chrome\User Data\Pnacl\. |
| 82 FilePath GetPnaclBaseDirectory() { | 78 FilePath GetPnaclBaseDirectory() { |
| 83 FilePath result; | 79 FilePath result; |
| 84 CHECK(PathService::Get(chrome::DIR_PNACL_BASE, &result)); | 80 CHECK(PathService::Get(chrome::DIR_PNACL_BASE, &result)); |
| 85 return result; | 81 return result; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 292 } |
| 297 } | 293 } |
| 298 | 294 |
| 299 } // namespace | 295 } // namespace |
| 300 | 296 |
| 301 void RegisterPnaclComponent(ComponentUpdateService* cus) { | 297 void RegisterPnaclComponent(ComponentUpdateService* cus) { |
| 302 BrowserThread::PostTask( | 298 BrowserThread::PostTask( |
| 303 BrowserThread::FILE, FROM_HERE, | 299 BrowserThread::FILE, FROM_HERE, |
| 304 base::Bind(&StartPnaclUpdateRegistration, cus)); | 300 base::Bind(&StartPnaclUpdateRegistration, cus)); |
| 305 } | 301 } |
| OLD | NEW |