<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>30028</bug_id>
          
          <creation_ts>2009-10-02 15:04:37 -0700</creation_ts>
          <short_desc>Web Inspector: Multiple calls to SetFrontendProxyObject can leave an InspectorTimelineAgent with a bad InspectorFrontend</short_desc>
          <delta_ts>2009-10-06 13:23:41 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector (Deprecated)</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Kelly Norton">knorton</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>eric</cc>
    
    <cc>pfeldman</cc>
    
    <cc>timothy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>151979</commentid>
    <comment_count>0</comment_count>
    <who name="Kelly Norton">knorton</who>
    <bug_when>2009-10-02 15:04:37 -0700</bug_when>
    <thetext>Just a minor fix to the InspectorTimeline stuff that I added a few weeks back.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>151984</commentid>
    <comment_count>1</comment_count>
      <attachid>40549</attachid>
    <who name="Kelly Norton">knorton</who>
    <bug_when>2009-10-02 15:11:01 -0700</bug_when>
    <thetext>Created attachment 40549
Path to fix this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152083</commentid>
    <comment_count>2</comment_count>
      <attachid>40549</attachid>
    <who name="Pavel Feldman">pfeldman</who>
    <bug_when>2009-10-03 10:28:41 -0700</bug_when>
    <thetext>Comment on attachment 40549
Path to fix this issue.

&gt; -    if (timelineEnabled.type() == Setting::BooleanType &amp;&amp; timelineEnabled.booleanValue())
&gt; +    if (m_timelineAgent.get() || (timelineEnabled.type() == Setting::BooleanType &amp;&amp; timelineEnabled.booleanValue()))

Given that you initialize m_timelineAgent in the setFrontendProxyObject, it will only collect the data while inspector is
opened (has been opened for the page at least once in case of WebKit). Is it so by design?

I am asking because Inspector uses a bit different models for existing types of inspected objects:
1) It tracks resources iff tracking is enabled, regardless of the frontend state. It then dumps all the data collected
into the frontend upon its availability. When user enables this tracking for the first time, page reload takes place in
order to gather the data.
2) There are explicit &quot;start/stop profiling&quot; buttons that start/stop collecting data and dump results into the profiler page.
We are currently extending profiling tab so that it could gather different types of profiles.

I think you should choose one of the models above to look consistent within WebKit. If you think some users can have
timeline agent turned on constantly (it produces minimal overhead, there are times when user would like to see what
has been happening without reloading the page), you should go (1). Otherwise, if you consider your agent to be of a
profiling nature, you should choose (2). (2) implies that timeline agent results are presented as a profile result on the
profiles page.

We can chat about it and discuss the ways you will push the gathered information further into your framework. I&apos;ll
be happy to help you out with the WebKit frontend piece as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152368</commentid>
    <comment_count>3</comment_count>
    <who name="Kelly Norton">knorton</who>
    <bug_when>2009-10-05 11:03:29 -0700</bug_when>
    <thetext>Thanks Pavel,

Upon re-reading this, I think maybe we should just talk and figure this out.

I do think the TimelineAgent is of a profiling nature in that it should not be enabled all the time. However, I&apos;d like to find some way to keep it turned on across refreshes. In fact, I&apos;ve been trying to find a way inside of chromium to keep it turned on across page transitions. We&apos;re trying to use this thing in Chromium to keep up the illusion of &quot;profiling a tab&quot; not just a page.

So I think the best thing would be for us to chat about the best way to proceed. Also, this fix is actually a crasher if you turn on the TimelineAgent in Chrome. Is there any interest in landing this and having me start a new bug to better organize InspectorTimelineAgent?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152402</commentid>
    <comment_count>4</comment_count>
    <who name="Pavel Feldman">pfeldman</who>
    <bug_when>2009-10-05 11:53:30 -0700</bug_when>
    <thetext>(In reply to comment #3)

I have no problems submitting it given that it fixes a crash. However, please note that WebKit bugs should be submitted in WebKit terms and scenarios unless they are about bindings / engine specifics. So please avoid using the Chromium-based scenarios in your bug reports / patches!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152404</commentid>
    <comment_count>5</comment_count>
    <who name="Kelly Norton">knorton</who>
    <bug_when>2009-10-05 12:01:38 -0700</bug_when>
    <thetext>Sounds good. And you&apos;re right the crashing scenario is actually any case where setFrontendProxyObject is called twice, so this is a general WebKit issue. I&apos;ll file another bug for re-organizing this TimelineAgent. Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152827</commentid>
    <comment_count>6</comment_count>
      <attachid>40549</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-10-06 12:57:09 -0700</bug_when>
    <thetext>Comment on attachment 40549
Path to fix this issue.

Clearing flags on attachment: 40549

Committed r49204: &lt;http://trac.webkit.org/changeset/49204&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152828</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-10-06 12:57:13 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152830</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-10-06 13:01:58 -0700</bug_when>
    <thetext>You should not have needed a get() in this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152841</commentid>
    <comment_count>9</comment_count>
    <who name="Kelly Norton">knorton</who>
    <bug_when>2009-10-06 13:22:44 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; You should not have needed a get() in this patch.

I&apos;ll remove that in a subsequent patch unless you would prefer that I go ahead and fix it now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>152843</commentid>
    <comment_count>10</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-10-06 13:23:41 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; I&apos;ll remove that in a subsequent patch unless you would prefer that I go ahead
&gt; and fix it now.

OK, sounds fine.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>40549</attachid>
            <date>2009-10-02 15:11:01 -0700</date>
            <delta_ts>2009-10-06 12:57:09 -0700</delta_ts>
            <desc>Path to fix this issue.</desc>
            <filename>30028.diff</filename>
            <type>text/plain</type>
            <size>1421</size>
            <attacher name="Kelly Norton">knorton</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
MGFlODgyMy4uNWRhZTRkOSAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxNCBAQAorMjAwOS0xMC0wMiAgS2VsbHkgTm9ydG9u
ICA8a25vcnRvbkBnb29nbGUuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09Q
UyEpLgorCisgICAgICAgIEZpeGVzIDxodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5j
Z2k/aWQ9MzAwMjg+CisgICAgICAgIE11bHRpcGxlIGNhbGxzIHRvIFNldEZyb250ZW5kUHJveHlP
YmplY3QgY2FuIGxlYXZlIGFuIEluc3BlY3RvclRpbWVsaW5lQWdlbnQgd2l0aCBhbiBpbnZhbGlk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