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

Unified Diff: Source/web/WebDevToolsAgentImpl.cpp

Issue 201363002: DevTools: defer styles delta calculation to until the end of the task. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: For landing Created 6 years, 9 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
« no previous file with comments | « Source/web/WebDevToolsAgentImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebDevToolsAgentImpl.cpp
diff --git a/Source/web/WebDevToolsAgentImpl.cpp b/Source/web/WebDevToolsAgentImpl.cpp
index 44305b61c853a28a67cf7da6f0fc1e535a46e0a1..452c9c17859528dda71436da251db4b33f73bab5 100644
--- a/Source/web/WebDevToolsAgentImpl.cpp
+++ b/Source/web/WebDevToolsAgentImpl.cpp
@@ -117,6 +117,11 @@ private:
return;
m_running = true;
+ // 0. Flush pending frontend messages.
+ WebViewImpl* viewImpl = WebViewImpl::fromPage(page);
+ WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>(viewImpl->devToolsAgent());
+ agent->flushPendingFrontendMessages();
+
Vector<WebViewImpl*> views;
// 1. Disable input events.
@@ -567,9 +572,7 @@ void WebDevToolsAgentImpl::sendMessageToFrontend(PassRefPtr<WebCore::JSONObject>
void WebDevToolsAgentImpl::flush()
{
- for (size_t i = 0; i < m_frontendMessageQueue.size(); ++i)
- m_client->sendMessageToInspectorFrontend(m_frontendMessageQueue[i]->toJSONString());
- m_frontendMessageQueue.clear();
+ flushPendingFrontendMessages();
}
void WebDevToolsAgentImpl::updateInspectorStateCookie(const String& state)
@@ -603,18 +606,31 @@ void WebDevToolsAgentImpl::evaluateInWebInspector(long callId, const WebString&
ic->evaluateForTestInFrontend(callId, script);
}
+void WebDevToolsAgentImpl::flushPendingFrontendMessages()
+{
+ InspectorController* ic = inspectorController();
+ ic->flushPendingFrontendMessages();
+
+ for (size_t i = 0; i < m_frontendMessageQueue.size(); ++i)
+ m_client->sendMessageToInspectorFrontend(m_frontendMessageQueue[i]->toJSONString());
+ m_frontendMessageQueue.clear();
+}
+
void WebDevToolsAgentImpl::willProcessTask()
{
+ if (!m_attached)
+ return;
if (InspectorController* ic = inspectorController())
ic->willProcessTask();
}
void WebDevToolsAgentImpl::didProcessTask()
{
+ if (!m_attached)
+ return;
if (InspectorController* ic = inspectorController())
ic->didProcessTask();
- if (m_attached)
- flush();
+ flushPendingFrontendMessages();
}
WebString WebDevToolsAgent::inspectorProtocolVersion()
« no previous file with comments | « Source/web/WebDevToolsAgentImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698