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-12-05 17:04:19 +0100
commit134fd03a9e08dddd3151a86a5bde66f54ccfbc2a (patch)
treefa1322688abccb59e67b09d1b7868fe3e349ae2e
parenta95607c23d7153e018d92184dcf37a1dad4e8e82 (diff)
downloadqtwebengine-chromium-134fd03a9e08dddd3151a86a5bde66f54ccfbc2a.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 87e2259d1c4..d7fbb8f76c2 100644
--- a/chromium/content/browser/devtools/devtools_agent_host_impl.cc
+++ b/chromium/content/browser/devtools/devtools_agent_host_impl.cc
@@ -224,9 +224,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() {