summaryrefslogtreecommitdiffstats
path: root/src/core/devtools_frontend_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-12-19 12:37:02 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-01-25 14:41:06 +0000
commitf4a8ce98bd371acf1ca1eb2c58a8403e8795a670 (patch)
tree1f2305261b605aae31e5f8737ffcb275986baf1e /src/core/devtools_frontend_qt.cpp
parent448478729cfdf5098dd24a6a870bacdbcd8cf9a7 (diff)
Adaptations for Chromium 63
Change-Id: I551c7091bbc0463bed94180313eb2bfe92f0ad84 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/devtools_frontend_qt.cpp')
-rw-r--r--src/core/devtools_frontend_qt.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 7330090e7..f715eefbf 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -123,9 +123,9 @@ int ResponseWriter::Write(net::IOBuffer *buffer, int num_bytes, const net::Compl
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
- base::Bind(&DevToolsFrontendQt::CallClientFunction, shell_devtools_,
- "DevToolsAPI.streamWrite", base::Owned(id),
- base::Owned(chunkValue), nullptr));
+ base::BindOnce(&DevToolsFrontendQt::CallClientFunction,
+ shell_devtools_, "DevToolsAPI.streamWrite",
+ base::Owned(id), base::Owned(chunkValue), nullptr));
return num_bytes;
}
@@ -259,6 +259,8 @@ void DevToolsFrontendQt::DocumentAvailableInMainFrame()
scoped_refptr<content::DevToolsAgentHost> agent_host =
content::DevToolsAgentHost::GetOrCreateFor(m_inspectedContents);
if (agent_host != m_agentHost) {
+ if (m_agentHost)
+ m_agentHost->DetachClient(this);
m_agentHost = agent_host;
m_agentHost->AttachClient(this);
if (m_inspect_element_at_x != -1) {
@@ -274,8 +276,10 @@ void DevToolsFrontendQt::WebContentsDestroyed()
if (m_inspectedContents)
static_cast<WebContentsDelegateQt *>(m_inspectedContents->GetDelegate())->webContentsAdapter()->devToolsFrontendDestroyed(this);
- if (m_agentHost)
+ if (m_agentHost) {
m_agentHost->DetachClient(this);
+ m_agentHost = nullptr;
+ }
delete this;
}
@@ -327,8 +331,6 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me
dict->GetList("params", &params);
if (method == "dispatchProtocolMessage" && params && params->GetSize() == 1) {
- if (!m_agentHost || !m_agentHost->IsAttached())
- return;
std::string protocol_message;
if (!params->GetString(0, &protocol_message))
return;
@@ -386,7 +388,7 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me
fetcher->Start();
return;
} else if (method == "getPreferences") {
- m_preferences = *m_prefStore->GetValues();
+ m_preferences = std::move(*m_prefStore->GetValues());
SendMessageAck(request_id, &m_preferences);
return;
} else if (method == "setPreference") {