fix: misc-use-internal-linkage warnings (#44872)
* refactor: fix misc-use-internal-linkage warnings: move impl functions into anonymous namespace so that they're not visible to other compilation units
This commit is contained in:
parent
5ca3f950e9
commit
a92b3944a1
9 changed files with 54 additions and 14 deletions
|
@ -29,6 +29,8 @@
|
|||
|
||||
namespace electron::util {
|
||||
|
||||
namespace {
|
||||
|
||||
struct ScaleFactorPair {
|
||||
const char* name;
|
||||
float scale;
|
||||
|
@ -55,6 +57,22 @@ float GetScaleFactorFromPath(const base::FilePath& path) {
|
|||
return 1.0f;
|
||||
}
|
||||
|
||||
bool AddImageSkiaRepFromPath(gfx::ImageSkia* image,
|
||||
const base::FilePath& path,
|
||||
double scale_factor) {
|
||||
std::string file_contents;
|
||||
{
|
||||
electron::ScopedAllowBlockingForElectron allow_blocking;
|
||||
if (!asar::ReadFileToString(path, &file_contents))
|
||||
return false;
|
||||
}
|
||||
|
||||
return AddImageSkiaRepFromBuffer(image, base::as_byte_span(file_contents), 0,
|
||||
0, scale_factor);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool AddImageSkiaRepFromPNG(gfx::ImageSkia* image,
|
||||
const base::span<const uint8_t> data,
|
||||
double scale_factor) {
|
||||
|
@ -114,20 +132,6 @@ bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool AddImageSkiaRepFromPath(gfx::ImageSkia* image,
|
||||
const base::FilePath& path,
|
||||
double scale_factor) {
|
||||
std::string file_contents;
|
||||
{
|
||||
electron::ScopedAllowBlockingForElectron allow_blocking;
|
||||
if (!asar::ReadFileToString(path, &file_contents))
|
||||
return false;
|
||||
}
|
||||
|
||||
return AddImageSkiaRepFromBuffer(image, base::as_byte_span(file_contents), 0,
|
||||
0, scale_factor);
|
||||
}
|
||||
|
||||
bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image,
|
||||
const base::FilePath& path) {
|
||||
bool succeed = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue