devtools_discovery and devtools_http_handler are gone
This commit is contained in:
parent
f560fd56aa
commit
eb89edbf5b
2 changed files with 18 additions and 29 deletions
|
@ -15,11 +15,9 @@
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "common/content_client.h"
|
#include "common/content_client.h"
|
||||||
#include "components/devtools_discovery/basic_target_descriptor.h"
|
|
||||||
#include "components/devtools_discovery/devtools_discovery_manager.h"
|
|
||||||
#include "components/devtools_http_handler/devtools_http_handler.h"
|
|
||||||
#include "content/public/browser/devtools_agent_host.h"
|
#include "content/public/browser/devtools_agent_host.h"
|
||||||
#include "content/public/browser/devtools_frontend_host.h"
|
#include "content/public/browser/devtools_frontend_host.h"
|
||||||
|
#include "content/public/browser/devtools_socket_factory.h"
|
||||||
#include "content/public/browser/favicon_status.h"
|
#include "content/public/browser/favicon_status.h"
|
||||||
#include "content/public/browser/navigation_entry.h"
|
#include "content/public/browser/navigation_entry.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
|
@ -36,15 +34,14 @@ namespace brightray {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class TCPServerSocketFactory
|
class TCPServerSocketFactory : public content::DevToolsSocketFactory {
|
||||||
: public devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory {
|
|
||||||
public:
|
public:
|
||||||
TCPServerSocketFactory(const std::string& address, int port)
|
TCPServerSocketFactory(const std::string& address, int port)
|
||||||
: address_(address), port_(port) {
|
: address_(address), port_(port) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// content::DevToolsHttpHandler::ServerSocketFactory.
|
// content::ServerSocketFactory.
|
||||||
std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
|
std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
|
||||||
std::unique_ptr<net::ServerSocket> socket(
|
std::unique_ptr<net::ServerSocket> socket(
|
||||||
new net::TCPServerSocket(nullptr, net::NetLog::Source()));
|
new net::TCPServerSocket(nullptr, net::NetLog::Source()));
|
||||||
|
@ -147,27 +144,23 @@ DevToolsManagerDelegate::CreateHttpHandler() {
|
||||||
|
|
||||||
DevToolsManagerDelegate::DevToolsManagerDelegate()
|
DevToolsManagerDelegate::DevToolsManagerDelegate()
|
||||||
: handler_(new DevToolsNetworkProtocolHandler) {
|
: handler_(new DevToolsNetworkProtocolHandler) {
|
||||||
// NB(zcbenz): This call does nothing, the only purpose is to make sure the
|
|
||||||
// devtools_discovery module is linked into the final executable on Linux.
|
|
||||||
// Though it is possible to achieve this by modifying the gyp settings, it
|
|
||||||
// would greatly increase gyp file's complexity, so I chose to instead do
|
|
||||||
// this hack.
|
|
||||||
devtools_discovery::DevToolsDiscoveryManager::GetInstance();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DevToolsManagerDelegate::~DevToolsManagerDelegate() {
|
DevToolsManagerDelegate::~DevToolsManagerDelegate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DevToolsManagerDelegate::DevToolsAgentStateChanged(
|
void DevToolsManagerDelegate::Inspect(content::DevToolsAgentHost* agent_host) {
|
||||||
content::DevToolsAgentHost* agent_host,
|
|
||||||
bool attached) {
|
|
||||||
handler_->DevToolsAgentStateChanged(agent_host, attached);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
base::DictionaryValue* DevToolsManagerDelegate::HandleCommand(
|
base::DictionaryValue* DevToolsManagerDelegate::HandleCommand(
|
||||||
content::DevToolsAgentHost* agent_host,
|
DevToolsAgentHost* agent_host,
|
||||||
base::DictionaryValue* command) {
|
base::DictionaryValue* command) {
|
||||||
return handler_->HandleCommand(agent_host, command);
|
return handler_->HandleCommand(agent_host, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scoped_refptr<content::DevToolsAgentHost>
|
||||||
|
DevToolsManagerDelegate::::CreateNewTarget(const GURL& url) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace brightray
|
} // namespace brightray
|
||||||
|
|
|
@ -7,31 +7,27 @@
|
||||||
|
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "components/devtools_http_handler/devtools_http_handler_delegate.h"
|
#include "content/browser/devtools/devtools_http_handler.h"
|
||||||
#include "content/public/browser/devtools_manager_delegate.h"
|
#include "content/public/browser/devtools_manager_delegate.h"
|
||||||
|
|
||||||
namespace devtools_http_handler {
|
|
||||||
class DevToolsHttpHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace brightray {
|
namespace brightray {
|
||||||
|
|
||||||
class DevToolsNetworkProtocolHandler;
|
class DevToolsNetworkProtocolHandler;
|
||||||
|
|
||||||
class DevToolsManagerDelegate : public content::DevToolsManagerDelegate {
|
class DevToolsManagerDelegate : public content::DevToolsManagerDelegate {
|
||||||
public:
|
public:
|
||||||
static devtools_http_handler::DevToolsHttpHandler* CreateHttpHandler();
|
static content::DevToolsHttpHandler* CreateHttpHandler();
|
||||||
|
|
||||||
DevToolsManagerDelegate();
|
DevToolsManagerDelegate();
|
||||||
virtual ~DevToolsManagerDelegate();
|
virtual ~DevToolsManagerDelegate();
|
||||||
|
|
||||||
// DevToolsManagerDelegate implementation.
|
// DevToolsManagerDelegate implementation.
|
||||||
void Inspect(content::BrowserContext* browser_context,
|
void Inspect(content::DevToolsAgentHost* agent_host) override;
|
||||||
content::DevToolsAgentHost* agent_host) override {}
|
base::DictionaryValue* HandleCommand(
|
||||||
void DevToolsAgentStateChanged(content::DevToolsAgentHost* agent_host,
|
content::DevToolsAgentHost* agent_host,
|
||||||
bool attached) override;
|
base::DictionaryValue* command) override;
|
||||||
base::DictionaryValue* HandleCommand(content::DevToolsAgentHost* agent_host,
|
scoped_refptr<content::DevToolsAgentHost> CreateNewTarget(
|
||||||
base::DictionaryValue* command) override;
|
const GURL& url) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<DevToolsNetworkProtocolHandler> handler_;
|
std::unique_ptr<DevToolsNetworkProtocolHandler> handler_;
|
||||||
|
|
Loading…
Reference in a new issue