Title: [124682] trunk/Source/WebCore
Revision
124682
Author
micha...@google.com
Date
2012-08-03 18:28:22 -0700 (Fri, 03 Aug 2012)

Log Message

[Chromium] Cross-thread-copy a couple more recently added ResourceResponse data members, apparently
these got missed when they were added. And fix a bug with how the m_remoteIPAddress
data member is handled, an isolatedCopy() is needed for thread safety.
https://bugs.webkit.org/show_bug.cgi?id=93158

Reviewed by David Levin.

No new tests, minor cleanup.

* platform/network/chromium/ResourceResponse.cpp:
(WebCore::ResourceResponse::doPlatformCopyData): make deep copies
(WebCore::ResourceResponse::doPlatformAdopt): take ownership of them
* platform/network/chromium/ResourceResponse.h:
(ResourceResponse):
(CrossThreadResourceResponseData):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124681 => 124682)


--- trunk/Source/WebCore/ChangeLog	2012-08-04 01:23:58 UTC (rev 124681)
+++ trunk/Source/WebCore/ChangeLog	2012-08-04 01:28:22 UTC (rev 124682)
@@ -1,3 +1,21 @@
+2012-08-03  Michael Nordman  <micha...@google.com>
+
+        [Chromium] Cross-thread-copy a couple more recently added ResourceResponse data members, apparently
+        these got missed when they were added. And fix a bug with how the m_remoteIPAddress
+        data member is handled, an isolatedCopy() is needed for thread safety.
+        https://bugs.webkit.org/show_bug.cgi?id=93158
+
+        Reviewed by David Levin.
+
+        No new tests, minor cleanup.
+
+        * platform/network/chromium/ResourceResponse.cpp:
+        (WebCore::ResourceResponse::doPlatformCopyData): make deep copies
+        (WebCore::ResourceResponse::doPlatformAdopt): take ownership of them
+        * platform/network/chromium/ResourceResponse.h:
+        (ResourceResponse):
+        (CrossThreadResourceResponseData):
+
 2012-08-03  Florin Malita  <fmal...@chromium.org>
 
         [SVG] Tref target event listener cleanup

Modified: trunk/Source/WebCore/platform/network/chromium/ResourceResponse.cpp (124681 => 124682)


--- trunk/Source/WebCore/platform/network/chromium/ResourceResponse.cpp	2012-08-04 01:23:58 UTC (rev 124681)
+++ trunk/Source/WebCore/platform/network/chromium/ResourceResponse.cpp	2012-08-04 01:28:22 UTC (rev 124682)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Google, Inc.
+ * Copyright (C) 2012 Google, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -30,6 +30,8 @@
 
 PassOwnPtr<CrossThreadResourceResponseData> ResourceResponse::doPlatformCopyData(PassOwnPtr<CrossThreadResourceResponseData> data) const
 {
+    data->m_securityInfo = CString(m_securityInfo.data(), m_securityInfo.length());
+    data->m_httpVersion = m_httpVersion;
     data->m_appCacheID = m_appCacheID;
     data->m_appCacheManifestURL = m_appCacheManifestURL.copy();
     data->m_isMultipartPayload = m_isMultipartPayload;
@@ -38,14 +40,17 @@
     data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable;
     data->m_wasFetchedViaProxy = m_wasFetchedViaProxy;
     data->m_responseTime = m_responseTime;
-    data->m_remoteIPAddress = m_remoteIPAddress;
+    data->m_remoteIPAddress = m_remoteIPAddress.isolatedCopy();
     data->m_remotePort = m_remotePort;
-    // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support m_downloadedFile.
+    // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support m_downloadedFile,
+    // or whatever values may be present in the opaque m_extraData structure.
     return data;
 }
 
 void ResourceResponse::doPlatformAdopt(PassOwnPtr<CrossThreadResourceResponseData> data)
 {
+    m_securityInfo = data->m_securityInfo;
+    m_httpVersion = data->m_httpVersion;
     m_appCacheID = data->m_appCacheID;
     m_appCacheManifestURL = data->m_appCacheManifestURL.copy();
     m_isMultipartPayload = data->m_isMultipartPayload;
@@ -56,7 +61,8 @@
     m_responseTime = data->m_responseTime;
     m_remoteIPAddress = data->m_remoteIPAddress;
     m_remotePort = data->m_remotePort;
-    // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support m_downloadedFile.
+    // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support m_downloadedFile,
+    // or whatever values may be present in the opaque m_extraData structure.
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/network/chromium/ResourceResponse.h (124681 => 124682)


--- trunk/Source/WebCore/platform/network/chromium/ResourceResponse.h	2012-08-04 01:23:58 UTC (rev 124681)
+++ trunk/Source/WebCore/platform/network/chromium/ResourceResponse.h	2012-08-04 01:28:22 UTC (rev 124682)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2008 Google, Inc.
+ * Copyright (C) 2012 Google, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -123,11 +123,6 @@
     private:
         friend class ResourceResponseBase;
 
-        // An opaque value that contains some information regarding the security of
-        // the connection for this request, such as SSL connection info (empty
-        // string if not over HTTPS).
-        CString m_securityInfo;
-
         void doUpdateResourceResponse()
         {
             notImplemented();
@@ -136,6 +131,11 @@
         PassOwnPtr<CrossThreadResourceResponseData> doPlatformCopyData(PassOwnPtr<CrossThreadResourceResponseData>) const;
         void doPlatformAdopt(PassOwnPtr<CrossThreadResourceResponseData>);
 
+        // An opaque value that contains some information regarding the security of
+        // the connection for this request, such as SSL connection info (empty
+        // string if not over HTTPS).
+        CString m_securityInfo;
+
         // HTTP version used in the response, if known.
         HTTPVersion m_httpVersion;
 
@@ -181,6 +181,8 @@
     };
 
     struct CrossThreadResourceResponseData : public CrossThreadResourceResponseDataBase {
+        CString m_securityInfo;
+        ResourceResponse::HTTPVersion m_httpVersion;
         long long m_appCacheID;
         KURL m_appCacheManifestURL;
         bool m_isMultipartPayload;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to