Closed
Bug 1471347
Opened 6 years ago
Closed 6 years ago
stop using std::string/stringstreams in profiler code
Categories
(Core :: Gecko Profiler, enhancement, P1)
Core
Gecko Profiler
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: froydnj, Assigned: froydnj)
Details
Attachments
(2 files)
7.16 KB,
patch
|
n.nethercote
:
review+
|
Details | Diff | Splinter Review |
16.01 KB,
patch
|
n.nethercote
:
review+
|
Details | Diff | Splinter Review |
Using operator<< and friends from the standard library requires locale-specific formatting, which requires registry calls on Windows. We can do better.
Assignee | ||
Comment 1•6 years ago
|
||
Using operator<< on stringstream on Windows dives into the registry for locale-specific formatting details. This behavior is neither desired or (probably) anticipated by the code. Instead, let's use our normal Gecko string classes for SharedLibrary::mVersion.
Attachment #8987943 -
Flags: review?(n.nethercote)
Assignee | ||
Comment 2•6 years ago
|
||
Similar to the previous part, we convert mBreakpadId to an nsCString to avoid issues with locale-dependent std::string operations. There are a lot of non-profiler changes here because a bunch of things depend on the SharedLibrary object that the profiler defines.
Attachment #8987944 -
Flags: review?(n.nethercote)
Updated•6 years ago
|
Attachment #8987943 -
Flags: review?(n.nethercote) → review+
Comment 3•6 years ago
|
||
Comment on attachment 8987944 [details] [diff] [review] part 2 - store an nsCString for SharedLibrary::mBreakpadId Review of attachment 8987944 [details] [diff] [review]: ----------------------------------------------------------------- ::: tools/profiler/core/shared-libraries-linux.cc @@ +70,5 @@ > + > + nsCString uuid; > + const std::string str = FileID::ConvertIdentifierToUUIDString(aIdentifier); > + uuid.Append(str.c_str(), str.size()); > + uuid.Append('0'); '\0'?
Attachment #8987944 -
Flags: review?(n.nethercote) → review+
Comment 4•6 years ago
|
||
'0' is correct: this is the "breakpad id age" which is set to the pdbAge on Windows and to zero on non-Windows.
Assignee | ||
Comment 6•6 years ago
|
||
Yes; I'm going to add a comment to avoid the confusion from comment 3.
Flags: needinfo?(nfroyd)
Pushed by nfroyd@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/6b7ad73f1f43 part 1 - store an nsCString for SharedLibrary::mVersion; r=njn https://hg.mozilla.org/integration/mozilla-inbound/rev/aadd0e8ef250 part 2 - store an nsCString for SharedLibrary::mBreakpadId; r=njn
Comment 8•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6b7ad73f1f43 https://hg.mozilla.org/mozilla-central/rev/aadd0e8ef250
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•