| 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/swiftshader_component_installer.h" | 5 #include "chrome/browser/component_updater/swiftshader_component_installer.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 144 |
| 145 bool SwiftShaderComponentInstaller::DoInstall( | 145 bool SwiftShaderComponentInstaller::DoInstall( |
| 146 const base::DictionaryValue& manifest, | 146 const base::DictionaryValue& manifest, |
| 147 const base::FilePath& unpack_path) { | 147 const base::FilePath& unpack_path) { |
| 148 std::string name; | 148 std::string name; |
| 149 manifest.GetStringASCII("name", &name); | 149 manifest.GetStringASCII("name", &name); |
| 150 if (name != kSwiftShaderManifestName) | 150 if (name != kSwiftShaderManifestName) |
| 151 return false; | 151 return false; |
| 152 std::string proposed_version; | 152 std::string proposed_version; |
| 153 manifest.GetStringASCII("version", &proposed_version); | 153 manifest.GetStringASCII("version", &proposed_version); |
| 154 base::Version version(proposed_version.c_str()); | 154 base::Version version(proposed_version); |
| 155 if (!version.IsValid()) | 155 if (!version.IsValid()) |
| 156 return false; | 156 return false; |
| 157 if (current_version_.CompareTo(version) >= 0) | 157 if (current_version_.CompareTo(version) >= 0) |
| 158 return false; | 158 return false; |
| 159 if (!base::PathExists(unpack_path.Append(kSwiftShaderEglName)) || | 159 if (!base::PathExists(unpack_path.Append(kSwiftShaderEglName)) || |
| 160 !base::PathExists(unpack_path.Append(kSwiftShaderGlesName))) | 160 !base::PathExists(unpack_path.Append(kSwiftShaderGlesName))) |
| 161 return false; | 161 return false; |
| 162 // Passed the basic tests. Time to install it. | 162 // Passed the basic tests. Time to install it. |
| 163 base::FilePath path = | 163 base::FilePath path = |
| 164 GetSwiftShaderBaseDirectory().AppendASCII(version.GetString()); | 164 GetSwiftShaderBaseDirectory().AppendASCII(version.GetString()); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 275 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
| 276 #if BUILDFLAG(ENABLE_SWIFTSHADER) && defined(ARCH_CPU_X86) | 276 #if BUILDFLAG(ENABLE_SWIFTSHADER) && defined(ARCH_CPU_X86) |
| 277 BrowserThread::PostTask(BrowserThread::FILE, | 277 BrowserThread::PostTask(BrowserThread::FILE, |
| 278 FROM_HERE, | 278 FROM_HERE, |
| 279 base::Bind(&RegisterSwiftShaderPath, cus)); | 279 base::Bind(&RegisterSwiftShaderPath, cus)); |
| 280 #endif | 280 #endif |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace component_updater | 283 } // namespace component_updater |
| OLD | NEW |