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

Unified Diff: content/renderer/devtools/devtools_agent_filter.h

Issue 14646006: Inject timestamps to resource messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 7 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
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_;

Powered by Google App Engine
This is Rietveld 408576698