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

Unified Diff: content/common/child_resource_message_filter.cc

Issue 14359004: Inject renderer recieve message time into resource notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added description comment Created 7 years, 8 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/common/child_resource_message_filter.cc
diff --git a/content/common/child_resource_message_filter.cc b/content/common/child_resource_message_filter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7704c5e664fc63ecba4076bfe81879f636bbfdef
--- /dev/null
+++ b/content/common/child_resource_message_filter.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/common/child_resource_message_filter.h"
+
+#include "base/thread_task_runner_handle.h"
+#include "content/common/resource_dispatcher.h"
+#include "content/common/resource_messages.h"
+
+namespace content {
+
+ChildResourceMessageFilter::ChildResourceMessageFilter(
+ ResourceDispatcher* resource_dispatcher)
+ : main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()),
+ resource_dispatcher_(resource_dispatcher) {}
+
+ChildResourceMessageFilter::~ChildResourceMessageFilter() {}
+
+bool ChildResourceMessageFilter::OnMessageReceived(
+ const IPC::Message& message) {
+ if (message.type() == ResourceMsg_RequestComplete::ID ||
+ message.type() == ResourceMsg_ReceivedResponse::ID ||
+ message.type() == ResourceMsg_ReceivedRedirect::ID) {
+ main_thread_task_runner_->PostTask(FROM_HERE, base::Bind(
+ &ResourceDispatcher::set_io_timestamp,
+ base::Unretained(resource_dispatcher_),
+ base::TimeTicks::Now()));
+ }
+ return false;
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698