summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-11-29 12:53:33 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-11-29 12:11:12 +0000
commit4dd3a30491e1630b389cede36c8f3ac89f5be01a (patch)
tree425ce780889c9ef3782969c467ffa2858de819ff
parente36dcec23b79a52fd7794ed2fad49bbf65a8146b (diff)
downloadqtwebengine-chromium-4dd3a30491e1630b389cede36c8f3ac89f5be01a.tar.gz
Fix API to allow InspectElement to work with remote inspector
With the remote inspector, the internal server creates the clients, and we in the external API does not know the client. The devtools agent host impl does however know all the sessions, and when there can be only one it can figure it out. Change-Id: I55a79cc90d39e6203d74a63ce86575599fe58232 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--chromium/content/browser/devtools/devtools_agent_host_impl.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chromium/content/browser/devtools/devtools_agent_host_impl.cc b/chromium/content/browser/devtools/devtools_agent_host_impl.cc
index 184becccee2..9b203830e41 100644
--- a/chromium/content/browser/devtools/devtools_agent_host_impl.cc
+++ b/chromium/content/browser/devtools/devtools_agent_host_impl.cc
@@ -229,9 +229,15 @@ void DevToolsAgentHostImpl::InspectElement(
DevToolsAgentHostClient* client,
int x,
int y) {
- DevToolsSession* session = SessionByClient(client);
+ DevToolsSession* session = nullptr;
+ if (client)
+ session = SessionByClient(client);
+ else if (sessions_.size() == 1)
+ session = *sessions_.begin();
if (session)
InspectElement(session, x, y);
+ else
+ LOG(WARNING) << "InspectElement called with unknown or ambigious client";
}
std::string DevToolsAgentHostImpl::GetId() {