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

Unified Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from Kent; merge. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index 3104ef644f480bd863dbb5330586ba7e67672aef..35725351cbda6d3badfee469c05762859e24b207 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -77,6 +77,7 @@
#include "wtf/Assertions.h"
#include "wtf/StdLibExtras.h"
#include "wtf/text/CString.h"
+#include <memory>
namespace blink {
@@ -334,7 +335,7 @@ Blob* XMLHttpRequest::responseBlob()
// copying the bytes between the browser and the renderer.
m_responseBlob = Blob::create(createBlobDataHandleFromResponse());
} else {
- OwnPtr<BlobData> blobData = BlobData::create();
+ std::unique_ptr<BlobData> blobData = BlobData::create();
size_t size = 0;
if (m_binaryResponseBuilder && m_binaryResponseBuilder->size()) {
size = m_binaryResponseBuilder->size();
@@ -1023,7 +1024,7 @@ bool XMLHttpRequest::internalAbort()
// If, window.onload contains open() and send(), m_loader will be set to
// non 0 value. So, we cannot continue the outer open(). In such case,
// just abort the outer open() by returning false.
- OwnPtr<ThreadableLoader> loader = std::move(m_loader);
+ std::unique_ptr<ThreadableLoader> loader = std::move(m_loader);
loader->cancel();
// If abort() called internalAbort() and a nested open() ended up
@@ -1436,7 +1437,7 @@ void XMLHttpRequest::didFailLoadingFromBlob()
PassRefPtr<BlobDataHandle> XMLHttpRequest::createBlobDataHandleFromResponse()
{
ASSERT(m_downloadingToFile);
- OwnPtr<BlobData> blobData = BlobData::create();
+ std::unique_ptr<BlobData> blobData = BlobData::create();
String filePath = m_response.downloadedFilePath();
// If we errored out or got no data, we return an empty handle.
if (!filePath.isEmpty() && m_lengthDownloadedToFile) {
@@ -1509,7 +1510,7 @@ void XMLHttpRequest::didSendData(unsigned long long bytesSent, unsigned long lon
}
}
-void XMLHttpRequest::didReceiveResponse(unsigned long identifier, const ResourceResponse& response, PassOwnPtr<WebDataConsumerHandle> handle)
+void XMLHttpRequest::didReceiveResponse(unsigned long identifier, const ResourceResponse& response, std::unique_ptr<WebDataConsumerHandle> handle)
{
ASSERT_UNUSED(handle, !handle);
WTF_LOG(Network, "XMLHttpRequest %p didReceiveResponse(%lu)", this, identifier);
@@ -1544,7 +1545,7 @@ void XMLHttpRequest::parseDocumentChunk(const char* data, unsigned len)
m_responseDocumentParser->appendBytes(data, len);
}
-PassOwnPtr<TextResourceDecoder> XMLHttpRequest::createDecoder() const
+std::unique_ptr<TextResourceDecoder> XMLHttpRequest::createDecoder() const
{
if (m_responseTypeCode == ResponseTypeJSON)
return TextResourceDecoder::create("application/json", "UTF-8");
@@ -1554,7 +1555,7 @@ PassOwnPtr<TextResourceDecoder> XMLHttpRequest::createDecoder() const
// allow TextResourceDecoder to look inside the m_response if it's XML or HTML
if (responseIsXML()) {
- OwnPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
+ std::unique_ptr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
// Don't stop on encoding errors, unlike it is done for other kinds
// of XML resources. This matches the behavior of previous WebKit
// versions, Firefox and Opera.

Powered by Google App Engine
This is Rietveld 408576698