[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

darin at apple.com darin at apple.com
Wed Dec 22 12:52:11 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit eab5521d513e55ab6a2dc0346d18a99b6afa1adb
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 31 21:39:26 2010 +0000

    2010-08-31  Darin Adler  <darin at apple.com>
    
            Reviewed by Anders Carlsson.
    
            Web archives are created with a size of 0 due to PassRefPtr mistake
            https://bugs.webkit.org/show_bug.cgi?id=44984
            rdar://problem/8042283
    
            * loader/archive/ArchiveResource.cpp:
            (WebCore::ArchiveResource::ArchiveResource): Merge the three constructors into one.
            (WebCore::ArchiveResource::create): Merge the two create functions into one, and
            fix the logic so there is no use of a PassRefPtr after it has been passed.
            * loader/archive/ArchiveResource.h: Use default arguments instead of overloading
            to cut down from three create functions to two. Remove two of the constructors.
    2010-08-31  Darin Adler  <darin at apple.com>
    
            Reviewed by Anders Carlsson.
    
            Web archives are created with a size of 0 due to PassRefPtr mistake
            https://bugs.webkit.org/show_bug.cgi?id=44984
            rdar://problem/8042283
    
            * webarchive/test-link-rel-icon-expected.webarchive: Expect a correct size, not 0.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66539 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 0ae743f..1db26dc 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-31  Darin Adler  <darin at apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Web archives are created with a size of 0 due to PassRefPtr mistake
+        https://bugs.webkit.org/show_bug.cgi?id=44984
+        rdar://problem/8042283
+
+        * webarchive/test-link-rel-icon-expected.webarchive: Expect a correct size, not 0.
+
 2010-08-31  Jian Li  <jianli at chromium.org>
 
         Reviewed by David Levin.
diff --git a/LayoutTests/webarchive/test-link-rel-icon-expected.webarchive b/LayoutTests/webarchive/test-link-rel-icon-expected.webarchive
index e023e53..5780282 100644
--- a/LayoutTests/webarchive/test-link-rel-icon-expected.webarchive
+++ b/LayoutTests/webarchive/test-link-rel-icon-expected.webarchive
@@ -76,7 +76,7 @@ function runTest()
 				<key>URL</key>
 				<string>file:///LayoutTests/webarchive/resources/favicon.ico</string>
 				<key>expectedContentLength</key>
-				<integer>0</integer>
+				<integer>1150</integer>
 				<key>textEncodingName</key>
 				<string></string>
 			</dict>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 20ec293..ab888e4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-08-31  Darin Adler  <darin at apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Web archives are created with a size of 0 due to PassRefPtr mistake
+        https://bugs.webkit.org/show_bug.cgi?id=44984
+        rdar://problem/8042283
+
+        * loader/archive/ArchiveResource.cpp:
+        (WebCore::ArchiveResource::ArchiveResource): Merge the three constructors into one.
+        (WebCore::ArchiveResource::create): Merge the two create functions into one, and
+        fix the logic so there is no use of a PassRefPtr after it has been passed.
+        * loader/archive/ArchiveResource.h: Use default arguments instead of overloading
+        to cut down from three create functions to two. Remove two of the constructors.
+
 2010-08-31  Jian Li  <jianli at chromium.org>
 
         Reviewed by David Levin.
diff --git a/WebCore/loader/archive/ArchiveResource.cpp b/WebCore/loader/archive/ArchiveResource.cpp
index 691f66a..7dedc93 100644
--- a/WebCore/loader/archive/ArchiveResource.cpp
+++ b/WebCore/loader/archive/ArchiveResource.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,31 +33,8 @@
 
 namespace WebCore {
 
-PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const ResourceResponse& response)
-{
-    return data ? adoptRef(new ArchiveResource(data, url, response)) : 0;
-}
-
-PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName)
-{
-    return data ? adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName)) : 0;
-}
-
-PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& resourceResponse)
-{
-    return data ? adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName, resourceResponse)) : 0;
-}
-
-ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const ResourceResponse& response)
+inline ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& response)
     : SubstituteResource(url, response, data)
-    , m_mimeType(response.mimeType())
-    , m_textEncoding(response.textEncodingName())
-    , m_shouldIgnoreWhenUnarchiving(false)
-{
-}
-
-ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName)
-    : SubstituteResource(url, ResourceResponse(url, mimeType, data ? data->size() : 0, textEncoding, String()), data)
     , m_mimeType(mimeType)
     , m_textEncoding(textEncoding)
     , m_frameName(frameName)
@@ -65,13 +42,21 @@ ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url,
 {
 }
 
-ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& response)
-    : SubstituteResource(url, response.isNull() ? ResourceResponse(url, mimeType, data ? data->size() : 0, textEncoding, String()) : response, data)
-    , m_mimeType(mimeType)
-    , m_textEncoding(textEncoding)
-    , m_frameName(frameName)
-    , m_shouldIgnoreWhenUnarchiving(false)
+PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& response)
+{
+    if (!data)
+        return 0;
+    if (response.isNull()) {
+        unsigned dataSize = data->size();
+        return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName,
+            ResourceResponse(url, mimeType, dataSize, textEncoding, String())));
+    }
+    return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName, response));
+}
+
+PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const ResourceResponse& response)
 {
+    return create(data, url, response.mimeType(), response.textEncodingName(), String(), response);
 }
 
 }
diff --git a/WebCore/loader/archive/ArchiveResource.h b/WebCore/loader/archive/ArchiveResource.h
index d975e04..97d6e32 100644
--- a/WebCore/loader/archive/ArchiveResource.h
+++ b/WebCore/loader/archive/ArchiveResource.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -31,32 +31,29 @@
 
 #include "SubstituteResource.h"
 
-#include "PlatformString.h"
-
 namespace WebCore {
 
 class ArchiveResource : public SubstituteResource {
 public:
     static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&, const ResourceResponse&);
-    static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName);
-    static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse&);
-    
+    static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&,
+        const String& mimeType, const String& textEncoding, const String& frameName,
+        const ResourceResponse& = ResourceResponse());
+
     const String& mimeType() const { return m_mimeType; }
     const String& textEncoding() const { return m_textEncoding; }
     const String& frameName() const { return m_frameName; }
-    
+
     void ignoreWhenUnarchiving() { m_shouldIgnoreWhenUnarchiving = true; }
     bool shouldIgnoreWhenUnarchiving() const { return m_shouldIgnoreWhenUnarchiving; }
 
 private:
-    ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const ResourceResponse&);
-    ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName);
     ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse&);
-    
+
     String m_mimeType;
     String m_textEncoding;
     String m_frameName;
-    
+
     bool m_shouldIgnoreWhenUnarchiving;
 };
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list