OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_COMMON_COMPONENT_FLASH_HINT_FILE_LINUX_H_ | 5 #ifndef CHROME_COMMON_COMPONENT_FLASH_HINT_FILE_LINUX_H_ |
6 #define CHROME_COMMON_COMPONENT_FLASH_HINT_FILE_LINUX_H_ | 6 #define CHROME_COMMON_COMPONENT_FLASH_HINT_FILE_LINUX_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_LINUX) | 10 #if !defined(OS_LINUX) |
| 11 #error "This file only applies to the Linux component update of Flash." |
| 12 #endif // !defined(OS_LINUX) |
11 | 13 |
12 #include <string> | 14 #include <string> |
13 | 15 |
14 namespace base { | 16 namespace base { |
15 class FilePath; | 17 class FilePath; |
16 } | 18 } |
17 | 19 |
18 namespace chrome { | |
19 | |
20 // The APIs in this namespace wraps the component updated flash hint file, which | 20 // The APIs in this namespace wraps the component updated flash hint file, which |
21 // lives inside the PepperFlash folder of the user-data-dir, so that the Linux | 21 // lives inside the PepperFlash folder of the user-data-dir, so that the Linux |
22 // zygote process can preload the right version of flash. | 22 // zygote process can preload the right version of flash. |
23 namespace component_flash_hint_file { | 23 namespace component_flash_hint_file { |
24 | 24 |
25 // Records a new flash update into the hint file. | 25 // Records a new flash update into the hint file. |
26 // |unpacked_plugin| is the current location of the plugin. | 26 // |unpacked_plugin| is the current location of the plugin. |
27 // |moved_plugin| is the location where the plugin will be loaded from. | 27 // |moved_plugin| is the location where the plugin will be loaded from. |
28 bool RecordFlashUpdate(const base::FilePath& unpacked_plugin, | 28 bool RecordFlashUpdate(const base::FilePath& unpacked_plugin, |
29 const base::FilePath& moved_plugin, | 29 const base::FilePath& moved_plugin, |
30 const std::string& version); | 30 const std::string& version); |
31 | 31 |
32 // Reports whether or not a hints file exists. | 32 // Reports whether or not a hints file exists. |
33 bool DoesHintFileExist(); | 33 bool DoesHintFileExist(); |
34 | 34 |
35 // Return the path of the component updated flash plugin, only if the file has | 35 // Return the path of the component updated flash plugin, only if the file has |
36 // the correct hash sum. | 36 // the correct hash sum. |
37 // |path| will be populated with the path to the flash plugin. | 37 // |path| will be populated with the path to the flash plugin. |
38 // |version| will be populated with the version of the flash plugin. | 38 // |version| will be populated with the version of the flash plugin. |
39 bool VerifyAndReturnFlashLocation(base::FilePath* path, std::string* version); | 39 bool VerifyAndReturnFlashLocation(base::FilePath* path, std::string* version); |
40 | 40 |
41 // Test if the specified plugin file can be mapped executable. | 41 // Test if the specified plugin file can be mapped executable. |
42 // This is useful to test if the flash plugin is in a directory mounted | 42 // This is useful to test if the flash plugin is in a directory mounted |
43 // noexec, in which case Chrome will not be able to load and use the plugin. | 43 // noexec, in which case Chrome will not be able to load and use the plugin. |
44 // |path| is the path of the flash plugin that will mapped executable. | 44 // |path| is the path of the flash plugin that will mapped executable. |
45 bool TestExecutableMapping(const base::FilePath& path); | 45 bool TestExecutableMapping(const base::FilePath& path); |
46 | 46 |
47 } // namespace component_flash_hint_file | 47 } // namespace component_flash_hint_file |
48 | 48 |
49 } // namespace chrome | |
50 | |
51 #endif // defined(OS_LINUX) | |
52 #endif // CHROME_COMMON_COMPONENT_FLASH_HINT_FILE_LINUX_H_ | 49 #endif // CHROME_COMMON_COMPONENT_FLASH_HINT_FILE_LINUX_H_ |
OLD | NEW |