Skip to content
Permalink
Browse files
2011-07-05 Vsevolod Vlasov <vsevik@chromium.org>
        Web Inspector: Show content for plugin requests in network panel.
        https://bugs.webkit.org/show_bug.cgi?id=30080

        Added GTK symbols for new window.internals methods.

        Reviewed by Pavel Feldman.

        * Source/autotools/symbols.filter:
2011-07-04  Vsevolod Vlasov  <vsevik@chromium.org>

        Web Inspector: Show content for plugin requests in network panel.
        https://bugs.webkit.org/show_bug.cgi?id=30080

        Added tests for plugin content saving and replacing in NetworkResourcesData.
        Adjusted older tests to use new window.internals method setInspectorResourcesDataSizeLimits
        to ensure NetworkResourcesData is in the correct state before test.

        Reviewed by Pavel Feldman.

        * http/tests/inspector/network/network-content-replacement-embed-expected.txt: Added.
        * http/tests/inspector/network/network-content-replacement-embed.html: Added.
        * http/tests/inspector/network/network-content-replacement-xhr-expected.txt: Added.
        * http/tests/inspector/network/network-content-replacement-xhr.html: Added.
        * http/tests/inspector/network/network-embed-expected.txt: Added.
        * http/tests/inspector/network/network-embed.html: Added.
        * http/tests/inspector/network/network-xhr-async-expected.txt:
        * http/tests/inspector/network/network-xhr-async.html:
        * http/tests/inspector/network/network-xhr-sync-expected.txt:
        * http/tests/inspector/network/network-xhr-sync.html:
        * http/tests/inspector/network/resources/cp1251.xml: Added.
        * http/tests/inspector/network/resources/plugin-data.php: Added.
        * http/tests/inspector/network/resources/resource.php:
        * http/tests/inspector/network/resources/utf8.xml: Added.
        * platform/chromium/test_expectations.txt:
2011-07-05  Vsevolod Vlasov  <vsevik@chromium.org>

        Web Inspector: Show content for plugin requests in network panel.
        https://bugs.webkit.org/show_bug.cgi?id=30080

        Now the data from didReceiveData callback is passed to inspector.
        It is then saved in NetworkResourcesData structure for plugin requests.
        Added window.internals.setInspectorResourcesDataSizeLimits() method
        for testing replacement logic.

        Reviewed by Pavel Feldman.

        Tests: http/tests/inspector/network/network-content-replacement-embed.html
               http/tests/inspector/network/network-content-replacement-xhr.html
               http/tests/inspector/network/network-embed.html

        * WebCore.exp.in:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::setResourcesDataSizeLimitsFromInternals):
        * inspector/InspectorController.h:
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didReceiveDataImpl):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didReceiveData):
        * inspector/InspectorResourceAgent.cpp:
        (WebCore::InspectorResourceAgent::didReceiveResponse):
        (WebCore::InspectorResourceAgent::didReceiveData):
        (WebCore::InspectorResourceAgent::didFinishLoading):
        (WebCore::InspectorResourceAgent::setInitialXHRContent):
        (WebCore::InspectorResourceAgent::setResourcesDataSizeLimitsFromInternals):
        (WebCore::InspectorResourceAgent::getResourceContent):
        * inspector/InspectorResourceAgent.h:
        * inspector/NetworkResourcesData.cpp:
        (WebCore::NetworkResourcesData::ResourceData::ResourceData):
        (WebCore::NetworkResourcesData::ResourceData::setContent):
        (WebCore::NetworkResourcesData::ResourceData::purgeContent):
        (WebCore::NetworkResourcesData::ResourceData::createDecoder):
        (WebCore::NetworkResourcesData::ResourceData::dataLength):
        (WebCore::NetworkResourcesData::ResourceData::appendData):
        (WebCore::NetworkResourcesData::ResourceData::decodeDataToContent):
        (WebCore::NetworkResourcesData::NetworkResourcesData):
        (WebCore::NetworkResourcesData::responseReceived):
        (WebCore::NetworkResourcesData::setResourceContent):
        (WebCore::NetworkResourcesData::maybeAddResourceData):
        (WebCore::NetworkResourcesData::maybeDecodeDataToContent):
        (WebCore::NetworkResourcesData::data):
        (WebCore::NetworkResourcesData::clear):
        (WebCore::NetworkResourcesData::setResourcesDataSizeLimits):
        (WebCore::NetworkResourcesData::ensureNoDataForIdentifier):
        (WebCore::NetworkResourcesData::ensureFreeSpace):
        * inspector/NetworkResourcesData.h:
        (WebCore::NetworkResourcesData::ResourceData::hasContent):
        (WebCore::NetworkResourcesData::ResourceData::content):
        (WebCore::NetworkResourcesData::ResourceData::decoder):
        (WebCore::NetworkResourcesData::ResourceData::buffer):
        (WebCore::NetworkResourcesData::ResourceData::setBuffer):
        (WebCore::NetworkResourcesData::ResourceData::hasData):
        * inspector/front-end/Resource.js:
        (WebInspector.Resource.prototype.get contentEncoded):
        * inspector/front-end/ResourcePreviewView.js:
        (WebInspector.ResourcePreviewView.prototype.contentLoaded):
        (WebInspector.ResourcePreviewView.prototype._createEmptyView):
        (WebInspector.ResourcePreviewView.prototype._createPreviewView):
        * inspector/front-end/ResourceView.js:
        (WebInspector.ResourceView.hasTextContent):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::didReceiveData):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::willLoadMediaElementURL):
        (WebCore::FrameLoader::commitProvisionalLoad):
        (WebCore::FrameLoader::loadResourceSynchronously):
        (WebCore::FrameLoader::loadedResourceFromMemoryCache):
        * loader/ResourceLoadNotifier.cpp:
        (WebCore::ResourceLoadNotifier::didReceiveData):
        (WebCore::ResourceLoadNotifier::dispatchDidReceiveData):
        (WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
        * loader/ResourceLoadNotifier.h:
        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::didReceiveData):
        * testing/Internals.cpp:
        (WebCore::Internals::setInspectorResourcesDataSizeLimits):
        * testing/Internals.h:
        * testing/Internals.idl:
2011-07-05  Vsevolod Vlasov  <vsevik@chromium.org>

        Web Inspector: Show content for plugin requests in network panel.
        https://bugs.webkit.org/show_bug.cgi?id=30080

        Added win symbols for new window.internals methods.

        Reviewed by Pavel Feldman.

        * win/WebKit2.def:
        * win/WebKit2CFLite.def:

Canonical link: https://commits.webkit.org/79655@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Vsevolod Vlasov committed Jul 5, 2011
1 parent a60e7d3 commit 2da9e606fb26b0d619c05d1882a588fc5f7180bc
Showing with 838 additions and 73 deletions.
  1. +11 −0 ChangeLog
  2. +27 −0 LayoutTests/ChangeLog
  3. +13 −0 LayoutTests/http/tests/inspector/network/network-content-replacement-embed-expected.txt
  4. +119 −0 LayoutTests/http/tests/inspector/network/network-content-replacement-embed.html
  5. +12 −0 LayoutTests/http/tests/inspector/network/network-content-replacement-xhr-expected.txt
  6. +97 −0 LayoutTests/http/tests/inspector/network/network-content-replacement-xhr.html
  7. +41 −0 LayoutTests/http/tests/inspector/network/network-embed-expected.txt
  8. +133 −0 LayoutTests/http/tests/inspector/network/network-embed.html
  9. +1 −1 LayoutTests/http/tests/inspector/network/network-xhr-async-expected.txt
  10. +8 −0 LayoutTests/http/tests/inspector/network/network-xhr-async.html
  11. +1 −1 LayoutTests/http/tests/inspector/network/network-xhr-sync-expected.txt
  12. +8 −0 LayoutTests/http/tests/inspector/network/network-xhr-sync.html
  13. +4 −0 LayoutTests/http/tests/inspector/network/resources/cp1251.xml
  14. +15 −0 LayoutTests/http/tests/inspector/network/resources/plugin-data.php
  15. +1 −1 LayoutTests/http/tests/inspector/network/resources/resource.php
  16. +4 −0 LayoutTests/http/tests/inspector/network/resources/utf8.xml
  17. +4 −0 LayoutTests/platform/chromium/test_expectations.txt
  18. +84 −0 Source/WebCore/ChangeLog
  19. +2 −0 Source/WebCore/WebCore.exp.in
  20. +5 −0 Source/WebCore/inspector/InspectorController.cpp
  21. +2 −0 Source/WebCore/inspector/InspectorController.h
  22. +2 −2 Source/WebCore/inspector/InspectorInstrumentation.cpp
  23. +4 −4 Source/WebCore/inspector/InspectorInstrumentation.h
  24. +17 −6 Source/WebCore/inspector/InspectorResourceAgent.cpp
  25. +4 −1 Source/WebCore/inspector/InspectorResourceAgent.h
  26. +118 −24 Source/WebCore/inspector/NetworkResourcesData.cpp
  27. +31 −15 Source/WebCore/inspector/NetworkResourcesData.h
  28. +5 −0 Source/WebCore/inspector/front-end/Resource.js
  29. +13 −5 Source/WebCore/inspector/front-end/ResourcePreviewView.js
  30. +2 −0 Source/WebCore/inspector/front-end/ResourceView.js
  31. +1 −1 Source/WebCore/loader/DocumentThreadableLoader.cpp
  32. +4 −4 Source/WebCore/loader/FrameLoader.cpp
  33. +5 −5 Source/WebCore/loader/ResourceLoadNotifier.cpp
  34. +2 −2 Source/WebCore/loader/ResourceLoadNotifier.h
  35. +1 −1 Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
  36. +13 −0 Source/WebCore/testing/Internals.cpp
  37. +4 −0 Source/WebCore/testing/Internals.h
  38. +2 −0 Source/WebCore/testing/Internals.idl
  39. +12 −0 Source/WebKit2/ChangeLog
  40. +2 −0 Source/WebKit2/win/WebKit2.def
  41. +2 −0 Source/WebKit2/win/WebKit2CFLite.def
  42. +2 −0 Source/autotools/symbols.filter
@@ -1,3 +1,14 @@
2011-07-05 Vsevolod Vlasov <vsevik@chromium.org>

Web Inspector: Show content for plugin requests in network panel.
https://bugs.webkit.org/show_bug.cgi?id=30080

Added GTK symbols for new window.internals methods.

Reviewed by Pavel Feldman.

* Source/autotools/symbols.filter:

2011-07-04 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r90373.
@@ -1,3 +1,30 @@
2011-07-04 Vsevolod Vlasov <vsevik@chromium.org>

Web Inspector: Show content for plugin requests in network panel.
https://bugs.webkit.org/show_bug.cgi?id=30080

Added tests for plugin content saving and replacing in NetworkResourcesData.
Adjusted older tests to use new window.internals method setInspectorResourcesDataSizeLimits
to ensure NetworkResourcesData is in the correct state before test.

Reviewed by Pavel Feldman.

* http/tests/inspector/network/network-content-replacement-embed-expected.txt: Added.
* http/tests/inspector/network/network-content-replacement-embed.html: Added.
* http/tests/inspector/network/network-content-replacement-xhr-expected.txt: Added.
* http/tests/inspector/network/network-content-replacement-xhr.html: Added.
* http/tests/inspector/network/network-embed-expected.txt: Added.
* http/tests/inspector/network/network-embed.html: Added.
* http/tests/inspector/network/network-xhr-async-expected.txt:
* http/tests/inspector/network/network-xhr-async.html:
* http/tests/inspector/network/network-xhr-sync-expected.txt:
* http/tests/inspector/network/network-xhr-sync.html:
* http/tests/inspector/network/resources/cp1251.xml: Added.
* http/tests/inspector/network/resources/plugin-data.php: Added.
* http/tests/inspector/network/resources/resource.php:
* http/tests/inspector/network/resources/utf8.xml: Added.
* platform/chromium/test_expectations.txt:

2011-07-04 Kinuko Yasuda <kinuko@chromium.org>

[Chromium] LayoutTests/fast/filesystem/workers/simple-persistent-sync.html is failing on chromium worker tests
@@ -0,0 +1,13 @@
CONSOLE MESSAGE: line 60: Done.
Tests NetworkResourcesData logic for embed content replacement.


http://127.0.0.1:8000/inspector/network/resources/resource.php?size=200
resource.content after requesting content: null
http://127.0.0.1:8000/inspector/network/resources/resource.php?size=100
resource.content after requesting content: ****************************************************************************************************
http://127.0.0.1:8000/inspector/network/resources/resource.php?size=201
resource.content after requesting content: null
http://127.0.0.1:8000/inspector/network/resources/resource.php?size=100
resource.content after requesting content: ****************************************************************************************************

@@ -0,0 +1,119 @@
<html>
<head>
<script src="../inspector-test.js"></script>
<script>

var loadedFirstURL = false;
function streamLoaded()
{
if (loadedFirstURL)
return;

loadedFirstURL = true;
loadURLs();
}

var snifferInstalled = false;
function onSnifferInstalled()
{
snifferInstalled = true;
loadURLs();
}

function loadURLs()
{
if (!snifferInstalled || !loadedFirstURL)
return;

if (!window.internals) {
console.log("This test can not be run as window.internals is not available.");
return;
}
// Each '*' symbol in original data will use two bytes in String object
// after decoding, hence multiplying by two.
internals.setInspectorResourcesDataSizeLimits(document, 2*300, 2*200);

// Here we test replacement logic. We save first two resources content,
// discard third resource content once we see its size exceeds limit,
// and finally replace first resource content with the last resource content.

plg.getURLNotify("resources/resource.php?size=200", null, "loadURL2");
}

function loadURL2()
{
plg.getURLNotify("resources/resource.php?size=100", null, "loadURL3");
}

function loadURL3()
{
plg.getURLNotify("resources/resource.php?size=201", null, "loadURL4");
}

function loadURL4()
{
plg.getURLNotify("resources/resource.php?size=100", null, "allURLsLoaded");
}

function allURLsLoaded()
{
console.log("Done.");
}

function test()
{
InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step1);
InspectorTest.evaluateInPage("onSnifferInstalled()");

function dumpResource(resource, callback)
{
if (!resource)
return callback();
InspectorTest.addResult(resource.url);

function contentLoaded()
{
InspectorTest.addResult("resource.content after requesting content: " + resource.content);
callback();
}

resource.requestContent(contentLoaded);
}

function step1()
{
var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 4];
dumpResource(resource, step2);
}

function step2()
{
var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 3];
dumpResource(resource, step3);
}

function step3()
{
var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 2];
dumpResource(resource, step4);
}

function step4()
{
var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
dumpResource(resource, step5);
}

function step5()
{
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p>Tests NetworkResourcesData logic for embed content replacement.</p>
<embed name="plg" type="application/x-webkit-test-netscape" src="resources/resource.php?type=image" onstreamload="streamLoaded()"></embed>
</body>
</html>

@@ -0,0 +1,12 @@
CONSOLE MESSAGE: line 39: Done.
Tests NetworkResourcesData logic for XHR content replacement.

http://127.0.0.1:8000/inspector/network/resources/resource.php?size=200
resource.content: null
http://127.0.0.1:8000/inspector/network/resources/resource.php?size=100
resource.content: ****************************************************************************************************
http://127.0.0.1:8000/inspector/network/resources/resource.php?size=201
resource.content: null
http://127.0.0.1:8000/inspector/network/resources/resource.php?size=100
resource.content: ****************************************************************************************************

@@ -0,0 +1,97 @@
<html>
<head>
<script src="../inspector-test.js"></script>
<script src="../network-test.js"></script>
<script>
function loadData()
{
if (!window.internals) {
console.log("This test can not be run as window.internals is not available.");
return;
}
// Each '*' symbol will use two bytes in String object, hence multiplying by two.
internals.setInspectorResourcesDataSizeLimits(document, 2*300, 2*200);

// Here we test replacement logic. We save first two resources content,
// discard third resource content once we see its size exceeds limit,
// and finally replace first resource content with the last resource content.

doXHR("GET", "resources/resource.php?size=200", true, xhrLoaded1);
}

function xhrLoaded1()
{
doXHR("GET", "resources/resource.php?size=100", true, xhrLoaded2);
}

function xhrLoaded2()
{
doXHR("GET", "resources/resource.php?size=201", true, xhrLoaded3);
}

function xhrLoaded3()
{
doXHR("GET", "resources/resource.php?size=100", true, allXHRsLoaded);
}

function allXHRsLoaded()
{
console.log("Done.");
}

function test()
{
InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step1);
InspectorTest.evaluateInPage("loadData()");

function dumpResource(resource, callback)
{
if (!resource)
return callback();
InspectorTest.addResult(resource.url);

function contentLoaded()
{
InspectorTest.addResult("resource.content: " + resource.content);
callback();
}

resource.requestContent(contentLoaded);
}

function step1()
{
var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 4];
dumpResource(resource, step2);
}

function step2()
{
var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 3];
dumpResource(resource, step3);
}

function step3()
{
var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 2];
dumpResource(resource, step4);
}

function step4()
{
var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
dumpResource(resource, step5);
}

function step5()
{
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p> Tests NetworkResourcesData logic for XHR content replacement.</p>
</body>
</html>

@@ -0,0 +1,41 @@
CONSOLE MESSAGE: line 66: Done.
Tests that network panel shows content for embed objects.


http://127.0.0.1:8000/inspector/network/resources/resource.php?type=image
resource.type: 8
resource.content before requesting content: undefined
resource.content after requesting content: null
http://127.0.0.1:8000/inspector/network/resources/plugin-data.php?filename=utf8.xml&mimetype=text/html&charset=utf8
resource.type: 8
resource.content before requesting content: undefined
resource.content after requesting content: <?xml version='1.0' encoding='utf-8'?>
<root>
<utf8>SUССЕSS - These 'CCE' are cyrillic letters.</utf8>
</root>

http://127.0.0.1:8000/inspector/network/resources/plugin-data.php?filename=cp1251.xml&mimetype=text/html&charset=cp1251
resource.type: 8
resource.content before requesting content: undefined
resource.content after requesting content: <?xml version='1.0' encoding='cp1251'?>
<root>
<cp1251>SUССЕSS - These 'CCE' are cyrillic letters.</cp1251>
</root>

http://127.0.0.1:8000/inspector/network/resources/plugin-data.php?filename=utf8.xml&mimetype=application/xml
resource.type: 8
resource.content before requesting content: undefined
resource.content after requesting content: <?xml version='1.0' encoding='utf-8'?>
<root>
<utf8>SUССЕSS - These 'CCE' are cyrillic letters.</utf8>
</root>

http://127.0.0.1:8000/inspector/network/resources/plugin-data.php?filename=cp1251.xml&mimetype=application/xml
resource.type: 8
resource.content before requesting content: undefined
resource.content after requesting content: <?xml version='1.0' encoding='cp1251'?>
<root>
<cp1251>SUССЕSS - These 'CCE' are cyrillic letters.</cp1251>
</root>


0 comments on commit 2da9e60

Please sign in to comment.