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