Skip to content
Permalink
Browse files
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

        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

        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  Vsevolod Vlasov  <vsevik@chromium.org>

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

        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-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

        Reviewed by Pavel Feldman.

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

Canonical link: https://commits.webkit.org/79639@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Vsevolod Vlasov committed Jul 4, 2011
1 parent 49bf423 commit 75620eb85f1487efa33fd35d22d016ab8bfdc21b
Showing with 825 additions and 73 deletions.
  1. +9 −0 ChangeLog
  2. +23 −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. +79 −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. +10 −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,12 @@
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

Reviewed by Pavel Feldman.

* Source/autotools/symbols.filter:

2011-07-01 Tony Chang <tony@chromium.org>

Add chromium sql directory to git ignore.
@@ -1,3 +1,26 @@
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

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 Anders Carlsson <andersca@apple.com>

NP_RemoveProperty is not called back by Safari when delete npObject.prop is encountered in JavaScript
@@ -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 75620eb

Please sign in to comment.