Bug 109811 - Web Inspector: don't create static local string for program literal in InspectorTimelineAgent
Summary: Web Inspector: don't create static local string for program literal in Inspec...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-14 04:24 PST by Yury Semikhatsky
Modified: 2013-02-14 05:21 PST (History)
9 users (show)

See Also:


Attachments
Patch (1.90 KB, patch)
2013-02-14 04:26 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Semikhatsky 2013-02-14 04:24:44 PST
InspectorTimelineAgent::innerAddRecordToTimeline contains the following declaration
 DEFINE_STATIC_LOCAL(String, program, (TimelineRecordType::Program));

Since there may be timeline agent on worker thread there is a risk of leaking the string in case of concurrent initialization. I think it was introduced to avoid creating wrappers each time for TimelineRecordType::Program C-string but there is overloaded operator==(cons String&, const char*) so the performance shouldn't suffer if compare type string with the constant directly.
Comment 1 Yury Semikhatsky 2013-02-14 04:26:10 PST
Created attachment 188317 [details]
Patch
Comment 2 WebKit Review Bot 2013-02-14 05:20:57 PST
Comment on attachment 188317 [details]
Patch

Clearing flags on attachment: 188317

Committed r142873: <http://trac.webkit.org/changeset/142873>
Comment 3 WebKit Review Bot 2013-02-14 05:21:00 PST
All reviewed patches have been landed.  Closing bug.