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

Unified Diff: cc/output/latency_info_swap_promise.cc

Issue 1835303002: Implementation of the GreenWeb language extensions. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change GreenWeb-related CSS property names such that they apply in the desired order at runtime. Created 4 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 | « cc/DEPS ('k') | content/renderer/greenweb_latency_tracking.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/latency_info_swap_promise.cc
diff --git a/cc/output/latency_info_swap_promise.cc b/cc/output/latency_info_swap_promise.cc
index 3b267454076e574b01a510403395d2f3b08aec3c..ee15e10856e9b6cda4f2921bec15cb98b1e8fce3 100644
--- a/cc/output/latency_info_swap_promise.cc
+++ b/cc/output/latency_info_swap_promise.cc
@@ -4,8 +4,12 @@
#include "cc/output/latency_info_swap_promise.h"
+#include <iostream>
+
#include "base/logging.h"
+#include "base/threading/platform_thread.h"
#include "base/trace_event/trace_event.h"
+#include "content/renderer/greenweb_latency_tracking.h"
namespace {
ui::LatencyComponentType DidNotSwapReasonToLatencyComponentType(
@@ -57,6 +61,34 @@ void LatencyInfoSwapPromise::OnCommit() {
TRACE_ID_DONT_MANGLE(TraceId()),
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT,
"step", "HandleInputEventMainCommit");
+
+ int64 trace_id = TraceId();
+ if (InputLatencyMap.find(trace_id) != InputLatencyMap.end()) {
+ int64 dom_node = InputLatencyMap[trace_id].dom_node;
+ if (dom_node) {
+ base::TimeTicks layout_end_ts = base::TimeTicks::Now();
+ base::TimeDelta latency = layout_end_ts - InputLatencyMap[trace_id].callback_start;
+ InputLatencyMap[trace_id].latency = latency.InMilliseconds();
+
+ DOMLatencyMap[dom_node].latency = InputLatencyMap[trace_id].latency;
+
+ content::process_freq_stat(&(InputLatencyMap[trace_id].FreqStatStartMap), &(DOMLatencyMap[dom_node].FreqStatMap));
+
+#ifdef EBS_DEBUG_TRACE_EVENT
+ TRACE_EVENT2("devtools.timeline", "GreenWeb:StyleLayout",
+ "trace_id", TraceId(),
+ "latency", DOMLatencyMap[dom_node].latency);
+ std::cout << "Thd: " << base::PlatformThread::CurrentId() <<
+ " (" << base::PlatformThread::GetName() << ")" <<
+ " StyleLayout "
+ " trace_id " << trace_id <<
+ " dom_node " << dom_node <<
+ " latency " << DOMLatencyMap[dom_node].latency << std::endl;
+#endif
+ }
+ // Erase this trace_id because it will not used in the future
+ InputLatencyMap.erase(trace_id);
+ }
}
} // namespace cc
« no previous file with comments | « cc/DEPS ('k') | content/renderer/greenweb_latency_tracking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698