refactor: remove InspectableWebContents::GetAll() (#38442)
It is unused and also keeps a persistent std::list<>, so remove it.
This commit is contained in:
parent
64045fd058
commit
a20896f519
2 changed files with 0 additions and 13 deletions
|
@ -94,9 +94,6 @@ const char kTitleFormat[] = "Developer Tools - %s";
|
||||||
|
|
||||||
const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4;
|
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) {
|
base::Value::Dict RectToDictionary(const gfx::Rect& bounds) {
|
||||||
return base::Value::Dict{}
|
return base::Value::Dict{}
|
||||||
.Set("x", bounds.x())
|
.Set("x", bounds.x())
|
||||||
|
@ -330,10 +327,6 @@ InspectableWebContentsView* CreateInspectableContentsView(
|
||||||
InspectableWebContents* inspectable_web_contents);
|
InspectableWebContents* inspectable_web_contents);
|
||||||
|
|
||||||
// static
|
// static
|
||||||
const InspectableWebContents::List& InspectableWebContents::GetAll() {
|
|
||||||
return g_web_contents_instances_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void InspectableWebContents::RegisterPrefs(PrefRegistrySimple* registry) {
|
void InspectableWebContents::RegisterPrefs(PrefRegistrySimple* registry) {
|
||||||
registry->RegisterDictionaryPref(kDevToolsBoundsPref,
|
registry->RegisterDictionaryPref(kDevToolsBoundsPref,
|
||||||
|
@ -375,11 +368,9 @@ InspectableWebContents::InspectableWebContents(
|
||||||
display.y() + (display.height() - devtools_bounds_.height()) / 2);
|
display.y() + (display.height() - devtools_bounds_.height()) / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_web_contents_instances_.push_back(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InspectableWebContents::~InspectableWebContents() {
|
InspectableWebContents::~InspectableWebContents() {
|
||||||
g_web_contents_instances_.remove(this);
|
|
||||||
// Unsubscribe from devtools and Clean up resources.
|
// Unsubscribe from devtools and Clean up resources.
|
||||||
if (GetDevToolsWebContents())
|
if (GetDevToolsWebContents())
|
||||||
WebContentsDestroyed();
|
WebContentsDestroyed();
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
#ifndef ELECTRON_SHELL_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_H_
|
#ifndef ELECTRON_SHELL_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_H_
|
||||||
#define ELECTRON_SHELL_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_H_
|
#define ELECTRON_SHELL_BROWSER_UI_INSPECTABLE_WEB_CONTENTS_H_
|
||||||
|
|
||||||
#include <list>
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
@ -42,9 +41,6 @@ class InspectableWebContents
|
||||||
public content::WebContentsDelegate,
|
public content::WebContentsDelegate,
|
||||||
public DevToolsEmbedderMessageDispatcher::Delegate {
|
public DevToolsEmbedderMessageDispatcher::Delegate {
|
||||||
public:
|
public:
|
||||||
using List = std::list<InspectableWebContents*>;
|
|
||||||
|
|
||||||
static const List& GetAll();
|
|
||||||
static void RegisterPrefs(PrefRegistrySimple* pref_registry);
|
static void RegisterPrefs(PrefRegistrySimple* pref_registry);
|
||||||
|
|
||||||
InspectableWebContents(std::unique_ptr<content::WebContents> web_contents,
|
InspectableWebContents(std::unique_ptr<content::WebContents> web_contents,
|
||||||
|
|
Loading…
Reference in a new issue