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 <string> | 8 #include <string> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/base_paths.h" | 11 #include "base/base_paths.h" |
11 #include "base/bind.h" | 12 #include "base/bind.h" |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/files/file_enumerator.h" | 14 #include "base/files/file_enumerator.h" |
14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
15 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
16 #include "base/logging.h" | 17 #include "base/logging.h" |
17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
18 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
19 #include "base/values.h" | 20 #include "base/values.h" |
20 #include "components/component_updater/component_updater_paths.h" | 21 #include "components/component_updater/component_updater_paths.h" |
21 #include "components/component_updater/component_updater_service.h" | 22 #include "components/component_updater/component_updater_service.h" |
22 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
23 #include "content/public/browser/gpu_data_manager.h" | 24 #include "content/public/browser/gpu_data_manager.h" |
24 #include "content/public/browser/gpu_data_manager_observer.h" | 25 #include "content/public/browser/gpu_data_manager_observer.h" |
25 #include "gpu/config/gpu_feature_type.h" | 26 #include "gpu/config/gpu_feature_type.h" |
26 | 27 |
27 using content::BrowserThread; | 28 using content::BrowserThread; |
28 using content::GpuDataManager; | 29 using content::GpuDataManager; |
29 | 30 |
30 namespace component_updater { | 31 namespace component_updater { |
31 | 32 |
32 namespace { | 33 namespace { |
33 | 34 |
34 // CRX hash. The extension id is: nhfgdggnnopgbfdlpeoalgcjdgfafocg. | 35 // CRX hash. The extension id is: nhfgdggnnopgbfdlpeoalgcjdgfafocg. |
35 const uint8 kSha2Hash[] = {0xd7, 0x56, 0x36, 0x6d, 0xde, 0xf6, 0x15, 0x3b, | 36 const uint8_t kSha2Hash[] = {0xd7, 0x56, 0x36, 0x6d, 0xde, 0xf6, 0x15, 0x3b, |
36 0xf4, 0xe0, 0xb6, 0x29, 0x36, 0x50, 0x5e, 0x26, | 37 0xf4, 0xe0, 0xb6, 0x29, 0x36, 0x50, 0x5e, 0x26, |
37 0xbd, 0x77, 0x8b, 0x8e, 0x35, 0xc2, 0x7e, 0x43, | 38 0xbd, 0x77, 0x8b, 0x8e, 0x35, 0xc2, 0x7e, 0x43, |
38 0x52, 0x47, 0x62, 0xed, 0x12, 0xca, 0xcc, 0x6a}; | 39 0x52, 0x47, 0x62, 0xed, 0x12, 0xca, 0xcc, 0x6a}; |
39 | 40 |
40 // File name of the internal SwiftShader plugin on different platforms. | 41 // File name of the internal SwiftShader plugin on different platforms. |
41 const base::FilePath::CharType kSwiftShaderEglName[] = | 42 const base::FilePath::CharType kSwiftShaderEglName[] = |
42 FILE_PATH_LITERAL("libegl.dll"); | 43 FILE_PATH_LITERAL("libegl.dll"); |
43 const base::FilePath::CharType kSwiftShaderGlesName[] = | 44 const base::FilePath::CharType kSwiftShaderGlesName[] = |
44 FILE_PATH_LITERAL("libglesv2.dll"); | 45 FILE_PATH_LITERAL("libglesv2.dll"); |
45 | 46 |
46 const char kSwiftShaderManifestName[] = "SwiftShader"; | 47 const char kSwiftShaderManifestName[] = "SwiftShader"; |
47 | 48 |
48 // If we don't have a SwiftShader component, this is the version we claim. | 49 // If we don't have a SwiftShader component, this is the version we claim. |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 249 |
249 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 250 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
250 #if defined(ENABLE_SWIFTSHADER) | 251 #if defined(ENABLE_SWIFTSHADER) |
251 BrowserThread::PostTask(BrowserThread::FILE, | 252 BrowserThread::PostTask(BrowserThread::FILE, |
252 FROM_HERE, | 253 FROM_HERE, |
253 base::Bind(&RegisterSwiftShaderPath, cus)); | 254 base::Bind(&RegisterSwiftShaderPath, cus)); |
254 #endif | 255 #endif |
255 } | 256 } |
256 | 257 |
257 } // namespace component_updater | 258 } // namespace component_updater |
OLD | NEW |