Revert "spanify: Remove redundant declaration"
This reverts commit e26e9a1ab1
.
Reason for revert: Breaks build https://ci.chromium.org/ui/p/chromium/builders/ci/Deterministic%20Linux/50632/overview
Original change's description:
> spanify: Remove redundant declaration
>
> There's no need to explicitly say `extern const ...` to declare a GRIT
> resource. Rather, include the pertinent auto-generated file and refer
> directly to the constant as needed. This prevents `spanify` from
> accidentally seeing this as an array in need of rewriting (for now).
>
> Drive-by - rewrite the usage of the array to use structured bindings.
>
> Bug: 364338808
> Change-Id: I83f9488eaa5f56553f91f2ce68830574700fcfc6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6022569
> Commit-Queue: Kalvin Lee <kdlee@chromium.org>
> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1383491}
Bug: 364338808
Change-Id: If341598435856890e7aa198f0b29a7d54793e5a5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6021383
Owners-Override: Peter Pakkenberg <pbirk@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Peter Pakkenberg <pbirk@chromium.org>
Commit-Queue: Peter Pakkenberg <pbirk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1383499}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
3cd68bed08
commit
e1e9c4d827
content/browser/devtools
@ -19,7 +19,7 @@ if (!is_android && !is_ios) {
|
||||
# on this target to grit action.
|
||||
public = []
|
||||
|
||||
public_deps = [ ":devtools_resources" ]
|
||||
deps = [ ":devtools_resources" ]
|
||||
}
|
||||
grit("devtools_resources") {
|
||||
source = "$root_gen_dir/$devtools_grd_location"
|
||||
|
@ -2,10 +2,14 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifdef UNSAFE_BUFFERS_BUILD
|
||||
// TODO(crbug.com/342213636): Remove this and spanify to fix the errors.
|
||||
#pragma allow_unsafe_buffers
|
||||
#endif
|
||||
|
||||
#include "content/browser/devtools/devtools_frontend_host_impl.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
@ -15,7 +19,6 @@
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "content/browser/bad_message.h"
|
||||
#include "content/browser/devtools/grit/devtools_resources_map.h"
|
||||
#include "content/common/features.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
@ -29,6 +32,9 @@
|
||||
#include "components/crash/content/browser/error_reporting/js_error_report_processor.h" // nogncheck
|
||||
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
extern const webui::ResourcePath kDevtoolsResources[];
|
||||
extern const size_t kDevtoolsResourcesSize;
|
||||
|
||||
namespace content {
|
||||
namespace {
|
||||
const char kCompatibilityScript[] = "devtools_compatibility.js";
|
||||
@ -85,9 +91,9 @@ void DevToolsFrontendHost::SetupExtensionsAPI(
|
||||
// static
|
||||
scoped_refptr<base::RefCountedMemory>
|
||||
DevToolsFrontendHost::GetFrontendResourceBytes(const std::string& path) {
|
||||
for (const auto& [resource_path, id] : kDevtoolsResources) {
|
||||
if (path == resource_path) {
|
||||
return GetContentClient()->GetDataResourceBytes(id);
|
||||
for (size_t i = 0; i < kDevtoolsResourcesSize; ++i) {
|
||||
if (path == kDevtoolsResources[i].path) {
|
||||
return GetContentClient()->GetDataResourceBytes(kDevtoolsResources[i].id);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
Reference in New Issue
Block a user