Bug 1451853 - Include Firefox build id and source URL in profiler meta information. r?mstange
MozReview-Commit-ID: 5MBM31f2UjP
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -1545,16 +1545,20 @@ StreamTaskTracer(PSLockRef aLock, Splice
static void
StreamMetaJSCustomObject(PSLockRef aLock, SpliceableJSONWriter& aWriter,
bool aIsShuttingDown)
{
MOZ_RELEASE_ASSERT(CorePS::Exists() && ActivePS::Exists(aLock));
aWriter.IntProperty("version", 9);
+#if defined(MOZ_SOURCE_URL)
+ aWriter.StringProperty("sourceURL", "@MOZ_SOURCE_URL@");
+#endif
+
// The "startTime" field holds the number of milliseconds since midnight
// January 1, 1970 GMT. This grotty code computes (Now - (Now -
// ProcessStartTime)) to convert CorePS::ProcessStartTime() into that form.
TimeDuration delta = TimeStamp::Now() - CorePS::ProcessStartTime();
aWriter.DoubleProperty(
"startTime", static_cast<double>(PR_Now()/1000.0 - delta.ToMilliseconds()));
// Write the shutdownTime field. Unlike startTime, shutdownTime is not an
@@ -1631,16 +1635,20 @@ StreamMetaJSCustomObject(PSLockRef aLock
nsCOMPtr<nsIXULAppInfo> appInfo =
do_GetService("@mozilla.org/xre/app-info;1");
if (appInfo) {
nsAutoCString string;
res = appInfo->GetName(string);
if (!NS_FAILED(res))
aWriter.StringProperty("product", string.Data());
+
+ res = appInfo->GetAppBuildID(string);
+ if (!NS_FAILED(res))
+ aWriter.StringProperty("appBuildID", string.Data());
}
aWriter.StartObjectProperty("extensions");
{
{
JSONSchemaWriter schema(aWriter);
schema.WriteField("id");
schema.WriteField("name");