<?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>43531</bug_id>
          
          <creation_ts>2010-08-04 19:08:55 -0700</creation_ts>
          <short_desc>Web Inspector: Support appcache status change for Chrome</short_desc>
          <delta_ts>2010-08-10 15:12:49 -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>All</rep_platform>
          <op_sys>All</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="Kavita Kanetkar">kkanetkar</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>bweinstein</cc>
    
    <cc>commit-queue</cc>
    
    <cc>eric</cc>
    
    <cc>joepeck</cc>
    
    <cc>keishi</cc>
    
    <cc>michaeln</cc>
    
    <cc>pfeldman</cc>
    
    <cc>pmuellr</cc>
    
    <cc>rik</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit.review.bot</cc>
    
    <cc>yurys</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>260329</commentid>
    <comment_count>0</comment_count>
    <who name="Kavita Kanetkar">kkanetkar</who>
    <bug_when>2010-08-04 19:08:55 -0700</bug_when>
    <thetext>Currently it&apos;s always UNCACHED.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260904</commentid>
    <comment_count>1</comment_count>
      <attachid>63647</attachid>
    <who name="Kavita Kanetkar">kkanetkar</who>
    <bug_when>2010-08-05 15:33:27 -0700</bug_when>
    <thetext>Created attachment 63647
proposed fix

Here, the appcache status update piggybacks off ApplicationCacheHost::notifyDOMApplicationCache()
and pushes the status to inspector frontend via an *expensive* call status().

So is the check for:
page-&gt;inspectorController()-&gt;inspectorFrontend()

sufficient to guarantee that inspector is launched and only for that page? 
I did look through the code and looks like disconnectFrontend() is called if there&apos;s no frontend open.
Again, if frontend is connected for other pages,
page-&gt;inspectorController()-&gt;inspectorFrontend() 
will still be NULL if this particular appcache host&apos;s page does not have inspector open. Am I correct?

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261394</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Nordman">michaeln</who>
    <bug_when>2010-08-06 12:47:27 -0700</bug_when>
    <thetext>Assuming page-&gt;inspectorController()-&gt;inspectorFrontend() is NULL when the inspector is not open... this LGTM</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261484</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-08-06 14:40:46 -0700</bug_when>
    <thetext>Why is this needed?  Why is this only needed for Chrome?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261489</commentid>
    <comment_count>4</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2010-08-06 14:46:22 -0700</bug_when>
    <thetext>The InspectorApplicationCache agent has the same lifetime as the InspectorFrontend.
It is considered an &quot;Inspector Frontend Lifetime Agent&quot;. It only exists while there is
a frontend. For reference you can see this in InspectorController:

  - in InspectorController::connectFrontend, an InspectorFrontend is created and
     soon after an InspectorApplicationCache agent is created and passed that frontend.

  - in InspectorController::releaseFrontendLifetimeAgents it is cleared. Note this is
     called via disconnectFrontend.

That way, the InspectorApplicationAgent should only exist if there is a frontend, and
the frontend it has (m_frontend) should always exist.

I think you only need to check if the InspectorApplicationAgent exists or not,
for instance &quot;page-&gt;inspectorController()-&gt;applicationCacheAgent()&quot;. You shouldn&apos;t
need to check for the frontend itself. Note, this is the approach that WebKit took:

&gt;    if (Page *page = frame-&gt;page()) {
&gt;        if (InspectorApplicationCacheAgent* applicationCacheAgent = page-&gt;inspectorController()-&gt;applicationCacheAgent()) {
&gt;            ...
&gt;        }
&gt;    }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261495</commentid>
    <comment_count>5</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2010-08-06 14:47:18 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; Why is this needed?  Why is this only needed for Chrome?

Hi Eric. Chrome has its own, port specific implementation of
Application Caches. It shares only the ApplicationCacheHost.h
interface with WebKit&apos;s implementation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261578</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Nordman">michaeln</who>
    <bug_when>2010-08-06 16:49:11 -0700</bug_when>
    <thetext>I think this same technique (siphoning off of the event stream) could also work for webcore&apos;s impl. With some modest refactoring we could probably share the class responsible (not just the technique) for the event dispatching.

See https://bugs.webkit.org/show_bug.cgi?id=41908 for the type of refactoring that may help.

I&apos;m not saying we should do that refactoring in this patch, it would be good to get it functioning with the current code base.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261699</commentid>
    <comment_count>7</comment_count>
      <attachid>63647</attachid>
    <who name="Pavel Feldman">pfeldman</who>
    <bug_when>2010-08-07 03:10:58 -0700</bug_when>
    <thetext>Comment on attachment 63647
proposed fix

WebKit/chromium/src/ApplicationCacheHost.cpp:209
 +          if (page &amp;&amp; page-&gt;inspectorController()-&gt;inspectorFrontend() &amp;&amp; page-&gt;mainFrame() == m_documentLoader-&gt;frame())
You should not make ApplicationCacheHost too much involved into the InspectorController&apos;s business. inspectorFrontend() should not be used as indication of the frontend availability + it will actually go away this week. You should notify inspector controller on any change and let it decide when to trigger the action.


WebKit/chromium/src/ApplicationCacheHost.cpp:210
 +              page-&gt;inspectorController()-&gt;applicationCacheAgent()-&gt;updateApplicationCacheStatus(status());
So you will simply check applicationCacheAgent for being 0, and if not, notify it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262343</commentid>
    <comment_count>8</comment_count>
      <attachid>63935</attachid>
    <who name="Kavita Kanetkar">kkanetkar</who>
    <bug_when>2010-08-09 15:27:39 -0700</bug_when>
    <thetext>Created attachment 63935
patch2

Thanks for the review. I understand that host shouldn&apos;t tell controller when to push things to FE.
But in this case I couldn&apos;t keep pushing ACH&apos;s status() because it was relatively expensive.

Now checking if the agent exists. If so, update the status. Please take a look.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262443</commentid>
    <comment_count>9</comment_count>
      <attachid>63935</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2010-08-09 18:33:57 -0700</bug_when>
    <thetext>Comment on attachment 63935
patch2

&gt; Index: WebKit/chromium/src/ApplicationCacheHost.cpp
&gt; +        if (page &amp;&amp; page-&gt;inspectorController()-&gt;applicationCacheAgent() &amp;&amp; page-&gt;mainFrame() == m_documentLoader-&gt;frame())

Patch looks good to me. Two points I wanted to comment on, which you may
have been aware of.

The &quot;page-&gt;mainFrame()&quot; check makes sense for now. I don&apos;t think we handle
this correctly in WebKit. I think once we support multiple frames / manifests
(see bug 41636) we will probably end up passing the frame into the calls to
applicationCacheAgent.

Another point, it makes sense to ignore the progress event here, because
our UI doesn&apos;t do anything for progress events for now. But in the future
we might show some kind of progress, maybe a progress bar or #/# indicator.
I don&apos;t think there is a bug on that. I will file one now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262448</commentid>
    <comment_count>10</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2010-08-09 18:40:32 -0700</bug_when>
    <thetext>&gt; Another point, it makes sense to ignore the progress event here, because
&gt; our UI doesn&apos;t do anything for progress events for now. But in the future
&gt; we might show some kind of progress, maybe a progress bar or #/# indicator.
&gt; I don&apos;t think there is a bug on that. I will file one now.

Filed bug 43764.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262484</commentid>
    <comment_count>11</comment_count>
      <attachid>63935</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-08-09 21:08:59 -0700</bug_when>
    <thetext>Comment on attachment 63935
patch2

Rejecting patch 63935 from commit-queue.

Failed to run &quot;[&apos;WebKitTools/Scripts/update-webkit&apos;]&quot; exit_code: 2
Updating OpenSource
fatal: Unable to create &apos;/Users/eseidel/Projects/CommitQueue/.git/svn/refs/remotes/trunk/index.lock&apos;: File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
write-tree: command returned error: 128

Died at WebKitTools/Scripts/update-webkit line 129.

Full output: http://queues.webkit.org/results/3756009</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262851</commentid>
    <comment_count>12</comment_count>
      <attachid>63935</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-08-10 14:35:33 -0700</bug_when>
    <thetext>Comment on attachment 63935
patch2

Clearing flags on attachment: 63935

Committed r65094: &lt;http://trac.webkit.org/changeset/65094&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262852</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-08-10 14:35:38 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262880</commentid>
    <comment_count>14</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2010-08-10 15:12:49 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/65094 might have broken SnowLeopard Intel Release (Tests)
The following changes are on the blame list:
http://trac.webkit.org/changeset/65094
http://trac.webkit.org/changeset/65095</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>63647</attachid>
            <date>2010-08-05 15:33:27 -0700</date>
            <delta_ts>2010-08-09 15:27:39 -0700</delta_ts>
            <desc>proposed fix</desc>
            <filename>cached1.txt</filename>
            <type>text/plain</type>
            <size>1724</size>
            <attacher name="Kavita Kanetkar">kkanetkar</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYktpdC9jaHJvbWl1bS9zcmMvQXBwbGljYXRpb25DYWNoZUhvc3QuY3BwCj09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT0KLS0tIFdlYktpdC9jaHJvbWl1bS9zcmMvQXBwbGljYXRpb25DYWNoZUhvc3QuY3BwCShy
ZXZpc2lvbiA2NDc4OSkKKysrIFdlYktpdC9jaHJvbWl1bS9zcmMvQXBwbGljYXRpb25DYWNoZUhv
c3QuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0yMDIsNiArMjAyLDE1IEBACiAKIHZvaWQgQXBwbGlj
YXRpb25DYWNoZUhvc3Q6Om5vdGlmeURPTUFwcGxpY2F0aW9uQ2FjaGUoRXZlbnRJRCBpZCwgaW50
IHRvdGFsLCBpbnQgZG9uZSkKIHsKKyNpZiBFTkFCTEUoSU5TUEVDVE9SKQorICAgIC8vIElmIGhv
c3QncyBmcmFtZSBpcyBtYWluIGZyYW1lIGFuZCBpbnNwZWN0b3IgZnJvbnRlbmQgaXMgY29ubmVj
dGVkLCB1cGRhdGUgYXBwY2FjaGUgc3RhdHVzLgorICAgIGlmIChpZCAhPSBQUk9HUkVTU19FVkVO
VCAmJiBtX2RvY3VtZW50TG9hZGVyLT5mcmFtZSgpKSB7CisgICAgICAgIFBhZ2UqIHBhZ2UgPSBt
X2RvY3VtZW50TG9hZGVyLT5mcmFtZSgpLT5wYWdlKCk7CisgICAgICAgIGlmIChwYWdlICYmIHBh
Z2UtPmluc3BlY3RvckNvbnRyb2xsZXIoKS0+aW5zcGVjdG9yRnJvbnRlbmQoKSAmJiBw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GluZyBhcHBjYWNoZSBzdGF0dXMgZm9yIG5vbi1wcm9ncmVzcyBldmVudHMgdG8g
YmUgcHVzaGVkIHRvIGluc3BlY3RvciBGRS4KKyAgICAgICAgKFdlYkNvcmU6OkFwcGxpY2F0aW9u
Q2FjaGVIb3N0Ojpub3RpZnlET01BcHBsaWNhdGlvbkNhY2hlKToKKwogMjAxMC0wOC0wNCAgS2Vu
bmV0aCBSdXNzZWxsICA8a2JyQGdvb2dsZS5jb20+CiAKICAgICAgICAgUmV2aWV3ZWQgYnkgRGlt
aXRyaSBHbGF6a292Lgo=
</data>
<flag name="review"
          id="52045"
          type_id="1"
          status="-"
          setter="pfeldman"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>63935</attachid>
            <date>2010-08-09 15:27:39 -0700</date>
            <delta_ts>2010-08-10 14:35:33 -0700</delta_ts>
            <desc>patch2</desc>
            <filename>cached3.txt</filename>
            <type>text/plain</type>
            <size>1658</size>
            <attacher name="Kavita Kanetkar">kkanetkar</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYktpdC9jaHJvbWl1bS9zcmMvQXBwbGljYXRpb25DYWNoZUhvc3QuY3BwCj09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT0KLS0tIFdlYktpdC9jaHJvbWl1bS9zcmMvQXBwbGljYXRpb25DYWNoZUhvc3QuY3BwCShy
ZXZpc2lvbiA2NTAwNSkKKysrIFdlYktpdC9jaHJvbWl1bS9zcmMvQXBwbGljYXRpb25DYWNoZUhv
c3QuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0yMDIsNiArMjAyLDE1IEBACiAKIHZvaWQgQXBwbGlj
YXRpb25DYWNoZUhvc3Q6Om5vdGlmeURPTUFwcGxpY2F0aW9uQ2FjaGUoRXZlbnRJRCBpZCwgaW50
IHRvdGFsLCBpbnQgZG9uZSkKIHsKKyNpZiBFTkFCTE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ocm9taXVtL0NoYW5nZUxv
Zwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBACisyMDEwLTA4LTA5ICBLYXZpdGEgS2Fu
ZXRrYXIgIDxra2FuZXRrYXJAY2hyb21pdW0ub3JnPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5P
Qk9EWSAoT09QUyEpLgorCisgICAgICAgIFdlYiBJbnNwZWN0b3I6IFN1cHBvcnQgYXBwY2FjaGUg
c3RhdHVzIGNoYW5nZSBmb3IgQ2hyb21lCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3Jn
L3Nob3dfYnVnLmNnaT9pZD00MzUzMQorCisgICAgICAgICogc3JjL0FwcGxpY2F0aW9uQ2FjaGVI
b3N0LmNwcDoKKyAgICAgICAgKFdlYkNvcmU6OkFwcGxpY2F0aW9uQ2FjaGVIb3N0Ojpub3RpZnlE
T01BcHBsaWNhdGlvbkNhY2hlKToKKwogMjAxMC0wOC0wOSAgVmFuZ2VsaXMgS29ra2V2aXMgIDx2
YW5nZWxpc0BjaHJvbWl1bS5vcmc+CiAKICAgICAgICAgUmV2aWV3ZWQgYnkgRGltaXRyaSBHbGF6
a292Lgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>