Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2352)

Unified Diff: content/shell/browser/shell_devtools_frontend.cc

Issue 427143003: [DevTools] Move DevToolsClientHost functionality out of DevToolsFrontendHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/shell/browser/shell_devtools_frontend.cc
diff --git a/content/shell/browser/shell_devtools_frontend.cc b/content/shell/browser/shell_devtools_frontend.cc
index e64685dcec5186c38d7eb6268a82601012415580..fe30eddef0c8e94ebb52eb416e94017c8683a661 100644
--- a/content/shell/browser/shell_devtools_frontend.cc
+++ b/content/shell/browser/shell_devtools_frontend.cc
@@ -106,8 +106,6 @@ ShellDevToolsFrontend::ShellDevToolsFrontend(Shell* frontend_shell,
: WebContentsObserver(frontend_shell->web_contents()),
frontend_shell_(frontend_shell),
agent_host_(agent_host) {
- frontend_host_.reset(
- DevToolsClientHost::CreateDevToolsFrontendHost(web_contents(), this));
}
ShellDevToolsFrontend::~ShellDevToolsFrontend() {
@@ -115,11 +113,11 @@ ShellDevToolsFrontend::~ShellDevToolsFrontend() {
void ShellDevToolsFrontend::RenderViewCreated(
RenderViewHost* render_view_host) {
- DevToolsClientHost::SetupDevToolsFrontendClient(
- web_contents()->GetRenderViewHost());
- DevToolsManager* manager = DevToolsManager::GetInstance();
- manager->RegisterDevToolsClientHostFor(agent_host_.get(),
- frontend_host_.get());
+ if (!frontend_host_) {
+ frontend_host_.reset(DevToolsFrontendHost::Create(render_view_host, this));
+ DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor(
+ agent_host_.get(), this);
+ }
}
void ShellDevToolsFrontend::DocumentOnLoadCompletedInMainFrame() {
@@ -128,7 +126,7 @@ void ShellDevToolsFrontend::DocumentOnLoadCompletedInMainFrame() {
}
void ShellDevToolsFrontend::WebContentsDestroyed() {
- DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_.get());
+ DevToolsManager::GetInstance()->ClientHostClosing(this);
delete this;
}
@@ -137,6 +135,18 @@ void ShellDevToolsFrontend::RenderProcessGone(base::TerminationStatus status) {
WebKitTestController::Get()->DevToolsProcessCrashed();
}
+void ShellDevToolsFrontend::HandleMessageFromDevToolsFrontendToBackend(
+ const std::string& message) {
+ DevToolsManager::GetInstance()->DispatchOnInspectorBackend(
+ this, message);
+}
+
+void ShellDevToolsFrontend::DispatchOnInspectorFrontend(
+ const std::string& message) {
+ if (frontend_host_)
+ frontend_host_->DispatchOnDevToolsFrontend(message);
+}
+
void ShellDevToolsFrontend::InspectedContentsClosing() {
frontend_shell_->Close();
}

Powered by Google App Engine
This is Rietveld 408576698