Closed Bug 725699 Opened 11 years ago Closed 11 years ago

clean up telemetry hashtable reflection


(Toolkit :: Telemetry, defect)

Not set





(Reporter: froydnj, Assigned: froydnj)




(1 file, 2 obsolete files)

We have a very common:

construct a JSObject O
iterate over hashtable to define properties on O
check for failure
return O

pattern in Telemetry.  And it's only going to get more common with bug 715927 and related bugs.  Let's split this out into common code.
Attached patch patch (obsolete) — Splinter Review
This is a much-cut-down version of the patch in bug 715927: no addon histograms, no persistent telemetry bits.  IMHO, it's much easier to do this here and then make those patches use it.
Attachment #595787 - Flags: review?(taras.mozilla)
Summary: clean up telemetry hashtable initialization → clean up telemetry hashtable reflection
Attached patch patch (obsolete) — Splinter Review
Second iteration, with AutoHashtable as discussed on IRC.
Attachment #595787 - Attachment is obsolete: true
Attachment #595787 - Flags: review?(taras.mozilla)
Attachment #595837 - Flags: review?(taras.mozilla)
Comment on attachment 595837 [details] [diff] [review]

+  // This gets marked immutable in debug builds, so we can't use
+  // AutoHashtable here.
   nsTHashtable<nsCStringHashKey> mTrackedDBs;

Seems like we shouldn't be using a nsTHashtable for that either. Could probably just keep a list of hashes precompiled at compile-time with some template magic. Where is a perfect-hash lib when you need one :(
Attachment #595837 - Flags: review?(taras.mozilla) → review+
Keywords: checkin-needed
Whiteboard: [autoland-try]
Whiteboard: [autoland-try] → [autoland-in-queue]
Autoland Patchset:
	Patches: 595837
	Branch: mozilla-central => try
Error applying patch 595837 to mozilla-central.
patching file toolkit/components/telemetry/Telemetry.cpp
Hunk #3 FAILED at 396
1 out of 5 hunks FAILED -- saving rejects to file toolkit/components/telemetry/Telemetry.cpp.rej
abort: patch failed to apply

Could not apply and push patchset:
Whiteboard: [autoland-in-queue]
Attached patch patchSplinter Review
Rebasing to something that applies cleanly to m-c.
Attachment #595837 - Attachment is obsolete: true
Attachment #596165 - Flags: review+
Whiteboard: [autoland-try]
Whiteboard: [autoland-try] → [autoland-in-queue]
Autoland Patchset:
	Patches: 596165
	Branch: mozilla-central => try
Try run started, revision b5be9d37da7e. To cancel or monitor the job, see:
Try run for b5be9d37da7e is complete.
Detailed breakdown of the results available here:
Results (out of 209 total builds):
    exception: 4
    success: 171
    warnings: 20
    failure: 14
Builds (or logs if builds failed) available at:
Whiteboard: [autoland-in-queue]
Target Milestone: --- → mozilla13
Closed: 11 years ago
Resolution: --- → FIXED
Depends on: 727081
Version: unspecified → Trunk
You need to log in before you can comment on or make changes to this bug.