Only track resource identifiers in DRT when dumpResourceLoadCallbacks is on
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Nov 2010 15:36:52 +0000 (15:36 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Nov 2010 15:36:52 +0000 (15:36 +0000)
This reverts Windows to our pre-r71097 behavior. That patch made us
track all resource identifiers, including the main resource, so the
main resource's URL started appearing in test output instead of
"<unknown>". Arguably having the main resource's URL is better, but all
other platforms print "<unknown>" and we want to match.

Fixes <http://webkit.org/b/48837> <rdar://problem/8620351> REGRESSION
(r71097): Many http tests failing on Windows

Reviewed by Anders Carlsson.

* DumpRenderTree/win/ResourceLoadDelegate.cpp:
(ResourceLoadDelegate::identifierForInitialRequest): Don't add the
identifier to the URL map if we're not supposed to dump resource load
callbacks.
(ResourceLoadDelegate::removeIdentifierForRequest): Always remove the
identifier from the URL map even if we're already "done". There's no
point in keeping out-of-date identifiers around.

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp

index 0413cda..ff821ab 100644 (file)
@@ -1,3 +1,27 @@
+2010-11-02  Adam Roben  <aroben@apple.com>
+
+        Only track resource identifiers in DRT when dumpResourceLoadCallbacks
+        is on
+
+        This reverts Windows to our pre-r71097 behavior. That patch made us
+        track all resource identifiers, including the main resource, so the
+        main resource's URL started appearing in test output instead of
+        "<unknown>". Arguably having the main resource's URL is better, but all
+        other platforms print "<unknown>" and we want to match.
+
+        Fixes <http://webkit.org/b/48837> <rdar://problem/8620351> REGRESSION
+        (r71097): Many http tests failing on Windows
+
+        Reviewed by Anders Carlsson.
+
+        * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+        (ResourceLoadDelegate::identifierForInitialRequest): Don't add the
+        identifier to the URL map if we're not supposed to dump resource load
+        callbacks.
+        (ResourceLoadDelegate::removeIdentifierForRequest): Always remove the
+        identifier from the URL map even if we're already "done". There's no
+        point in keeping out-of-date identifiers around.
+
 2010-11-01  Jenn Braithwaite  <jennb@chromium.org>
 
         Reviewed by Adam Roben.
index cf17987..09b07d6 100644 (file)
@@ -216,7 +216,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::identifierForInitialRequest(
     /* [in] */ IWebDataSource* dataSource,
     /* [in] */ unsigned long identifier)
 { 
-    if (!done) {
+    if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
         BSTR urlStr;
         if (FAILED(request->URL(&urlStr)))
             return E_FAIL;
@@ -232,10 +232,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::removeIdentifierForRequest(
     /* [in] */ IWebView* webView,
     /* [in] */ unsigned long identifier)
 {
-    if (!done) {
-        ASSERT(urlMap().contains(identifier));
-        urlMap().remove(identifier);
-    }
+    urlMap().remove(identifier);
 
     return S_OK;
 }