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

Unified Diff: headless/lib/browser/headless_devtools_client_impl.cc

Issue 2531313002: Expose the full API for attaching devtools clients: (Closed)
Patch Set: Addressed code review comments Created 4 years, 1 month 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: headless/lib/browser/headless_devtools_client_impl.cc
diff --git a/headless/lib/browser/headless_devtools_client_impl.cc b/headless/lib/browser/headless_devtools_client_impl.cc
index 318ab8543cea28eb4f2a0c85010532305e53963e..22f52946e4969707b50dac9e77528cb9fe6b6065 100644
--- a/headless/lib/browser/headless_devtools_client_impl.cc
+++ b/headless/lib/browser/headless_devtools_client_impl.cc
@@ -69,11 +69,21 @@ HeadlessDevToolsClientImpl::HeadlessDevToolsClientImpl()
HeadlessDevToolsClientImpl::~HeadlessDevToolsClientImpl() {}
-void HeadlessDevToolsClientImpl::AttachToHost(
+bool HeadlessDevToolsClientImpl::AttachToHost(
+ content::DevToolsAgentHost* agent_host) {
+ DCHECK(!agent_host_);
+ if (agent_host->AttachClient(this)) {
+ agent_host_ = agent_host;
+ return true;
+ }
+ return false;
+}
+
+void HeadlessDevToolsClientImpl::ForceAttachToHost(
content::DevToolsAgentHost* agent_host) {
DCHECK(!agent_host_);
agent_host_ = agent_host;
- agent_host_->AttachClient(this);
+ agent_host_->ForceAttachClient(this);
}
void HeadlessDevToolsClientImpl::DetachFromHost(
« no previous file with comments | « headless/lib/browser/headless_devtools_client_impl.h ('k') | headless/lib/browser/headless_web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698