[webkit-reviews] review requested: [Bug 101085] Web Inspector: Fix heap snapshots counted several times by NMI : [Attachment 172107] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 7 05:42:51 PST 2012


Alexei Filippov <alph at chromium.org> has asked  for review:
Bug 101085: Web Inspector: Fix heap snapshots counted several times by NMI
https://bugs.webkit.org/show_bug.cgi?id=101085

Attachment 172107: Patch
https://bugs.webkit.org/attachment.cgi?id=172107&action=review

------- Additional Comments from Alexei Filippov <alph at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=172107&action=review


>>>> Source/WebCore/inspector/InspectorProfilerAgent.cpp:510
>>>> +	  static ScriptProfilerSingletonProxy scriptProfilerSingletonProxy;
>>> 
>>> static variable will not work for workers.
>> 
>> Sorry, could you please elaborate. Why not?
> 
> The profiler agent can belong to a dedicated worker that lives on its own
thread and ScriptProfilerSingletonProxy can be called concurrently.

Yes, but this class is an empty POD that has neither constructor nor
destructor. I think empty functions can be considered thread safe. I don't want
to use DEFINE_STATIC_LOCAL here because in this case its initialization with a
heap object may cause a real race condition leading two objects being
allocated. I can see hundreds of function static data used across WebKit
without DEFINE_STATIC_LOCAL.


More information about the webkit-reviews mailing list