fix: -Wunsafe-buffer-usage warnings in AddComponentResourceEntries() (#44031)

fix: -Wunsafe-buffer-usage warnings in ElectronComponentExtensionResourceManager::AddComponentResourceEntries()

just replace pointer-and-length args with a span

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2024-09-30 14:40:42 -05:00 committed by GitHub
parent c8788f8217
commit e019b37231
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 12 deletions

View file

@ -10,6 +10,7 @@
#include <map>
#include <string>
#include "base/containers/span.h"
#include "base/files/file_path.h"
#include "extensions/browser/component_extension_resource_manager.h"
#include "ui/base/webui/resource_path.h"
@ -38,8 +39,8 @@ class ElectronComponentExtensionResourceManager
const std::string& extension_id) const override;
private:
void AddComponentResourceEntries(const webui::ResourcePath* entries,
size_t size);
void AddComponentResourceEntries(
base::span<const webui::ResourcePath> entries);
// A map from a resource path to the resource ID. Used by
// IsComponentExtensionResource.