mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Remove CefBrowserHost::GetDevToolsURL(). It is now possible to use DevTools without remote debugging, and the ability to load a remote debugging URL without first loading the discovery page is no longer supported (issue #659).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1511 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -571,11 +571,6 @@ CefRefPtr<CefRequestContext> CefBrowserHostImpl::GetRequestContext() {
|
||||
return request_context_;
|
||||
}
|
||||
|
||||
CefString CefBrowserHostImpl::GetDevToolsURL(bool http_scheme) {
|
||||
base::AutoLock lock_scope(state_lock_);
|
||||
return (http_scheme ? devtools_url_http_ : devtools_url_chrome_);
|
||||
}
|
||||
|
||||
double CefBrowserHostImpl::GetZoomLevel() {
|
||||
// Verify that this method is being called on the UI thread.
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
@@ -1938,17 +1933,6 @@ void CefBrowserHostImpl::RenderViewCreated(
|
||||
browser_info_->add_render_id(render_view_host->GetProcess()->GetID(),
|
||||
render_view_host->GetRoutingID());
|
||||
|
||||
// Update the DevTools URLs, if any.
|
||||
CefDevToolsDelegate* devtools_delegate =
|
||||
CefContentBrowserClient::Get()->devtools_delegate();
|
||||
if (devtools_delegate) {
|
||||
base::AutoLock lock_scope(state_lock_);
|
||||
devtools_url_http_ =
|
||||
devtools_delegate->GetDevToolsURL(render_view_host, true);
|
||||
devtools_url_chrome_ =
|
||||
devtools_delegate->GetDevToolsURL(render_view_host, false);
|
||||
}
|
||||
|
||||
// May be already registered if the renderer crashed previously.
|
||||
if (!registrar_->IsRegistered(
|
||||
this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
|
||||
|
@@ -115,7 +115,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
virtual CefWindowHandle GetOpenerWindowHandle() OVERRIDE;
|
||||
virtual CefRefPtr<CefClient> GetClient() OVERRIDE;
|
||||
virtual CefRefPtr<CefRequestContext> GetRequestContext() OVERRIDE;
|
||||
virtual CefString GetDevToolsURL(bool http_scheme) OVERRIDE;
|
||||
virtual double GetZoomLevel() OVERRIDE;
|
||||
virtual void SetZoomLevel(double zoomLevel) OVERRIDE;
|
||||
virtual void RunFileDialog(
|
||||
@@ -519,8 +518,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
bool can_go_forward_;
|
||||
bool has_document_;
|
||||
GURL loading_url_;
|
||||
CefString devtools_url_http_;
|
||||
CefString devtools_url_chrome_;
|
||||
|
||||
// Messages we queue while waiting for the RenderView to be ready. We queue
|
||||
// them here instead of in the RenderProcessHost to ensure that they're sent
|
||||
|
@@ -144,27 +144,6 @@ scoped_ptr<content::DevToolsTarget> CefDevToolsDelegate::CreateNewTarget(
|
||||
return scoped_ptr<content::DevToolsTarget>();
|
||||
}
|
||||
|
||||
scoped_ptr<content::DevToolsTarget> CefDevToolsDelegate::CreateTargetForId(
|
||||
const std::string& id) {
|
||||
scoped_ptr<content::DevToolsTarget> target;
|
||||
|
||||
std::vector<content::RenderViewHost*> rvh_list =
|
||||
content::DevToolsAgentHost::GetValidRenderViewHosts();
|
||||
for (std::vector<content::RenderViewHost*>::iterator it = rvh_list.begin();
|
||||
it != rvh_list.end(); ++it) {
|
||||
scoped_refptr<content::DevToolsAgentHost> agent_host(
|
||||
content::DevToolsAgentHost::GetOrCreateFor(*it));
|
||||
if (agent_host->GetId() == id) {
|
||||
content::WebContents* web_contents =
|
||||
content::WebContents::FromRenderViewHost(*it);
|
||||
target.reset(new Target(web_contents));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return target.Pass();
|
||||
}
|
||||
|
||||
void CefDevToolsDelegate::EnumerateTargets(TargetCallback callback) {
|
||||
TargetList targets;
|
||||
std::vector<content::RenderViewHost*> rvh_list =
|
||||
@@ -190,29 +169,3 @@ std::string CefDevToolsDelegate::GetChromeDevToolsURL() {
|
||||
return base::StringPrintf("%s://%s/devtools.html",
|
||||
chrome::kChromeDevToolsScheme, scheme::kChromeDevToolsHost);
|
||||
}
|
||||
|
||||
std::string CefDevToolsDelegate::GetDevToolsURL(content::RenderViewHost* rvh,
|
||||
bool http_scheme) {
|
||||
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
||||
std::string port_str =
|
||||
command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort);
|
||||
DCHECK(!port_str.empty());
|
||||
int port;
|
||||
if (!base::StringToInt(port_str, &port))
|
||||
return std::string();
|
||||
|
||||
scoped_refptr<content::DevToolsAgentHost> agent_host(
|
||||
content::DevToolsAgentHost::GetOrCreateFor(rvh));
|
||||
|
||||
const std::string& page_id = agent_host->GetId();
|
||||
const std::string& host = http_scheme ?
|
||||
base::StringPrintf("http://localhost:%d/devtools/", port) :
|
||||
base::StringPrintf("%s://%s/", chrome::kChromeDevToolsScheme,
|
||||
scheme::kChromeDevToolsHost);
|
||||
|
||||
return base::StringPrintf(
|
||||
"%sdevtools.html?ws=localhost:%d/devtools/page/%s",
|
||||
host.c_str(),
|
||||
port,
|
||||
page_id.c_str());
|
||||
}
|
||||
|
@@ -35,8 +35,6 @@ class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate {
|
||||
virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE;
|
||||
virtual scoped_ptr<content::DevToolsTarget> CreateNewTarget(const GURL& url)
|
||||
OVERRIDE;
|
||||
virtual scoped_ptr<content::DevToolsTarget> CreateTargetForId(
|
||||
const std::string& id) OVERRIDE;
|
||||
virtual void EnumerateTargets(TargetCallback callback) OVERRIDE;
|
||||
virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering(
|
||||
net::StreamListenSocket::Delegate* delegate,
|
||||
@@ -45,9 +43,6 @@ class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate {
|
||||
// Returns the chrome-devtools URL.
|
||||
std::string GetChromeDevToolsURL();
|
||||
|
||||
// Returns the DevTools URL for the specified RenderViewHost.
|
||||
std::string GetDevToolsURL(content::RenderViewHost* rvh, bool http_scheme);
|
||||
|
||||
private:
|
||||
content::DevToolsHttpHandler* devtools_http_handler_;
|
||||
|
||||
|
Reference in New Issue
Block a user