Changeset 139513 in webkit
- Timestamp:
- Jan 11, 2013, 3:54:56 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r139512 r139513 1 2013-01-11 James Simonsen <simonjam@chromium.org> 2 3 [Resource Timing] XMLHttpRequests should have initiator type 'xmlhttprequest' 4 https://bugs.webkit.org/show_bug.cgi?id=106409 5 6 Reviewed by Nate Chapin. 7 8 * http/tests/w3c/webperf/resources/all_resource_types.htm: 9 * http/tests/w3c/webperf/submission/resource-timing/html/test_resource_initiator_types-expected.txt: 10 * http/tests/w3c/webperf/submission/resource-timing/html/test_resource_initiator_types.html: 11 1 12 2013-01-11 Stephen Chenney <schenney@chromium.org> 2 13 -
trunk/LayoutTests/http/tests/w3c/webperf/resources/all_resource_types.htm
r135450 r139513 15 15 <script src="empty_script.js"></script> 16 16 <script> 17 var xhr = new XMLHttpRequest; 18 xhr.open("GET", "blank_page_yellow.htm", false); 19 xhr.send(); 17 var async_xhr = new XMLHttpRequest; 18 async_xhr.open("GET", "generate_resource.php?type=image&id=async_xhr", true); 19 async_xhr.onreadystatechange = function() { 20 if (async_xhr.readyState == 4 && async_xhr.status == 200 && parent.hasOwnProperty('on_async_xhr_done')) 21 parent.on_async_xhr_done(); 22 } 23 async_xhr.send(); 20 24 </script> 21 25 <style> -
trunk/LayoutTests/http/tests/w3c/webperf/submission/resource-timing/html/test_resource_initiator_types-expected.txt
r135450 r139513 8 8 PASS /w3c/webperf/resources/blank_image.png is expected to have initiatorType img 9 9 PASS /w3c/webperf/resources/blank_page_green.htm is expected to have initiatorType iframe 10 PASS /w3c/webperf/resources/blank_page_yellow.htm is expected to have initiatorType xmlhttprequest11 10 PASS /w3c/webperf/resources/empty_script.js is expected to have initiatorType script 12 11 PASS /w3c/webperf/resources/generate_resource.php?type=css&id=embed is expected to have initiatorType embed … … 15 14 PASS /w3c/webperf/resources/generate_resource.php?type=image&id=1 is expected to have initiatorType css 16 15 PASS /w3c/webperf/resources/generate_resource.php?type=image&id=2 is expected to have initiatorType css 16 PASS /w3c/webperf/resources/generate_resource.php?type=image&id=async_xhr is expected to have initiatorType xmlhttprequest 17 17 PASS /w3c/webperf/resources/generate_resource.php?type=image&id=body is expected to have initiatorType body 18 18 PASS /w3c/webperf/resources/generate_resource.php?type=image&id=input is expected to have initiatorType input … … 20 20 PASS /w3c/webperf/resources/generate_resource.php?type=image&id=object is expected to have initiatorType object 21 21 PASS /w3c/webperf/resources/generate_resource.php?type=image&id=poster is expected to have initiatorType video 22 PASS /w3c/webperf/resources/generate_resource.php?type=image&id=sync_xhr is expected to have initiatorType xmlhttprequest 22 23 PASS /w3c/webperf/resources/nested.css is expected to have initiatorType link 23 24 -
trunk/LayoutTests/http/tests/w3c/webperf/submission/resource-timing/html/test_resource_initiator_types.html
r135450 r139513 16 16 var ol_font_loaded = false; 17 17 var ul_font_loaded = false; 18 var xhr_loaded = false; 18 19 19 20 function check_finished() { … … 24 25 ol_font_loaded = check_font_loaded('ol'); 25 26 } 26 if (page_loaded && ol_font_loaded && ul_font_loaded && background_loaded ) {27 if (page_loaded && ol_font_loaded && ul_font_loaded && background_loaded && xhr_loaded) { 27 28 perform_test(); 28 29 } … … 64 65 65 66 var expected_entries = { 66 '/w3c/webperf/resources/generate_resource.php?type=image&id=body': 'body', 67 '/w3c/webperf/resources/nested.css': 'link', 67 '/w3c/webperf/resources/Ahem.ttf': 'css', 68 68 '/w3c/webperf/resources/blank_image.png': 'img', 69 69 '/w3c/webperf/resources/blank_page_green.htm': 'iframe', 70 70 '/w3c/webperf/resources/empty_script.js': 'script', 71 '/w3c/webperf/resources/blank_page_yellow.htm': 'xmlhttprequest', 71 '/w3c/webperf/resources/generate_resource.php?type=css&id=embed': 'embed', 72 '/w3c/webperf/resources/generate_resource.php?type=css&id=n1': 'css', 73 '/w3c/webperf/resources/generate_resource.php?type=font&id=n1': 'css', 72 74 '/w3c/webperf/resources/generate_resource.php?type=image&id=1': 'css', 73 75 '/w3c/webperf/resources/generate_resource.php?type=image&id=2': 'css', 74 '/w3c/webperf/resources/ Ahem.ttf': 'css',75 '/w3c/webperf/resources/generate_resource.php?type= css&id=n1': 'css',76 '/w3c/webperf/resources/generate_resource.php?type= font&id=n1': 'css',76 '/w3c/webperf/resources/generate_resource.php?type=image&id=async_xhr': 'xmlhttprequest', 77 '/w3c/webperf/resources/generate_resource.php?type=image&id=body': 'body', 78 '/w3c/webperf/resources/generate_resource.php?type=image&id=input': 'input', 77 79 '/w3c/webperf/resources/generate_resource.php?type=image&id=n1': 'css', 78 '/w3c/webperf/resources/generate_resource.php?type=css&id=embed': 'embed',79 '/w3c/webperf/resources/generate_resource.php?type=image&id=input': 'input',80 80 '/w3c/webperf/resources/generate_resource.php?type=image&id=object': 'object', 81 81 '/w3c/webperf/resources/generate_resource.php?type=image&id=poster': 'video', 82 '/w3c/webperf/resources/nested.css': 'link', 82 83 }; 83 84 … … 87 88 88 89 window.on_test_body_created = check_finished; 90 window.on_async_xhr_done = function() { 91 xhr_loaded = true; 92 check_finished(); 93 } 89 94 </script> 90 95 </head> -
trunk/Source/WebCore/ChangeLog
r139509 r139513 1 2013-01-11 James Simonsen <simonjam@chromium.org> 2 3 [Resource Timing] XMLHttpRequests should have initiator type 'xmlhttprequest' 4 https://bugs.webkit.org/show_bug.cgi?id=106409 5 6 Reviewed by Nate Chapin. 7 8 The initiator is passed through ThreadableLoaderOptions to the CachedResourceRequest. This is 9 optional, so other users of ThreadableLoader will have the default initiator of 'request'. Note 10 that synchronous XHRs don't show up in the Resource Timing buffer yet. 11 12 Test: http/tests/w3c/webperf/submission/resource-timing/html/test_resource_initiator_types.html 13 14 * loader/DocumentThreadableLoader.cpp: 15 (WebCore::DocumentThreadableLoader::loadRequest): 16 * loader/ThreadableLoader.h: 17 (ThreadableLoaderOptions): 18 * loader/cache/CachedResourceRequestInitiators.cpp: 19 (WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators): 20 * loader/cache/CachedResourceRequestInitiators.h: 21 (CachedResourceRequestInitiators): 22 * xml/XMLHttpRequest.cpp: 23 (WebCore::XMLHttpRequest::createRequest): 24 1 25 2013-01-11 James Simonsen <simonjam@chromium.org> 2 26 -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r138285 r139513 376 376 377 377 CachedResourceRequest newRequest(request, options); 378 #if ENABLE(RESOURCE_TIMING) 379 newRequest.setInitiator(m_options.initiator); 380 #endif 378 381 #if ENABLE(INSPECTOR) 379 382 if (m_actualRequest) { -
trunk/Source/WebCore/loader/ThreadableLoader.h
r95901 r139513 65 65 CrossOriginRequestPolicy crossOriginRequestPolicy; 66 66 RefPtr<SecurityOrigin> securityOrigin; 67 #if ENABLE(RESOURCE_TIMING) 68 AtomicString initiator; 69 #endif 67 70 }; 68 71 -
trunk/Source/WebCore/loader/cache/CachedResourceRequestInitiators.cpp
r134930 r139513 32 32 : css("css", AtomicString::ConstructFromLiteral) 33 33 , icon("icon", AtomicString::ConstructFromLiteral) 34 , xmlhttprequest("xmlhttprequest", AtomicString::ConstructFromLiteral) 34 35 { 35 36 } -
trunk/Source/WebCore/loader/cache/CachedResourceRequestInitiators.h
r134930 r139513 35 35 const AtomicString css; 36 36 const AtomicString icon; 37 const AtomicString xmlhttprequest; 37 38 WTF_MAKE_NONCOPYABLE(CachedResourceRequestInitiators); WTF_MAKE_FAST_ALLOCATED; 38 39 private: -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r138817 r139513 65 65 #include <wtf/text/CString.h> 66 66 67 #if ENABLE(RESOURCE_TIMING) 68 #include "CachedResourceRequestInitiators.h" 69 #endif 70 67 71 #if USE(JSC) 68 72 #include "JSDOMBinding.h" … … 787 791 options.crossOriginRequestPolicy = UseAccessControl; 788 792 options.securityOrigin = securityOrigin(); 793 #if ENABLE(RESOURCE_TIMING) 794 options.initiator = cachedResourceRequestInitiators().xmlhttprequest; 795 #endif 789 796 790 797 #if ENABLE(XHR_TIMEOUT)
Note:
See TracChangeset
for help on using the changeset viewer.