refactor: prefer base::circular_deque over std::deque (#47193)

* refactor: use base::circular_deque in ResolveProxyHelper

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use base::circular_deque in GetExtraCrashKeys()

refactor: reduce visibility of kMaxCrashKeyValueSize

This change is to match Chromium's usage advice from
base/containers/README.md: `base:circular_deque` is preferred over
`std::deque` to provide consistent performance across platforms.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

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] 2025-05-21 15:49:06 -05:00 committed by GitHub
commit 2d71d65415
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 13 deletions

View file

@ -5,10 +5,10 @@
#ifndef ELECTRON_SHELL_BROWSER_NET_RESOLVE_PROXY_HELPER_H_
#define ELECTRON_SHELL_BROWSER_NET_RESOLVE_PROXY_HELPER_H_
#include <deque>
#include <optional>
#include <string>
#include "base/containers/circular_deque.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "mojo/public/cpp/bindings/receiver.h"
@ -66,7 +66,7 @@ class ResolveProxyHelper
// Self-reference. Owned as long as there's an outstanding proxy lookup.
scoped_refptr<ResolveProxyHelper> owned_self_;
std::deque<PendingRequest> pending_requests_;
base::circular_deque<PendingRequest> pending_requests_;
// Receiver for the currently in-progress request, if any.
mojo::Receiver<network::mojom::ProxyLookupClient> receiver_{this};