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

Unified Diff: cc/output/begin_frame_args.cc

Issue 735723005: cc: Adding creation location to debug BeginFrameArgs objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch without DEPS. Created 6 years, 1 month 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: cc/output/begin_frame_args.cc
diff --git a/cc/output/begin_frame_args.cc b/cc/output/begin_frame_args.cc
index 0be93180f8783aa699fa618e19a2ddc1374a7c47..b7b21f73167f90173a0323689ea5f3fab95be1fe 100644
--- a/cc/output/begin_frame_args.cc
+++ b/cc/output/begin_frame_args.cc
@@ -41,12 +41,20 @@ BeginFrameArgs::BeginFrameArgs(base::TimeTicks frame_time,
type(type) {
}
-BeginFrameArgs BeginFrameArgs::Create(base::TimeTicks frame_time,
+BeginFrameArgs BeginFrameArgs::Create(const tracked_objects::Location* location,
+ base::TimeTicks frame_time,
base::TimeTicks deadline,
base::TimeDelta interval,
BeginFrameArgs::BeginFrameArgsType type) {
DCHECK_NE(type, BeginFrameArgs::INVALID);
+#ifdef NDEBUG
return BeginFrameArgs(frame_time, deadline, interval, type);
+#else
+ BeginFrameArgs args = BeginFrameArgs(frame_time, deadline, interval, type);
+ args.created_by = *location;
+ delete location;
brianderson 2014/11/19 20:43:29 Would it be better to use a scoped_ptr instead of
mithro-old 2014/11/20 04:30:13 I tried to use a scope pointer but C++ is not smar
danakj 2014/11/20 16:02:19 It's not a matter of smarts. scoped_ptr is move-on
mithro-old 2014/11/21 05:57:46 Yes, scoped_ptr is move-only. The compiler should
danakj 2014/11/21 14:58:07 Why do you need to change the type to a void*? It
danakj 2014/11/21 15:03:43 Ah, I see what you've done. I don't really see the
+ return args;
+#endif
}
scoped_refptr<base::debug::ConvertableToTraceFormat> BeginFrameArgs::AsValue()
@@ -63,6 +71,11 @@ void BeginFrameArgs::AsValueInto(base::debug::TracedValue* state) const {
state->SetDouble("frame_time_us", frame_time.ToInternalValue());
state->SetDouble("deadline_us", deadline.ToInternalValue());
state->SetDouble("interval_us", interval.InMicroseconds());
+#ifndef NDEBUG
+ std::string created_by_str("");
+ created_by.Write(true, true, &created_by_str);
+ state->SetString("created_by", created_by_str);
+#endif
}
// This is a hard-coded deadline adjustment that assumes 60Hz, to be used in

Powered by Google App Engine
This is Rietveld 408576698