From af97f34ab0b94060c5334599c7718e1bec493465 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 19 Nov 2014 17:56:37 +0000 Subject: [PATCH] Make CefBrowserHost::CloseDevTools behave like CefBrowserHost::Close was called on the DevTools browser (issue #1439). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1916 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser/browser_host_impl.cc | 2 -- libcef/browser/devtools_frontend.cc | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index eca55e5a0..933a2bdf8 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -850,9 +850,7 @@ void CefBrowserHostImpl::CloseDevTools() { if (CEF_CURRENTLY_ON_UIT()) { if (!devtools_frontend_) return; - devtools_observer_.reset(); devtools_frontend_->Close(); - devtools_frontend_ = NULL; } else { CEF_POST_TASK(CEF_UIT, base::Bind(&CefBrowserHostImpl::CloseDevTools, this)); diff --git a/libcef/browser/devtools_frontend.cc b/libcef/browser/devtools_frontend.cc index 6ce309ab3..5d1b75cb1 100644 --- a/libcef/browser/devtools_frontend.cc +++ b/libcef/browser/devtools_frontend.cc @@ -7,6 +7,7 @@ #include "libcef/browser/content_browser_client.h" #include "libcef/browser/devtools_delegate.h" #include "libcef/browser/request_context_impl.h" +#include "libcef/browser/thread_util.h" #include "base/command_line.h" #include "base/json/json_reader.h" @@ -73,7 +74,8 @@ void CefDevToolsFrontend::Focus() { } void CefDevToolsFrontend::Close() { - frontend_browser_->CloseBrowser(true); + CEF_POST_TASK(CEF_UIT, + base::Bind(&CefBrowserHostImpl::CloseBrowser, frontend_browser_, true)); } CefDevToolsFrontend::CefDevToolsFrontend( @@ -155,5 +157,6 @@ void CefDevToolsFrontend::DispatchProtocolMessage( void CefDevToolsFrontend::AgentHostClosed( content::DevToolsAgentHost* agent_host, bool replaced) { + DCHECK(agent_host == agent_host_.get()); Close(); }