Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: third_party/WebKit/Source/platform/network/ResourceResponse.cpp

Issue 1983793002: Remove OwnPtr::release() calls in platform/ (part 2). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add one more file. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 { 104 {
105 setURL(data->m_url); 105 setURL(data->m_url);
106 setMimeType(AtomicString(data->m_mimeType)); 106 setMimeType(AtomicString(data->m_mimeType));
107 setExpectedContentLength(data->m_expectedContentLength); 107 setExpectedContentLength(data->m_expectedContentLength);
108 setTextEncodingName(AtomicString(data->m_textEncodingName)); 108 setTextEncodingName(AtomicString(data->m_textEncodingName));
109 setSuggestedFilename(data->m_suggestedFilename); 109 setSuggestedFilename(data->m_suggestedFilename);
110 110
111 setHTTPStatusCode(data->m_httpStatusCode); 111 setHTTPStatusCode(data->m_httpStatusCode);
112 setHTTPStatusText(AtomicString(data->m_httpStatusText)); 112 setHTTPStatusText(AtomicString(data->m_httpStatusText));
113 113
114 m_httpHeaderFields.adopt(data->m_httpHeaders.release()); 114 m_httpHeaderFields.adopt(std::move(data->m_httpHeaders));
115 setLastModifiedDate(data->m_lastModifiedDate); 115 setLastModifiedDate(data->m_lastModifiedDate);
116 setResourceLoadTiming(data->m_resourceLoadTiming.release()); 116 setResourceLoadTiming(data->m_resourceLoadTiming.release());
117 m_securityInfo = data->m_securityInfo; 117 m_securityInfo = data->m_securityInfo;
118 m_hasMajorCertificateErrors = data->m_hasMajorCertificateErrors; 118 m_hasMajorCertificateErrors = data->m_hasMajorCertificateErrors;
119 m_securityStyle = data->m_securityStyle; 119 m_securityStyle = data->m_securityStyle;
120 m_securityDetails.protocol = data->m_securityDetails.protocol; 120 m_securityDetails.protocol = data->m_securityDetails.protocol;
121 m_securityDetails.cipher = data->m_securityDetails.cipher; 121 m_securityDetails.cipher = data->m_securityDetails.cipher;
122 m_securityDetails.keyExchange = data->m_securityDetails.keyExchange; 122 m_securityDetails.keyExchange = data->m_securityDetails.keyExchange;
123 m_securityDetails.mac = data->m_securityDetails.mac; 123 m_securityDetails.mac = data->m_securityDetails.mac;
124 m_securityDetails.certID = data->m_securityDetails.certID; 124 m_securityDetails.certID = data->m_securityDetails.certID;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 data->m_cacheStorageCacheName = cacheStorageCacheName().isolatedCopy(); 188 data->m_cacheStorageCacheName = cacheStorageCacheName().isolatedCopy();
189 data->m_responseTime = m_responseTime; 189 data->m_responseTime = m_responseTime;
190 data->m_remoteIPAddress = m_remoteIPAddress.getString().isolatedCopy(); 190 data->m_remoteIPAddress = m_remoteIPAddress.getString().isolatedCopy();
191 data->m_remotePort = m_remotePort; 191 data->m_remotePort = m_remotePort;
192 data->m_downloadedFilePath = m_downloadedFilePath.isolatedCopy(); 192 data->m_downloadedFilePath = m_downloadedFilePath.isolatedCopy();
193 data->m_downloadedFileHandle = m_downloadedFileHandle; 193 data->m_downloadedFileHandle = m_downloadedFileHandle;
194 194
195 // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support 195 // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support
196 // whatever values may be present in the opaque m_extraData structure. 196 // whatever values may be present in the opaque m_extraData structure.
197 197
198 return data.release(); 198 return data;
199 } 199 }
200 200
201 bool ResourceResponse::isHTTP() const 201 bool ResourceResponse::isHTTP() const
202 { 202 {
203 return m_url.protocolIsInHTTPFamily(); 203 return m_url.protocolIsInHTTPFamily();
204 } 204 }
205 205
206 const KURL& ResourceResponse::url() const 206 const KURL& ResourceResponse::url() const
207 { 207 {
208 return m_url; 208 return m_url;
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 void ResourceResponse::setDownloadedFilePath(const String& downloadedFilePath) 538 void ResourceResponse::setDownloadedFilePath(const String& downloadedFilePath)
539 { 539 {
540 m_downloadedFilePath = downloadedFilePath; 540 m_downloadedFilePath = downloadedFilePath;
541 if (m_downloadedFilePath.isEmpty()) { 541 if (m_downloadedFilePath.isEmpty()) {
542 m_downloadedFileHandle.clear(); 542 m_downloadedFileHandle.clear();
543 return; 543 return;
544 } 544 }
545 OwnPtr<BlobData> blobData = BlobData::create(); 545 OwnPtr<BlobData> blobData = BlobData::create();
546 blobData->appendFile(m_downloadedFilePath); 546 blobData->appendFile(m_downloadedFilePath);
547 blobData->detachFromCurrentThread(); 547 blobData->detachFromCurrentThread();
548 m_downloadedFileHandle = BlobDataHandle::create(blobData.release(), -1); 548 m_downloadedFileHandle = BlobDataHandle::create(std::move(blobData), -1);
549 } 549 }
550 550
551 bool ResourceResponse::compare(const ResourceResponse& a, const ResourceResponse & b) 551 bool ResourceResponse::compare(const ResourceResponse& a, const ResourceResponse & b)
552 { 552 {
553 if (a.isNull() != b.isNull()) 553 if (a.isNull() != b.isNull())
554 return false; 554 return false;
555 if (a.url() != b.url()) 555 if (a.url() != b.url())
556 return false; 556 return false;
557 if (a.mimeType() != b.mimeType()) 557 if (a.mimeType() != b.mimeType())
558 return false; 558 return false;
(...skipping 10 matching lines...) Expand all
569 if (a.httpHeaderFields() != b.httpHeaderFields()) 569 if (a.httpHeaderFields() != b.httpHeaderFields())
570 return false; 570 return false;
571 if (a.resourceLoadTiming() && b.resourceLoadTiming() && *a.resourceLoadTimin g() == *b.resourceLoadTiming()) 571 if (a.resourceLoadTiming() && b.resourceLoadTiming() && *a.resourceLoadTimin g() == *b.resourceLoadTiming())
572 return true; 572 return true;
573 if (a.resourceLoadTiming() != b.resourceLoadTiming()) 573 if (a.resourceLoadTiming() != b.resourceLoadTiming())
574 return false; 574 return false;
575 return true; 575 return true;
576 } 576 }
577 577
578 } // namespace blink 578 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698