HTTPHeaderMap should not derive from HashMap
[WebKit-https.git] / Source / WebCore / platform / network / ResourceResponseBase.cpp
index 118949a..cb9af24 100644 (file)
@@ -105,8 +105,8 @@ PassOwnPtr<ResourceResponse> ResourceResponseBase::adopt(PassOwnPtr<CrossThreadR
     response->setHTTPStatusText(data->m_httpStatusText);
 
     response->lazyInit(CommonAndUncommonFields);
-    response->m_httpHeaderFields.adopt(data->m_httpHeaders.release());
-    response->setResourceLoadTiming(data->m_resourceLoadTiming.release());
+    response->m_httpHeaderFields.adopt(std::move(data->m_httpHeaders));
+    response->setResourceLoadTiming(data->m_resourceLoadTiming);
     response->doPlatformAdopt(data);
     return response.release();
 }
@@ -122,8 +122,7 @@ PassOwnPtr<CrossThreadResourceResponseData> ResourceResponseBase::copyData() con
     data->m_httpStatusCode = httpStatusCode();
     data->m_httpStatusText = httpStatusText().isolatedCopy();
     data->m_httpHeaders = httpHeaderFields().copyData();
-    if (m_resourceLoadTiming)
-        data->m_resourceLoadTiming = m_resourceLoadTiming->deepCopy();
+    data->m_resourceLoadTiming = m_resourceLoadTiming;
     return asResourceResponse().doPlatformCopyData(data.release());
 }
 
@@ -326,7 +325,7 @@ void ResourceResponseBase::addHTTPHeaderField(const AtomicString& name, const St
 
     HTTPHeaderMap::AddResult result = m_httpHeaderFields.add(name, value);
     if (!result.isNewEntry)
-        result.iterator->value.append(", " + value);
+        result.iterator->value = result.iterator->value + ", " + value;
 }
 
 const HTTPHeaderMap& ResourceResponseBase::httpHeaderFields() const
@@ -551,14 +550,14 @@ void ResourceResponseBase::setConnectionID(unsigned connectionID)
     m_connectionID = connectionID;
 }
 
-ResourceLoadTiming* ResourceResponseBase::resourceLoadTiming() const
+ResourceLoadTiming& ResourceResponseBase::resourceLoadTiming() const
 {
     lazyInit(CommonAndUncommonFields);
 
-    return m_resourceLoadTiming.get();
+    return m_resourceLoadTiming;
 }
 
-void ResourceResponseBase::setResourceLoadTiming(PassRefPtr<ResourceLoadTiming> resourceLoadTiming)
+void ResourceResponseBase::setResourceLoadTiming(const ResourceLoadTiming& resourceLoadTiming)
 {
     lazyInit(CommonAndUncommonFields);
 
@@ -590,8 +589,6 @@ bool ResourceResponseBase::compare(const ResourceResponse& a, const ResourceResp
         return false;
     if (a.httpHeaderFields() != b.httpHeaderFields())
         return false;
-    if (a.resourceLoadTiming() && b.resourceLoadTiming() && *a.resourceLoadTiming() == *b.resourceLoadTiming())
-        return ResourceResponse::platformCompare(a, b);
     if (a.resourceLoadTiming() != b.resourceLoadTiming())
         return false;
     return ResourceResponse::platformCompare(a, b);