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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/cpu.h" | 10 #include "base/cpu.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/files/file_enumerator.h" | 12 #include "base/files/file_enumerator.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/values.h" | 17 #include "base/values.h" |
18 #include "chrome/browser/component_updater/component_updater_service.h" | 18 #include "chrome/browser/component_updater/component_updater_service.h" |
19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
21 #include "content/public/browser/gpu_data_manager.h" | 21 #include "content/public/browser/gpu_data_manager.h" |
22 #include "content/public/browser/gpu_data_manager_observer.h" | 22 #include "content/public/browser/gpu_data_manager_observer.h" |
23 #include "gpu/config/gpu_feature_type.h" | 23 #include "gpu/config/gpu_feature_type.h" |
24 | 24 |
25 using content::BrowserThread; | 25 using content::BrowserThread; |
26 using content::GpuDataManager; | 26 using content::GpuDataManager; |
27 | 27 |
| 28 namespace component_updater { |
| 29 |
28 namespace { | 30 namespace { |
29 | 31 |
30 // CRX hash. The extension id is: nhfgdggnnopgbfdlpeoalgcjdgfafocg. | 32 // CRX hash. The extension id is: nhfgdggnnopgbfdlpeoalgcjdgfafocg. |
31 const uint8 kSha2Hash[] = {0xd7, 0x56, 0x36, 0x6d, 0xde, 0xf6, 0x15, 0x3b, | 33 const uint8 kSha2Hash[] = {0xd7, 0x56, 0x36, 0x6d, 0xde, 0xf6, 0x15, 0x3b, |
32 0xf4, 0xe0, 0xb6, 0x29, 0x36, 0x50, 0x5e, 0x26, | 34 0xf4, 0xe0, 0xb6, 0x29, 0x36, 0x50, 0x5e, 0x26, |
33 0xbd, 0x77, 0x8b, 0x8e, 0x35, 0xc2, 0x7e, 0x43, | 35 0xbd, 0x77, 0x8b, 0x8e, 0x35, 0xc2, 0x7e, 0x43, |
34 0x52, 0x47, 0x62, 0xed, 0x12, 0xca, 0xcc, 0x6a}; | 36 0x52, 0x47, 0x62, 0xed, 0x12, 0xca, 0xcc, 0x6a}; |
35 | 37 |
36 // File name of the internal SwiftShader plugin on different platforms. | 38 // File name of the internal SwiftShader plugin on different platforms. |
37 const base::FilePath::CharType kSwiftShaderEglName[] = | 39 const base::FilePath::CharType kSwiftShaderEglName[] = |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 239 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
238 #if defined(ENABLE_SWIFTSHADER) | 240 #if defined(ENABLE_SWIFTSHADER) |
239 base::CPU cpu; | 241 base::CPU cpu; |
240 | 242 |
241 if (!cpu.has_sse2()) | 243 if (!cpu.has_sse2()) |
242 return; | 244 return; |
243 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 245 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
244 base::Bind(&RegisterSwiftShaderPath, cus)); | 246 base::Bind(&RegisterSwiftShaderPath, cus)); |
245 #endif | 247 #endif |
246 } | 248 } |
| 249 |
| 250 } // namespace component_updater |
| 251 |
OLD | NEW |