Unreviewed, rolling out r124000.
authorvsevik@chromium.org <vsevik@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jul 2012 12:21:00 +0000 (12:21 +0000)
committervsevik@chromium.org <vsevik@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jul 2012 12:21:00 +0000 (12:21 +0000)
http://trac.webkit.org/changeset/124000
https://bugs.webkit.org/show_bug.cgi?id=92632

seems to have broken chromium Range_InstanceSizeUnknown unit
test across many platforms (Requested by tomhudson on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-07-30

.:

* Source/autotools/symbols.filter:

Source/WebCore:

* WebCore.exp.in:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::inspectedPageDestroyed):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentation):
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::didReceiveData):
(WebCore::InspectorResourceAgent::getResponseBody):
* inspector/InspectorResourceAgent.h:
(InspectorResourceAgent):
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::ResourceData::ResourceData):
(WebCore::NetworkResourcesData::ResourceData::setContent):
(WebCore::NetworkResourcesData::setResourceContent):
* inspector/NetworkResourcesData.h:
(ResourceData):
(WebCore::NetworkResourcesData::ResourceData::cachedResource):
(NetworkResourcesData):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::~CachedResource):
(WebCore::CachedResource::removeClient):
(WebCore::CachedResource::deleteIfPossible):
(WebCore):
* loader/cache/CachedResource.h:
(CachedResource):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::garbageCollectDocumentResourcesTimerFired):
(WebCore::CachedResourceLoader::clearPreloads):
* loader/cache/CachedResourceLoader.h:
(CachedResourceLoader):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::evict):
* testing/InternalSettings.cpp:
* testing/Internals.cpp:
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

Source/WebKit2:

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

LayoutTests:

* http/tests/inspector/network/cached-resource-destroyed-moved-to-storage-expected.txt: Removed.
* http/tests/inspector/network/cached-resource-destroyed-moved-to-storage.html: Removed.
* http/tests/inspector/network/cached-resource-destroyed-too-big-discarded-expected.txt: Removed.
* http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124015 268f45cc-cd09-0410-ab3c-d52691b4dbfc

28 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/network/cached-resource-destroyed-moved-to-storage-expected.txt [deleted file]
LayoutTests/http/tests/inspector/network/cached-resource-destroyed-moved-to-storage.html [deleted file]
LayoutTests/http/tests/inspector/network/cached-resource-destroyed-too-big-discarded-expected.txt [deleted file]
LayoutTests/http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorResourceAgent.cpp
Source/WebCore/inspector/InspectorResourceAgent.h
Source/WebCore/inspector/NetworkResourcesData.cpp
Source/WebCore/inspector/NetworkResourcesData.h
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/CachedResourceLoader.h
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit2/ChangeLog
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def
Source/autotools/symbols.filter

index cbe1627..f71cdd9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-07-30  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r124000.
+        http://trac.webkit.org/changeset/124000
+        https://bugs.webkit.org/show_bug.cgi?id=92632
+
+        seems to have broken chromium Range_InstanceSizeUnknown unit
+        test across many platforms (Requested by tomhudson on
+        #webkit).
+
+        * Source/autotools/symbols.filter:
+
 2012-07-30  Patrick Gansterer  <paroga@webkit.org>
 
         Replace UnicodeWinCE with UnicodeWchar
index 1d76726..dca1e1a 100644 (file)
@@ -1,5 +1,20 @@
 2012-07-30  Sheriff Bot  <webkit.review.bot@gmail.com>
 
+        Unreviewed, rolling out r124000.
+        http://trac.webkit.org/changeset/124000
+        https://bugs.webkit.org/show_bug.cgi?id=92632
+
+        seems to have broken chromium Range_InstanceSizeUnknown unit
+        test across many platforms (Requested by tomhudson on
+        #webkit).
+
+        * http/tests/inspector/network/cached-resource-destroyed-moved-to-storage-expected.txt: Removed.
+        * http/tests/inspector/network/cached-resource-destroyed-moved-to-storage.html: Removed.
+        * http/tests/inspector/network/cached-resource-destroyed-too-big-discarded-expected.txt: Removed.
+        * http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html: Removed.
+
+2012-07-30  Sheriff Bot  <webkit.review.bot@gmail.com>
+
         Unreviewed, rolling out r124004.
         http://trac.webkit.org/changeset/124004
         https://bugs.webkit.org/show_bug.cgi?id=92622
diff --git a/LayoutTests/http/tests/inspector/network/cached-resource-destroyed-moved-to-storage-expected.txt b/LayoutTests/http/tests/inspector/network/cached-resource-destroyed-moved-to-storage-expected.txt
deleted file mode 100644 (file)
index 73b41eb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-CONSOLE MESSAGE: line 16: Done1.
-CONSOLE MESSAGE: line 26: Done2.
-Tests content is moved from cached resource to resource agent's data storage when cached resource is destroyed.
-
-Bug 92108  
-http://127.0.0.1:8000/inspector/network/resources/resource.php?type=image&random=1&size=400
-request.type: image
-request.content.length after requesting content: 536
-Releasing cached resource.
-request.content.length after requesting content: 536
-
diff --git a/LayoutTests/http/tests/inspector/network/cached-resource-destroyed-moved-to-storage.html b/LayoutTests/http/tests/inspector/network/cached-resource-destroyed-moved-to-storage.html
deleted file mode 100644 (file)
index 29e88ec..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-<html>
-<head>
-<script src="../inspector-test.js"></script>
-<script src="../network-test.js"></script>
-<script>
-var image;
-function loadFirstImage() {
-    image = new Image();
-    image.onload = firstImageLoaded;
-    document.body.appendChild(image);
-    image.src = "resources/resource.php?type=image&random=1&size=400";
-}
-
-function firstImageLoaded()
-{
-    console.log("Done1.");
-}
-
-function loadSecondImage() {
-    image.onload = secondImageLoaded;
-    image.src = "resources/resource.php?type=image&random=1&size=200";
-}
-
-function secondImageLoaded()
-{
-    console.log("Done2.");
-}
-
-function forceCachedResourceLoaderGC() {
-    if (window.internals)
-        window.internals.garbageCollectDocumentResources();
-}
-
-function test()
-{
-    // Since this test could be run together with other inspector backend cache
-    // tests, we need to reset size limits to default ones.
-    InspectorTest.resetInspectorResourcesData(step1);
-
-    var imageRequest;
-    function step1()
-    {
-        InspectorTest.addConsoleSniffer(step2);
-        InspectorTest.evaluateInPage("loadFirstImage()");
-    }
-
-    function step2()
-    {
-        imageRequest = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
-        imageRequest.requestContent(step3);
-    }
-
-    var originalContentLength;
-    function step3()
-    {
-        InspectorTest.addResult(imageRequest.url);
-        InspectorTest.addResult("request.type: " + imageRequest.type);
-        InspectorTest.addResult("request.content.length after requesting content: " + imageRequest.content.length);
-        originalContentLength = imageRequest.content.length;
-        InspectorTest.assertTrue(imageRequest.content.length > 0, "No content before destroying CachedResource.");
-
-        InspectorTest.addResult("Releasing cached resource.");
-        // Loading another image to the same image element so that the original image cached resource is released.
-        InspectorTest.addConsoleSniffer(step4);
-        InspectorTest.evaluateInPage("loadSecondImage()");
-    }
-
-    function step4(msg)
-    {
-        // Disable-enable cache to force MemoryCache::evictResources().
-        NetworkAgent.setCacheDisabled(true, step5);
-    }
-
-    function step5(msg)
-    {
-        NetworkAgent.setCacheDisabled(false, step6);
-    }
-
-    function step6()
-    {
-        // Force CachedResourceLoader garbage collector run.
-        InspectorTest.evaluateInPage("forceCachedResourceLoaderGC()");
-
-        // Re-request content now that CachedResource should have been destroyed.
-        delete imageRequest._content;
-        imageRequest.requestContent(step7);
-    }
-
-    function step7()
-    {
-        InspectorTest.addResult("request.content.length after requesting content: " + imageRequest.content.length);
-        originalContentLength = imageRequest.content.length;
-        InspectorTest.assertTrue(imageRequest.content.length === originalContentLength, "Content changed after cached resource was destroyed");
-        InspectorTest.resetInspectorResourcesData(step8);
-    }
-
-    function step8()
-    {
-        InspectorTest.completeTest();
-    }
-}
-</script>
-</head>
-<body onload="runTest()">
-<p>Tests content is moved from cached resource to resource agent's data storage when cached resource is destroyed.</p>
-<a href="https://bugs.webkit.org/show_bug.cgi?id=92108">Bug 92108</a>
-</body>
-</html>
-
diff --git a/LayoutTests/http/tests/inspector/network/cached-resource-destroyed-too-big-discarded-expected.txt b/LayoutTests/http/tests/inspector/network/cached-resource-destroyed-too-big-discarded-expected.txt
deleted file mode 100644 (file)
index 6a42745..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-CONSOLE MESSAGE: line 23: Done1.
-CONSOLE MESSAGE: line 33: Done2.
-Tests cached resource content is discarded when cached resource is destroyed if content size is too big for the resource agent's data storage.
-
-Bug 92108  
-http://127.0.0.1:8000/inspector/network/resources/resource.php?type=image&random=1&size=400
-request.type: image
-request.content.length after requesting content: 536
-Releasing cached resource.
-request.content after requesting content: null
-
diff --git a/LayoutTests/http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html b/LayoutTests/http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html
deleted file mode 100644 (file)
index 6dc150f..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<html>
-<head>
-<script src="../inspector-test.js"></script>
-<script src="../network-test.js"></script>
-<script>
-var image;
-function loadFirstImage() {
-    if (!window.internals) {
-        console.log("This test can not be run as window.internals is not available.");
-        return;
-    }
-    // Make sure there is no enough space to save content in resource agent's storage.
-    internals.settings.setInspectorResourcesDataSizeLimits(100, 100);
-
-    image = new Image();
-    image.onload = firstImageLoaded;
-    document.body.appendChild(image);
-    image.src = "resources/resource.php?type=image&random=1&size=400";
-}
-
-function firstImageLoaded()
-{
-    console.log("Done1.");
-}
-
-function loadSecondImage() {
-    image.onload = secondImageLoaded;
-    image.src = "resources/resource.php?type=image&random=1&size=200";
-}
-
-function secondImageLoaded()
-{
-    console.log("Done2.");
-}
-
-function forceCachedResourceLoaderGC() {
-    if (window.internals)
-        window.internals.garbageCollectDocumentResources();
-}
-
-function test()
-{
-    var imageRequest;
-    InspectorTest.addConsoleSniffer(step2);
-    InspectorTest.evaluateInPage("loadFirstImage()");
-
-    function step2()
-    {
-        imageRequest = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
-        imageRequest.requestContent(step3);
-    }
-
-    function step3()
-    {
-        InspectorTest.addResult(imageRequest.url);
-        InspectorTest.addResult("request.type: " + imageRequest.type);
-        InspectorTest.addResult("request.content.length after requesting content: " + imageRequest.content.length);
-        InspectorTest.assertTrue(imageRequest.content.length > 0, "No content before destroying CachedResource.");
-
-        InspectorTest.addResult("Releasing cached resource.");
-        // Loading another image to the same image element so that the original image cached resource is released.
-        InspectorTest.addConsoleSniffer(step4);
-        InspectorTest.evaluateInPage("loadSecondImage()");
-    }
-
-    function step4(msg)
-    {
-        // Disable-enable cache to force MemoryCache::evictResources().
-        NetworkAgent.setCacheDisabled(true, step5);
-    }
-
-    function step5(msg)
-    {
-        NetworkAgent.setCacheDisabled(false, step6);
-    }
-
-    function step6()
-    {
-        // Force CachedResourceLoader garbage collector run.
-        InspectorTest.evaluateInPage("forceCachedResourceLoaderGC()");
-
-        // Re-request content now that CachedResource should have been destroyed.
-        delete imageRequest._content;
-        imageRequest.requestContent(step7);
-    }
-
-    function step7()
-    {
-        InspectorTest.addResult("request.content after requesting content: " + imageRequest.content);
-        InspectorTest.assertTrue(!imageRequest.content, "Content available after CachedResource was destroyed.");
-        InspectorTest.resetInspectorResourcesData(step8);
-    }
-
-    function step8()
-    {
-        InspectorTest.completeTest();
-    }
-}
-</script>
-</head>
-<body onload="runTest()">
-<p>Tests cached resource content is discarded when cached resource is destroyed if content size is too big for the resource agent's data storage.</p>
-<a href="https://bugs.webkit.org/show_bug.cgi?id=92108">Bug 92108</a>
-</body>
-</html>
-
index 448bb23..adf5214 100644 (file)
@@ -1,3 +1,54 @@
+2012-07-30  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r124000.
+        http://trac.webkit.org/changeset/124000
+        https://bugs.webkit.org/show_bug.cgi?id=92632
+
+        seems to have broken chromium Range_InstanceSizeUnknown unit
+        test across many platforms (Requested by tomhudson on
+        #webkit).
+
+        * WebCore.exp.in:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::inspectedPageDestroyed):
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore):
+        * inspector/InspectorInstrumentation.h:
+        (InspectorInstrumentation):
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::didReceiveData):
+        (WebCore::InspectorResourceAgent::getResponseBody):
+        * inspector/InspectorResourceAgent.h:
+        (InspectorResourceAgent):
+        * inspector/NetworkResourcesData.cpp:
+        (WebCore::NetworkResourcesData::ResourceData::ResourceData):
+        (WebCore::NetworkResourcesData::ResourceData::setContent):
+        (WebCore::NetworkResourcesData::setResourceContent):
+        * inspector/NetworkResourcesData.h:
+        (ResourceData):
+        (WebCore::NetworkResourcesData::ResourceData::cachedResource):
+        (NetworkResourcesData):
+        * loader/cache/CachedResource.cpp:
+        (WebCore::CachedResource::~CachedResource):
+        (WebCore::CachedResource::removeClient):
+        (WebCore::CachedResource::deleteIfPossible):
+        (WebCore):
+        * loader/cache/CachedResource.h:
+        (CachedResource):
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::garbageCollectDocumentResourcesTimerFired):
+        (WebCore::CachedResourceLoader::clearPreloads):
+        * loader/cache/CachedResourceLoader.h:
+        (CachedResourceLoader):
+        * loader/cache/MemoryCache.cpp:
+        (WebCore::MemoryCache::evict):
+        * testing/InternalSettings.cpp:
+        * testing/Internals.cpp:
+        * testing/Internals.h:
+        (Internals):
+        * testing/Internals.idl:
+
 2012-07-30  Hayato Ito  <hayato@chromium.org>
 
         Remove an unused member variable, m_originalTarget, from EventDispatcher.
index 5367731..dbc961c 100644 (file)
@@ -518,7 +518,6 @@ __ZN7WebCore19TextResourceDecoder5flushEv
 __ZN7WebCore19TextResourceDecoder6decodeEPKcm
 __ZN7WebCore19TextResourceDecoderC1ERKN3WTF6StringERKNS_12TextEncodingEb
 __ZN7WebCore19TextResourceDecoderD1Ev
-__ZN7WebCore20CachedResourceLoader31garbageCollectDocumentResourcesEv
 __ZN7WebCore20DictationAlternativeC1Ejjy
 __ZN7WebCore20DictationAlternativeC1Ev
 __ZN7WebCore20DisplaySleepDisablerC1EPKc
index ab6e377..c3f9f08 100644 (file)
@@ -165,8 +165,6 @@ InspectorController::InspectorController(Page* page, InspectorClient* inspectorC
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     runtimeAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
 #endif
-
-    InspectorInstrumentation::registerInstrumentingAgents(m_instrumentingAgents.get());
 }
 
 InspectorController::~InspectorController()
@@ -185,7 +183,6 @@ PassOwnPtr<InspectorController> InspectorController::create(Page* page, Inspecto
 void InspectorController::inspectedPageDestroyed()
 {
     disconnectFrontend();
-    InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get());
     m_injectedScriptManager->disconnect();
     m_inspectorClient->inspectorDestroyed();
     m_inspectorClient = 0;
index 0bc16f4..dfaa0a4 100644 (file)
@@ -80,10 +80,6 @@ static const char* const setTimerEventName = "setTimer";
 static const char* const clearTimerEventName = "clearTimer";
 static const char* const timerFiredEventName = "timerFired";
 
-namespace {
-static HashSet<InstrumentingAgents*>* instrumentingAgentsSet = 0;
-}
-
 int InspectorInstrumentation::s_frontendCounter = 0;
 
 static bool eventHasListeners(const AtomicString& eventType, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors)
@@ -848,18 +844,6 @@ void InspectorInstrumentation::loaderDetachedFromFrameImpl(InstrumentingAgents*
         inspectorPageAgent->loaderDetachedFromFrame(loader);
 }
 
-void InspectorInstrumentation::willDestroyCachedResourceImpl(CachedResource* cachedResource)
-{
-    if (!instrumentingAgentsSet)
-        return;
-    HashSet<InstrumentingAgents*>::iterator end = instrumentingAgentsSet->end();
-    for (HashSet<InstrumentingAgents*>::iterator it = instrumentingAgentsSet->begin(); it != end; ++it) {
-        InstrumentingAgents* instrumentingAgents = *it;
-        if (InspectorResourceAgent* inspectorResourceAgent = instrumentingAgents->inspectorResourceAgent())
-            inspectorResourceAgent->willDestroyCachedResource(cachedResource);
-    }
-}
-
 InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTMLImpl(InstrumentingAgents* instrumentingAgents, unsigned int length, unsigned int startLine, Frame* frame)
 {
     int timelineAgentId = 0;
@@ -1157,22 +1141,6 @@ WTF::ThreadSpecific<InspectorTimelineAgent*>& InspectorInstrumentation::threadSp
     return *instance;
 }
 
-void InspectorInstrumentation::registerInstrumentingAgents(InstrumentingAgents* instrumentingAgents)
-{
-    if (!instrumentingAgentsSet)
-        instrumentingAgentsSet = new HashSet<InstrumentingAgents*>();
-    instrumentingAgentsSet->add(instrumentingAgents);
-}
-
-void InspectorInstrumentation::unregisterInstrumentingAgents(InstrumentingAgents* instrumentingAgents)
-{
-    if (!instrumentingAgentsSet)
-        return;
-    instrumentingAgentsSet->remove(instrumentingAgents);
-    if (!instrumentingAgentsSet->size())
-        delete instrumentingAgentsSet;
-}
-
 InspectorTimelineAgent* InspectorInstrumentation::retrieveTimelineAgent(const InspectorInstrumentationCookie& cookie)
 {
     if (!cookie.first)
index 6147f77..3287f71 100644 (file)
@@ -187,7 +187,6 @@ public:
     static void frameDetachedFromParent(Frame*);
     static void didCommitLoad(Frame*, DocumentLoader*);
     static void loaderDetachedFromFrame(Frame*, DocumentLoader*);
-    static void willDestroyCachedResource(CachedResource*);
 
     static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned int length, unsigned int startLine);
     static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned int endLine);
@@ -264,9 +263,6 @@ public:
     static GeolocationPosition* overrideGeolocationPosition(Page*, GeolocationPosition*);
 #endif
 
-    static void registerInstrumentingAgents(InstrumentingAgents*);
-    static void unregisterInstrumentingAgents(InstrumentingAgents*);
-
 private:
 #if ENABLE(INSPECTOR)
     static WTF::ThreadSpecific<InspectorTimelineAgent*>& threadSpecificTimelineAgentForOrphanEvents();
@@ -363,7 +359,6 @@ private:
     static void frameDetachedFromParentImpl(InstrumentingAgents*, Frame*);
     static void didCommitLoadImpl(InstrumentingAgents*, Page*, DocumentLoader*);
     static void loaderDetachedFromFrameImpl(InstrumentingAgents*, DocumentLoader*);
-    static void willDestroyCachedResourceImpl(CachedResource*);
 
     static InspectorInstrumentationCookie willWriteHTMLImpl(InstrumentingAgents*, unsigned int length, unsigned int startLine, Frame*);
     static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned int endLine);
@@ -1205,14 +1200,6 @@ inline void InspectorInstrumentation::loaderDetachedFromFrame(Frame* frame, Docu
 #endif
 }
 
-inline void InspectorInstrumentation::willDestroyCachedResource(CachedResource* cachedResource)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    willDestroyCachedResourceImpl(cachedResource);
-#endif
-}
-
 inline InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTML(Document* document, unsigned int length, unsigned int startLine)
 {
 #if ENABLE(INSPECTOR)
index 65148b2..8776bb8 100644 (file)
@@ -283,7 +283,7 @@ void InspectorResourceAgent::didReceiveData(unsigned long identifier, const char
 
     if (data) {
         NetworkResourcesData::ResourceData const* resourceData = m_resourcesData->data(requestId);
-        if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::OtherResource || (resourceData && isErrorStatusCode(resourceData->httpStatusCode()) && resourceData->cachedResource()))
+        if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::OtherResource || (resourceData && isErrorStatusCode(resourceData->httpStatusCode()) && (resourceData->cachedResource())))
             m_resourcesData->maybeAddResourceData(requestId, data, dataLength);
     }
 
@@ -364,21 +364,6 @@ void InspectorResourceAgent::didLoadXHRSynchronously()
     m_loadingXHRSynchronously = false;
 }
 
-void InspectorResourceAgent::willDestroyCachedResource(CachedResource* cachedResource)
-{
-    Vector<String> requestIds = m_resourcesData->removeCachedResource(cachedResource);
-    if (!requestIds.size())
-        return;
-
-    String content;
-    bool base64Encoded;
-    if (!InspectorPageAgent::cachedResourceContent(cachedResource, &content, &base64Encoded))
-        return;
-    Vector<String>::iterator end = requestIds.end();
-    for (Vector<String>::iterator it = requestIds.begin(); it != end; ++it)
-        m_resourcesData->setResourceContent(*it, content, base64Encoded);
-}
-
 void InspectorResourceAgent::applyUserAgentOverride(String* userAgent)
 {
     String userAgentOverride = m_state->getString(ResourceAgentState::userAgentOverride);
@@ -544,7 +529,7 @@ void InspectorResourceAgent::getResponseBody(ErrorString* errorString, const Str
     }
 
     if (resourceData->hasContent()) {
-        *base64Encoded = resourceData->base64Encoded();
+        *base64Encoded = false;
         *content = resourceData->content();
         return;
     }
index 8dab253..54cf48e 100644 (file)
@@ -103,7 +103,6 @@ public:
     void didReceiveXHRResponse(unsigned long identifier);
     void willLoadXHRSynchronously();
     void didLoadXHRSynchronously();
-    void willDestroyCachedResource(CachedResource*);
 
     void applyUserAgentOverride(String* userAgent);
 
index 7b1fd17..619a19a 100644 (file)
@@ -51,19 +51,16 @@ namespace WebCore {
 NetworkResourcesData::ResourceData::ResourceData(const String& requestId, const String& loaderId)
     : m_requestId(requestId)
     , m_loaderId(loaderId)
-    , m_base64Encoded(false)
     , m_isContentPurged(false)
     , m_type(InspectorPageAgent::OtherResource)
-    , m_cachedResource(0)
 {
 }
 
-void NetworkResourcesData::ResourceData::setContent(const String& content, bool base64Encoded)
+void NetworkResourcesData::ResourceData::setContent(const String& content)
 {
     ASSERT(!hasData());
     ASSERT(!hasContent());
     m_content = content;
-    m_base64Encoded = base64Encoded;
 }
 
 unsigned NetworkResourcesData::ResourceData::removeContent()
@@ -174,7 +171,7 @@ InspectorPageAgent::ResourceType NetworkResourcesData::resourceType(const String
     return resourceData->type();
 }
 
-void NetworkResourcesData::setResourceContent(const String& requestId, const String& content, bool base64Encoded)
+void NetworkResourcesData::setResourceContent(const String& requestId, const String& content)
 {
     ResourceData* resourceData = m_requestIdToResourceDataMap.get(requestId);
     if (!resourceData)
@@ -189,7 +186,7 @@ void NetworkResourcesData::setResourceContent(const String& requestId, const Str
         if (resourceData->hasContent())
             m_contentSize -= resourceData->removeContent();
         m_requestIdsDeque.append(requestId);
-        resourceData->setContent(content, base64Encoded);
+        resourceData->setContent(content);
         m_contentSize += dataLength;
     }
 }
@@ -248,22 +245,6 @@ NetworkResourcesData::ResourceData const* NetworkResourcesData::data(const Strin
     return m_requestIdToResourceDataMap.get(requestId);
 }
 
-Vector<String> NetworkResourcesData::removeCachedResource(CachedResource* cachedResource)
-{
-    Vector<String> result;
-    ResourceDataMap::iterator it;
-    ResourceDataMap::iterator end = m_requestIdToResourceDataMap.end();
-    for (it = m_requestIdToResourceDataMap.begin(); it != end; ++it) {
-        ResourceData* resourceData = it->second;
-        if (resourceData->cachedResource() == cachedResource) {
-            resourceData->setCachedResource(0);
-            result.append(it->first);
-        }
-    }
-
-    return result;
-}
-
 void NetworkResourcesData::clear(const String& preservedLoaderId)
 {
     m_requestIdsDeque.clear();
index 5aa3f4a..1b172e7 100644 (file)
@@ -29,6 +29,7 @@
 #ifndef NetworkResourcesData_h
 #define NetworkResourcesData_h
 
+#include "CachedResourceHandle.h"
 #include "InspectorPageAgent.h"
 #include "TextResourceDecoder.h"
 
@@ -64,9 +65,7 @@ public:
 
         bool hasContent() const { return !m_content.isNull(); }
         String content() const { return m_content; }
-        void setContent(const String&, bool base64Encoded);
-
-        bool base64Encoded() const { return m_base64Encoded; }
+        void setContent(const String&);
 
         unsigned removeContent();
         bool isContentPurged() const { return m_isContentPurged; }
@@ -87,7 +86,7 @@ public:
         PassRefPtr<SharedBuffer> buffer() const { return m_buffer; }
         void setBuffer(PassRefPtr<SharedBuffer> buffer) { m_buffer = buffer; }
 
-        CachedResource* cachedResource() const { return m_cachedResource; }
+        CachedResource* cachedResource() const { return m_cachedResource.get(); }
         void setCachedResource(CachedResource* cachedResource) { m_cachedResource = cachedResource; }
 
     private:
@@ -101,7 +100,6 @@ public:
         String m_frameId;
         String m_url;
         String m_content;
-        bool m_base64Encoded;
         RefPtr<SharedBuffer> m_dataBuffer;
         bool m_isContentPurged;
         InspectorPageAgent::ResourceType m_type;
@@ -111,7 +109,7 @@ public:
         RefPtr<TextResourceDecoder> m_decoder;
 
         RefPtr<SharedBuffer> m_buffer;
-        CachedResource* m_cachedResource;
+        CachedResourceHandle<CachedResource> m_cachedResource;
     };
 
     NetworkResourcesData();
@@ -122,20 +120,19 @@ public:
     void responseReceived(const String& requestId, const String& frameId, const ResourceResponse&);
     void setResourceType(const String& requestId, InspectorPageAgent::ResourceType);
     InspectorPageAgent::ResourceType resourceType(const String& requestId);
-    void setResourceContent(const String& requestId, const String& content, bool base64Encoded = false);
+    void setResourceContent(const String& requestId, const String& content);
     void maybeAddResourceData(const String& requestId, const char* data, int dataLength);
     void maybeDecodeDataToContent(const String& requestId);
     void addCachedResource(const String& requestId, CachedResource*);
     void addResourceSharedBuffer(const String& requestId, PassRefPtr<SharedBuffer>, const String& textEncodingName);
     ResourceData const* data(const String& requestId);
-    Vector<String> removeCachedResource(CachedResource*);
     void clear(const String& preservedLoaderId = String());
 
     void setResourcesDataSizeLimits(int maximumResourcesContentSize, int maximumSingleResourceContentSize);
 
 private:
     void ensureNoDataForRequestId(const String& requestId);
-    bool ensureFreeSpace(int);
+    bool ensureFreeSpace(int size);
 
     Deque<String> m_requestIdsDeque;
 
index 41cd601..74fa494 100755 (executable)
@@ -34,7 +34,6 @@
 #include "Document.h"
 #include "Frame.h"
 #include "FrameLoaderClient.h"
-#include "InspectorInstrumentation.h"
 #include "KURL.h"
 #include "Logging.h"
 #include "PurgeableBuffer.h"
@@ -178,7 +177,7 @@ CachedResource::~CachedResource()
     ASSERT(!inCache());
     ASSERT(!m_deleted);
     ASSERT(url().isNull() || memoryCache()->resourceForURL(KURL(ParsedURLString, url())) != this);
-
+    
 #ifndef NDEBUG
     m_deleted = true;
     cachedResourceLeakCounter.decrement();
@@ -435,8 +434,9 @@ void CachedResource::removeClient(CachedResourceClient* client)
         didRemoveClient(client);
     }
 
-    bool deleted = deleteIfPossible();
-    if (!deleted && !hasClients() && inCache()) {
+    if (canDelete() && !inCache())
+        delete this;
+    else if (!hasClients() && inCache()) {
         memoryCache()->removeFromLiveResourcesSize(this);
         memoryCache()->removeFromLiveDecodedResourcesList(this);
         allClientsRemoved();
@@ -468,16 +468,12 @@ void CachedResource::decodedDataDeletionTimerFired(Timer<CachedResource>*)
     destroyDecodedData();
 }
 
-bool CachedResource::deleteIfPossible()
+void CachedResource::deleteIfPossible()
 {
-    if (canDelete() && !inCache()) {
-        InspectorInstrumentation::willDestroyCachedResource(this);
+    if (canDelete() && !inCache())
         delete this;
-        return true;
-    }
-    return false;
 }
-
+    
 void CachedResource::setDecodedSize(unsigned size)
 {
     if (size == m_decodedSize)
index fe3e1fc..161dd43 100644 (file)
@@ -115,7 +115,7 @@ public:
     void addClient(CachedResourceClient*);
     void removeClient(CachedResourceClient*);
     bool hasClients() const { return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty(); }
-    bool deleteIfPossible();
+    void deleteIfPossible();
 
     enum PreloadResult {
         PreloadNotReferenced,
index 9a88724..e1987c3 100644 (file)
@@ -676,11 +676,7 @@ void CachedResourceLoader::loadDone()
 void CachedResourceLoader::garbageCollectDocumentResourcesTimerFired(Timer<CachedResourceLoader>* timer)
 {
     ASSERT_UNUSED(timer, timer == &m_garbageCollectDocumentResourcesTimer);
-    garbageCollectDocumentResources();
-}
 
-void CachedResourceLoader::garbageCollectDocumentResources()
-{
     typedef Vector<String, 10> StringVector;
     StringVector resourcesToDelete;
 
@@ -817,8 +813,9 @@ void CachedResourceLoader::clearPreloads()
     for (ListHashSet<CachedResource*>::iterator it = m_preloads->begin(); it != end; ++it) {
         CachedResource* res = *it;
         res->decreasePreloadCount();
-        bool deleted = res->deleteIfPossible();
-        if (!deleted && res->preloadResult() == CachedResource::PreloadNotReferenced)
+        if (res->canDelete() && !res->inCache())
+            delete res;
+        else if (res->preloadResult() == CachedResource::PreloadNotReferenced)
             memoryCache()->remove(res);
     }
     m_preloads.clear();
index 5eeb387..d82b3bf 100644 (file)
@@ -105,7 +105,6 @@ public:
 
     void removeCachedResource(CachedResource*) const;
     void loadDone();
-    void garbageCollectDocumentResources();
     
     void incrementRequestCount(const CachedResource*);
     void decrementRequestCount(const CachedResource*);
index 5dc0474..299d10a 100644 (file)
@@ -402,7 +402,8 @@ void MemoryCache::evict(CachedResource* resource)
     } else
         ASSERT(m_resources.get(resource->url()) != resource);
 
-    resource->deleteIfPossible();
+    if (resource->canDelete())
+        delete resource;
 }
 
 static inline unsigned fastLog2(unsigned i)
index 552c13a..3568dc9 100755 (executable)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "InternalSettings.h"
 
+#include "CachedResourceLoader.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
 #include "Document.h"
index c0502a7..0c50651 100644 (file)
@@ -1096,19 +1096,6 @@ void Internals::resumeAnimations(Document* document, ExceptionCode& ec) const
     controller->resumeAnimations();
 }
 
-void Internals::garbageCollectDocumentResources(Document* document, ExceptionCode& ec) const
-{
-    if (!document) {
-        ec = INVALID_ACCESS_ERR;
-        return;
-    }
-
-    CachedResourceLoader* cachedResourceLoader = document->cachedResourceLoader();
-    if (!cachedResourceLoader)
-        return;
-    cachedResourceLoader->garbageCollectDocumentResources();
-}
-
 void Internals::allowRoundingHacks() const
 {
     settings()->allowRoundingHacks();
index 157662c..d551c49 100644 (file)
@@ -183,8 +183,6 @@ public:
     void suspendAnimations(Document*, ExceptionCode&) const;
     void resumeAnimations(Document*, ExceptionCode&) const;
 
-    void garbageCollectDocumentResources(Document*, ExceptionCode&) const;
-
     void allowRoundingHacks() const;
 
 #if ENABLE(INSPECTOR)
index 601e8a7..f685a40 100644 (file)
@@ -155,8 +155,6 @@ module window {
         void suspendAnimations(in Document document) raises (DOMException);
         void resumeAnimations(in Document document) raises (DOMException);
 
-        void garbageCollectDocumentResources(in Document document) raises (DOMException);
-
         void allowRoundingHacks();
 
 #if defined(ENABLE_BATTERY_STATUS) && ENABLE_BATTERY_STATUS
index de53565..11e15d6 100644 (file)
@@ -1,3 +1,16 @@
+2012-07-30  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r124000.
+        http://trac.webkit.org/changeset/124000
+        https://bugs.webkit.org/show_bug.cgi?id=92632
+
+        seems to have broken chromium Range_InstanceSizeUnknown unit
+        test across many platforms (Requested by tomhudson on
+        #webkit).
+
+        * win/WebKit2.def:
+        * win/WebKit2CFLite.def:
+
 2012-07-27  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
 
         [Qt] Remove accurateVisibleContentsPosition and use a FloatRect for visibleContentsRect instead
index dea36ed..ec62274 100644 (file)
@@ -175,7 +175,6 @@ EXPORTS
         ?find@StringImpl@WTF@@QAEIPAV12@@Z
         ?absoluteCaretBounds@FrameSelection@WebCore@@QAE?AVIntRect@2@XZ
         ?fromUTF8WithLatin1Fallback@String@WTF@@SA?AV12@PBEI@Z
-        ?garbageCollectDocumentResources@CachedResourceLoader@WebCore@@QAEXXZ
         ?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z
         ?getData16SlowCase@StringImpl@WTF@@ABEPB_WXZ
         ?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z
index 1a47d2f..50ca4cf 100644 (file)
@@ -172,7 +172,6 @@ EXPORTS
         ?find@StringImpl@WTF@@QAEIPAV12@@Z
         ?absoluteCaretBounds@FrameSelection@WebCore@@QAE?AVIntRect@2@XZ
         ?fromUTF8WithLatin1Fallback@String@WTF@@SA?AV12@PBEI@Z
-        ?garbageCollectDocumentResources@CachedResourceLoader@WebCore@@QAEXXZ
         ?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z
         ?getData16SlowCase@StringImpl@WTF@@ABEPB_WXZ
         ?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z
index ddeccf6..3265785 100644 (file)
@@ -72,13 +72,12 @@ _ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9C
 _ZN7WebCore17InspectorCounters12counterValueENS0_11CounterTypeE;
 _ZN7WebCore18HTMLContentElement6createEPNS_8DocumentE;
 _ZN7WebCore19InspectorController39setResourcesDataSizeLimitsFromInternalsEii;
-_ZN7WebCore20CachedResourceLoader31garbageCollectDocumentResourcesEv;
+_ZN7WebCore21InspectorConsoleAgent28consoleMessageArgumentCountsEv;
+_ZN7WebCore22instrumentationForPageEPNS_4PageE;
 _ZN7WebCore20NodeRenderingContextC1EPNS_4NodeE;
 _ZN7WebCore20NodeRenderingContextD1Ev;
-_ZN7WebCore21InspectorConsoleAgent28consoleMessageArgumentCountsEv;
 _ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE;
 _ZN7WebCore22externalRepresentationEPNS_7ElementEj;
-_ZN7WebCore22instrumentationForPageEPNS_4PageE;
 _ZN7WebCore22userPreferredLanguagesEv;
 _ZN7WebCore24ComposedShadowTreeWalker10firstChildEv;
 _ZN7WebCore24ComposedShadowTreeWalker11nextSiblingEv;