<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Resource Timing] Clarify relationship between CachedResourceLoader and ResourceTimingInformation"
   href="https://bugs.webkit.org/show_bug.cgi?id=168706">168706</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Resource Timing] Clarify relationship between CachedResourceLoader and ResourceTimingInformation
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebCore Misc.
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>joepeck&#64;webkit.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>joepeck&#64;webkit.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>[Resource Timing] Clarify relationship between CachedResourceLoader and ResourceTimingInformation

The existing code doesn't make sense.

CachedResources are put into the map but never taken out. This would be fine if CachedResources lifetime lasted as long as the page, but they can go away and their addresses can get reused. This means that having a table entry with a previous CachedResource address will prevent future CachedResources allocated at the same address from being reported. There doesn't appear to be a security issue since the address is all that is used as the key, the pointer itself is not used for anything. Another drawback of this is that the table will incur slight growth as more resources are requested even though the entry is no longer relevant.

The real question that needs to be answered here is what is the purpose of ResourceTimingInformation, and what is its relationship to CachedResourceLoader?

It seems to me as if the purpose right now is to:

  (1) Prevent duplicate PerformanceResourceTiming entries for the same CachedResource
  (2) Ensure we use the initiatorName for the first initiator that requested the resource

It would seem that we should be adding/removing entries as long as the CachedResourceLoader owns the CachedResource (see setOwningCachedResourceLoader). Because while owning the Resource is the extent of the time that the resource is known to the CachedResourceLoader. I don't yet know enough about CachedResource to know if this makes sense across multiple frames (same origin and cross origin).</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>