build: match upstream with unsafe buffer paths (#45853)
* build: match upstream with unsafe buffer paths * Don't assume STL iterators are pointers Refs https://issues.chromium.org/issues/328308661 * chore: spanify process_singleton_win.cc
This commit is contained in:
parent
d987bee007
commit
041ada1586
13 changed files with 44 additions and 126 deletions
|
@ -405,7 +405,7 @@ int GetPathConstant(std::string_view name) {
|
|||
{"videos", chrome::DIR_USER_VIDEOS},
|
||||
});
|
||||
// clang-format on
|
||||
const auto* iter = Lookup.find(name);
|
||||
auto iter = Lookup.find(name);
|
||||
return iter != Lookup.end() ? iter->second : -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ std::string SystemPreferences::GetColor(gin_helper::ErrorThrower thrower,
|
|||
{"window-text", COLOR_WINDOWTEXT},
|
||||
});
|
||||
|
||||
if (const auto* iter = Lookup.find(color); iter != Lookup.end())
|
||||
if (auto iter = Lookup.find(color); iter != Lookup.end())
|
||||
return ToRGBAHex(color_utils::GetSysSkColor(iter->second));
|
||||
|
||||
thrower.ThrowError("Unknown color: " + color);
|
||||
|
|
|
@ -80,7 +80,7 @@ struct UserData : public base::SupportsUserData::Data {
|
|||
};
|
||||
|
||||
extensions::WebRequestResourceType ParseResourceType(std::string_view value) {
|
||||
if (const auto* iter = ResourceTypes.find(value); iter != ResourceTypes.end())
|
||||
if (auto iter = ResourceTypes.find(value); iter != ResourceTypes.end())
|
||||
return iter->second;
|
||||
|
||||
return extensions::WebRequestResourceType::OTHER;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue