WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-103927-20130329155920.patch (text/plain), 12.21 KB, created by
James Simonsen
on 2013-03-29 15:59:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
James Simonsen
Created:
2013-03-29 15:59:24 PDT
Size:
12.21 KB
patch
obsolete
>Subversion Revision: 147228 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 4f22f8030eba3cbdb5862defd52e8c72afda35ef..428fc2e0b9486257e0b33e4d238ce5586819d4f1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2013-03-29 James Simonsen <simonjam@chromium.org> >+ >+ [Resource Timing] Expose timing information for iframes >+ https://bugs.webkit.org/show_bug.cgi?id=103927 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The only catch with main documents is that we only want to record the load that was initiated by >+ adding the <iframe> to a document. We don't want any subsequent navigations within the iframe to >+ be reported. >+ >+ Test: http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_iframe_self_navigation.html >+ >+ * loader/cache/CachedResourceLoader.cpp: >+ (WebCore::CachedResourceLoader::revalidateResource): >+ (WebCore::CachedResourceLoader::loadResource): >+ (WebCore::CachedResourceLoader::loadDone): Make sure iframes are reported in the parent. >+ > 2013-03-29 Nate Chapin <japhet@chromium.org> > > ASSERT d->m_defersLoading != defers on detik.com and drive.google.com >diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp >index 4b4699bd67209ff97ad9a69736fd0307d95c1f34..a5c7bfe0cd953bf2a141f3955ff2cda60aae6f82 100644 >--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp >+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp >@@ -44,6 +44,7 @@ > #include "FrameLoader.h" > #include "FrameLoaderClient.h" > #include "HTMLElement.h" >+#include "HTMLFrameOwnerElement.h" > #include "LoaderStrategy.h" > #include "Logging.h" > #include "MemoryCache.h" >@@ -527,7 +528,12 @@ CachedResourceHandle<CachedResource> CachedResourceLoader::revalidateResource(co > memoryCache()->remove(resource); > memoryCache()->add(newResource.get()); > #if ENABLE(RESOURCE_TIMING) >- if (resource->type() != CachedResource::MainResource) { >+ if (resource->type() == CachedResource::MainResource) { >+ if (frame()->ownerElement() && m_documentLoader->frameLoader()->stateMachine()->committingFirstRealLoad()) { >+ InitiatorInfo info = { frame()->ownerElement()->localName(), monotonicallyIncreasingTime() }; >+ m_initiatorMap.add(newResource.get(), info); >+ } >+ } else { > InitiatorInfo info = { request.initiatorName(), monotonicallyIncreasingTime() }; > m_initiatorMap.add(newResource.get(), info); > } >@@ -548,7 +554,12 @@ CachedResourceHandle<CachedResource> CachedResourceLoader::loadResource(CachedRe > if (!memoryCache()->add(resource.get())) > resource->setOwningCachedResourceLoader(this); > #if ENABLE(RESOURCE_TIMING) >- if (type != CachedResource::MainResource) { >+ if (type == CachedResource::MainResource) { >+ if (frame()->ownerElement() && m_documentLoader->frameLoader()->stateMachine()->committingFirstRealLoad()) { >+ InitiatorInfo info = { frame()->ownerElement()->localName(), monotonicallyIncreasingTime() }; >+ m_initiatorMap.add(resource.get(), info); >+ } >+ } else { > InitiatorInfo info = { request.initiatorName(), monotonicallyIncreasingTime() }; > m_initiatorMap.add(resource.get(), info); > } >@@ -740,13 +751,16 @@ void CachedResourceLoader::loadDone(CachedResource* resource) > RefPtr<Document> protectDocument(m_document); > > #if ENABLE(RESOURCE_TIMING) >- // FIXME: Add resource timing support for main resources. >- if (resource && resource->type() != CachedResource::MainResource && resource->response().isHTTP() && ((!resource->errorOccurred() && !resource->wasCanceled()) || resource->response().httpStatusCode() == 304)) { >+ if (resource && resource->response().isHTTP() && ((!resource->errorOccurred() && !resource->wasCanceled()) || resource->response().httpStatusCode() == 304)) { > HashMap<CachedResource*, InitiatorInfo>::iterator initiatorIt = m_initiatorMap.find(resource); > if (initiatorIt != m_initiatorMap.end()) { > ASSERT(document()); >+ Document* initiatorDocument = document(); >+ if (resource->type() == CachedResource::MainResource) >+ initiatorDocument = document()->parentDocument(); >+ ASSERT(initiatorDocument); > const InitiatorInfo& info = initiatorIt->value; >- document()->domWindow()->performance()->addResourceTiming(info.name, document(), resource->resourceRequest(), resource->response(), info.startTime, resource->loadFinishTime()); >+ initiatorDocument->domWindow()->performance()->addResourceTiming(info.name, initiatorDocument, resource->resourceRequest(), resource->response(), info.startTime, resource->loadFinishTime()); > m_initiatorMap.remove(initiatorIt); > } > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 93564a24954f00f6211831d3de42c32ee865b29b..105cadceb946d8a94d09fb1707ce9c6de271c1bf 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2013-03-29 James Simonsen <simonjam@chromium.org> >+ >+ [Resource Timing] Expose timing information for iframes >+ https://bugs.webkit.org/show_bug.cgi?id=103927 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_frame_initiator_type.html: Fix timeout. >+ * http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_iframe_self_navigation.html: Added. >+ * http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_initiator_types-expected.txt: Remove bad line. >+ * platform/chromium/TestExpectations: Unskip tests that relied on iframes. >+ > 2013-03-29 Nate Chapin <japhet@chromium.org> > > ASSERT d->m_defersLoading != defers on detik.com and drive.google.com >diff --git a/LayoutTests/http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_frame_initiator_type.html b/LayoutTests/http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_frame_initiator_type.html >index f1979dbe382b4b2f4313b05ab40861173622ecd1..dd2479f5a7a8a730e14b0a0f09ecf0424585c3f3 100644 >--- a/LayoutTests/http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_frame_initiator_type.html >+++ b/LayoutTests/http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_frame_initiator_type.html >@@ -13,7 +13,7 @@ > setup({explicit_done: true}); > > function onload_test() { >- var context = new PerformanceContext(iframe.contentWindow.performance); >+ var context = new PerformanceContext(document.getElementById("frameContext").contentWindow.performance); > var entries = context.getEntries(); > > var expected_entries = { >diff --git a/LayoutTests/http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_iframe_self_navigation.html b/LayoutTests/http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_iframe_self_navigation.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7102f3bceed8f489689bfd57c64344a3aab19c2d >--- /dev/null >+++ b/LayoutTests/http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_iframe_self_navigation.html >@@ -0,0 +1,48 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8" /> >+<title>Resource Timing self navigating iframes</title> >+<link rel="author" title="Google" href="http://www.google.com/" /> >+<link rel="help" href="http://www.w3.org/TR/resource-timing/#dom-performanceresourcetiming-initiatortype"/> >+<script src="/w3c/resources/testharness.js"></script> >+<script src="/w3c/resources/testharnessreport.js"></script> >+<script src="/w3c/webperf/resources/webperftestharness.js"></script> >+<script src="/w3c/webperf/resources/webperftestharnessextension.js"></script> >+<script> >+setup({explicit_done: true}); >+var d; >+var iframe; >+var iframeBody; >+function setup_iframe() { >+ var iframe_content = '<iframe id="innerFrame" src="/w3c/webperf/resources/inject_resource_test.html"></iframe>'; >+ iframe = document.getElementById('frameContext'); >+ d = iframe.contentWindow.document; >+ d.write(iframe_content); >+ iframe.contentWindow.setup_iframe = setup_inner_iframe; >+} >+function setup_inner_iframe() { >+ var iframe_content = '<script>window.location = "/w3c/webperf/resources/generate_resource.php?type=iframe";</scr' + 'ipt>'; >+ var inner_iframe = d.getElementById('innerFrame'); >+ inner_iframe.contentWindow.document.write(iframe_content); >+ inner_iframe.addEventListener("load", onload_test); >+} >+function onload_test() { >+ var context = new PerformanceContext(iframe.contentWindow.performance); >+ var entries = context.getEntriesByType('resource'); >+ var expected_entries = { >+ '/w3c/webperf/resources/inject_resource_test.html': 'iframe', >+ }; >+ test_resource_entries(entries, expected_entries); >+ done(); >+} >+window.setup_iframe = setup_iframe; >+</script> >+</head> >+<body> >+<h1>Description</h1> >+<p>This test validates that iframes that navigate themselves don't appear in the buffer.</p> >+<div id="log"></div> >+<iframe id="frameContext" src="/w3c/webperf/resources/inject_resource_test.html"></iframe> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_initiator_types-expected.txt b/LayoutTests/http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_initiator_types-expected.txt >index e11bbee2c7f945478585ca2e59ba75656aa9b50b..01c27772a5d582ab3522b904d59f317c03c8118d 100644 >--- a/LayoutTests/http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_initiator_types-expected.txt >+++ b/LayoutTests/http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_initiator_types-expected.txt >@@ -19,6 +19,5 @@ PASS /w3c/webperf/resources/generate_resource.php?type=image&id=input is expecte > PASS /w3c/webperf/resources/generate_resource.php?type=image&id=n1 is expected to have initiatorType css > PASS /w3c/webperf/resources/generate_resource.php?type=image&id=object is expected to have initiatorType object > PASS /w3c/webperf/resources/generate_resource.php?type=image&id=poster is expected to have initiatorType video >-PASS /w3c/webperf/resources/generate_resource.php?type=image&id=sync_xhr is expected to have initiatorType xmlhttprequest > PASS /w3c/webperf/resources/nested.css is expected to have initiatorType link > >diff --git a/LayoutTests/platform/chromium/TestExpectations b/LayoutTests/platform/chromium/TestExpectations >index 55902cd53362286244b14b1cc1aadde9b393f831..b41257691ee36bbbad0efb30fc982e89cd84406c 100644 >--- a/LayoutTests/platform/chromium/TestExpectations >+++ b/LayoutTests/platform/chromium/TestExpectations >@@ -3512,11 +3512,8 @@ webkit.org/b/85522 http/tests/security/sandboxed-iframe-form-top.html [ Skip ] > > webkit.org/b/102724 [ Linux ] svg/carto.net/colourpicker.svg [ ImageOnlyFailure Pass ] > >-webkit.org/b/103927 http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_frame_initiator_type.html [ Failure ] >-webkit.org/b/103927 [ Mac Linux ] http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_dynamic_insertion.html [ Failure ] >-webkit.org/b/103927 [ Win ] http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_dynamic_insertion.html [ Failure Timeout ] >-webkit.org/b/103927 [ Mac Linux ] http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_initiator_types.html [ Failure ] >-webkit.org/b/103927 [ Win ] http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_initiator_types.html [ Failure Timeout ] >+webkit.org/b/103927 [ Win ] http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_dynamic_insertion.html [ Timeout ] >+webkit.org/b/103927 [ Win ] http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_initiator_types.html [ Timeout ] > webkit.org/b/103927 [ Mac Linux ] http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_redirects.html [ Failure ] > webkit.org/b/103927 [ Win ] http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_redirects.html [ Failure Timeout ] > webkit.org/b/103927 http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_resource_request.html [ Failure ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 103927
:
195812
|
195815
|
196037