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

Unified Diff: Source/platform/TraceLocation.h

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
Index: Source/platform/TraceLocation.h
diff --git a/Source/platform/TraceLocation.h b/Source/platform/TraceLocation.h
new file mode 100644
index 0000000000000000000000000000000000000000..a1661f9267bd30b2a439a9a8705be937398cb8c5
--- /dev/null
+++ b/Source/platform/TraceLocation.h
@@ -0,0 +1,40 @@
+// Copyright 2014 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.
+
+#ifndef TraceLocation_h
+#define TraceLocation_h
+
+// This is intentionally similar to base/location.h
+// that we could easily replace usage of TraceLocation
+// with base::Location after merging into Chromium.
+
+namespace WebCore {
+
+class PLATFORM_EXPORT TraceLocation {
abarth-chromium 2014/03/09 22:19:10 No need to export a lass that's entirely inline.
+public:
+ // Currenetly only store the bits used in Blink, base::Location stores more.
+ // These char*s are not copied and must live for the duration of the program.
+ TraceLocation(const char* functionName, const char* fileName)
+ : m_functionName(functionName)
+ , m_fileName(fileName)
+ { }
+
+ TraceLocation()
+ : m_functionName("unknown")
+ , m_fileName("unknown")
+ { }
+
+ const char* functionName() const { return m_functionName; }
+ const char* fileName() const { return m_fileName; }
+
+private:
+ const char* m_functionName;
+ const char* m_fileName;
+};
+
+#define FROM_HERE WebCore::TraceLocation(__FUNCTION__, __FILE__)
+
+}
+
+#endif // TraceLocation_h

Powered by Google App Engine
This is Rietveld 408576698