Backed out changeset 319231c9be3b (bug 1450690) until regressions caused by it are sorted out. DEVEDITION_60_0b12_BUILD1 DEVEDITION_60_0b12_RELEASE FENNEC_60_0b12_BUILD1 FENNEC_60_0b12_RELEASE FIREFOX_60_0b12_BUILD1 FIREFOX_60_0b12_RELEASE
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 12 Apr 2018 13:29:40 -0400
changeset 463213 64eeb41e22928c9307606e9cb77afe37c0730000
parent 463212 5a573ad73b78509ff92daed4d161fb9244fb8dc1
child 463214 1a28079c76c712bbf75d76a1dd93921f6244a199
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1450690
milestone60.0
backs out319231c9be3b788474869fa2fe2fa1f98fef7b72
Backed out changeset 319231c9be3b (bug 1450690) until regressions caused by it are sorted out.
toolkit/components/telemetry/TelemetryEvent.cpp
toolkit/components/telemetry/tests/unit/test_TelemetryEvents.js
--- a/toolkit/components/telemetry/TelemetryEvent.cpp
+++ b/toolkit/components/telemetry/TelemetryEvent.cpp
@@ -121,22 +121,22 @@ typedef nsClassHashtable<nsCStringHashKe
 
 struct EventKey {
   uint32_t id;
   bool dynamic;
 };
 
 struct DynamicEventInfo {
   DynamicEventInfo(const nsACString& category, const nsACString& method,
-                   const nsACString& object, nsTArray<nsCString>& extra_keys,
+                   const nsACString& object, nsTArray<nsCString>&& extra_keys,
                    bool recordOnRelease)
     : category(category)
     , method(method)
     , object(object)
-    , extra_keys(extra_keys)
+    , extra_keys(Move(extra_keys))
     , recordOnRelease(recordOnRelease)
   {}
 
   DynamicEventInfo(const DynamicEventInfo&) = default;
   DynamicEventInfo& operator=(const DynamicEventInfo&) = delete;
 
   const nsCString category;
   const nsCString method;
@@ -1061,17 +1061,17 @@ TelemetryEvent::RegisterEvents(const nsA
     }
 
     // Append event infos to be registered.
     for (auto& method : methods) {
       for (auto& object : objects) {
         // We defer the actual registration here in case any other event description is invalid.
         // In that case we don't need to roll back any partial registration.
         DynamicEventInfo info{aCategory, method, object,
-                              extra_keys, recordOnRelease};
+                              Move(extra_keys), recordOnRelease};
         newEventInfos.AppendElement(info);
         newEventExpired.AppendElement(expired);
       }
     }
   }
 
   {
     StaticMutexAutoLock locker(gTelemetryEventsMutex);
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEvents.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEvents.js
@@ -292,17 +292,17 @@ add_task(async function test_unicodeValu
   let snapshot = Telemetry.snapshotEvents(OPTIN, true);
   Assert.ok(("parent" in snapshot), "Should have entry for main process.");
   let events = snapshot.parent;
   Assert.equal(events.length, 2, "Should have recorded 2 events.");
   Assert.equal(events[0][4], value, "Should have recorded the right value.");
   Assert.equal(events[1][5].key1, value, "Should have recorded the right extra value.");
 });
 
-add_task(async function test_dynamicEvents() {
+add_task(function* test_dynamicEvents() {
   Telemetry.clearEvents();
   Telemetry.canRecordExtended = true;
 
   // Register some test events.
   Telemetry.registerEvents("telemetry.test.dynamic", {
     // Event with only required fields.
     "test1": {
       methods: ["test1"],
@@ -327,34 +327,31 @@ add_task(async function test_dynamicEven
       record_on_release: true,
     },
   });
 
   // Record some valid events.
   Telemetry.recordEvent("telemetry.test.dynamic", "test1", "object1");
   Telemetry.recordEvent("telemetry.test.dynamic", "test2", "object1", null,
                         {"key1": "foo", "key2": "bar"});
-  Telemetry.recordEvent("telemetry.test.dynamic", "test2b", "object1", null,
-                        {"key1": "foo", "key2": "bar"});
   Telemetry.recordEvent("telemetry.test.dynamic", "test3", "object1", "some value");
   Telemetry.recordEvent("telemetry.test.dynamic", "test4", "object1", null);
 
   // Test recording an unknown event.
   Assert.throws(() => Telemetry.recordEvent("telemetry.test.dynamic", "unknown", "unknown"),
                 /Error: Unknown event: \["telemetry\.test\.dynamic", "unknown", "unknown"\]/,
                 "Should throw when recording an unknown dynamic event.");
 
   // Now check that the snapshot contains the expected data.
   let snapshot = Telemetry.snapshotEvents(OPTIN, false);
   Assert.ok(("dynamic" in snapshot), "Should have dynamic events in the snapshot.");
 
   let expected = [
     ["telemetry.test.dynamic", "test1", "object1"],
     ["telemetry.test.dynamic", "test2", "object1", null, {key1: "foo", key2: "bar"}],
-    ["telemetry.test.dynamic", "test2b", "object1", null, {key1: "foo", key2: "bar"}],
     // "test3" is epxired, so it should not be recorded.
     ["telemetry.test.dynamic", "test4", "object1"],
   ];
   let events = snapshot.dynamic;
   Assert.equal(events.length, expected.length, "Should have recorded the right amount of events.");
   for (let i = 0; i < expected.length; ++i) {
     Assert.deepEqual(events[i].slice(1), expected[i],
                      "Should have recorded the expected event data.");