Index: content/renderer/devtools/devtools_agent_filter.h |
diff --git a/content/renderer/devtools/devtools_agent_filter.h b/content/renderer/devtools/devtools_agent_filter.h |
index e7f78613807bcccb8f50885661dbf2a1e8acf3b9..1b99fcdba27fd7f99a5f23ae04c545dbd07f35eb 100644 |
--- a/content/renderer/devtools/devtools_agent_filter.h |
+++ b/content/renderer/devtools/devtools_agent_filter.h |
@@ -16,6 +16,7 @@ class MessageLoop; |
} |
namespace content { |
+class ResourceDispatcher; |
// DevToolsAgentFilter is registered as an IPC filter in order to be able to |
// dispatch messages while on the IO thread. The reason for that is that while |
@@ -23,10 +24,15 @@ namespace content { |
// are being dispatched there. While holding the thread in a tight loop, |
// v8 provides thread-safe Api for controlling debugger. In our case v8's Api |
// is being used from this communication agent on the IO thread. |
+// |
+// Another reason is that ResourceDispatcher needs child process timestamps |
+// not affected by long rendering / JS tasks. When specific resource message is |
+// processed "ResourceDispatcher::set_io_timestamp" task with bound timestamp |
+// is posted to main thread. It is served just before resource message. |
class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter { |
public: |
// There is a single instance of this class instantiated by the RenderThread. |
- DevToolsAgentFilter(); |
+ explicit DevToolsAgentFilter(ResourceDispatcher* resource_dispatcher); |
static void SendRpcMessage(const DevToolsMessageData& data); |
@@ -39,6 +45,7 @@ class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter { |
private: |
void OnDispatchOnInspectorBackend(const std::string& message); |
+ ResourceDispatcher* resource_dispatcher_; |
bool message_handled_; |
base::MessageLoop* render_thread_loop_; |
int current_routing_id_; |