Closed Bug 725699 Opened 12 years ago Closed 12 years ago

clean up telemetry hashtable reflection

Categories

(Toolkit :: Telemetry, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: froydnj, Assigned: froydnj)

References

Details

Attachments

(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]
patch

+  // 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
	Destination: http://hg.mozilla.org/try/rev/b5be9d37da7e
Try run started, revision b5be9d37da7e. To cancel or monitor the job, see: https://tbpl.mozilla.org/?tree=Try&rev=b5be9d37da7e
Try run for b5be9d37da7e is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=b5be9d37da7e
Results (out of 209 total builds):
    exception: 4
    success: 171
    warnings: 20
    failure: 14
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/autolanduser@mozilla.com-b5be9d37da7e
Whiteboard: [autoland-in-queue]
Target Milestone: --- → mozilla13
https://hg.mozilla.org/mozilla-central/rev/108f5491cf3f
Status: NEW → RESOLVED
Closed: 12 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.

Attachment

General

Created:
Updated:
Size: