From a20896f51946e97483387d9317c6a295c64552cf Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 25 May 2023 03:23:19 -0500 Subject: [PATCH] refactor: remove InspectableWebContents::GetAll() (#38442) It is unused and also keeps a persistent std::list<>, so remove it. --- shell/browser/ui/inspectable_web_contents.cc | 9 --------- shell/browser/ui/inspectable_web_contents.h | 4 ---- 2 files changed, 13 deletions(-) diff --git a/shell/browser/ui/inspectable_web_contents.cc b/shell/browser/ui/inspectable_web_contents.cc index cffad6e98b..643d229be6 100644 --- a/shell/browser/ui/inspectable_web_contents.cc +++ b/shell/browser/ui/inspectable_web_contents.cc @@ -94,9 +94,6 @@ const char kTitleFormat[] = "Developer Tools - %s"; const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4; -// Stores all instances of InspectableWebContents. -InspectableWebContents::List g_web_contents_instances_; - base::Value::Dict RectToDictionary(const gfx::Rect& bounds) { return base::Value::Dict{} .Set("x", bounds.x()) @@ -330,10 +327,6 @@ InspectableWebContentsView* CreateInspectableContentsView( InspectableWebContents* inspectable_web_contents); // static -const InspectableWebContents::List& InspectableWebContents::GetAll() { - return g_web_contents_instances_; -} - // static void InspectableWebContents::RegisterPrefs(PrefRegistrySimple* registry) { registry->RegisterDictionaryPref(kDevToolsBoundsPref, @@ -375,11 +368,9 @@ InspectableWebContents::InspectableWebContents( display.y() + (display.height() - devtools_bounds_.height()) / 2); } } - g_web_contents_instances_.push_back(this); } InspectableWebContents::~InspectableWebContents() { - g_web_contents_instances_.remove(this); // Unsubscribe from devtools and Clean up resources. if (GetDevToolsWebContents()) WebContentsDestroyed(); diff --git a/shell/browser/ui/inspectable_web_contents.h b/shell/browser/ui/inspectable_web_contents.h index ec52e229bd..6c514a63be 100644 --- a/shell/browser/ui/inspectable_web_contents.h +++ b/shell/browser/ui/inspectable_web_contents.h @@ -6,7 +6,6 @@ #ifndef ELECTRON_SHELL_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_H_ #define ELECTRON_SHELL_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_H_ -#include #include #include #include @@ -42,9 +41,6 @@ class InspectableWebContents public content::WebContentsDelegate, public DevToolsEmbedderMessageDispatcher::Delegate { public: - using List = std::list; - - static const List& GetAll(); static void RegisterPrefs(PrefRegistrySimple* pref_registry); InspectableWebContents(std::unique_ptr web_contents,