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

Unified Diff: third_party/WebKit/Source/core/html/parser/TextResourceDecoder.h

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/html/parser/TextResourceDecoder.h
diff --git a/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.h b/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.h
index e7d831082de349028c026b5658207cab5be78094..82411a707fd1ef085cb910d83d2ef7371f2fdc80 100644
--- a/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.h
+++ b/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.h
@@ -24,9 +24,7 @@
#define TextResourceDecoder_h
#include "core/CoreExport.h"
-#include "wtf/PtrUtil.h"
#include "wtf/text/TextEncoding.h"
-#include <memory>
namespace blink {
@@ -47,15 +45,15 @@ public:
EncodingFromParentFrame
};
- static std::unique_ptr<TextResourceDecoder> create(const String& mimeType, const WTF::TextEncoding& defaultEncoding = WTF::TextEncoding(), bool usesEncodingDetector = false)
+ static PassOwnPtr<TextResourceDecoder> create(const String& mimeType, const WTF::TextEncoding& defaultEncoding = WTF::TextEncoding(), bool usesEncodingDetector = false)
{
- return wrapUnique(new TextResourceDecoder(mimeType, defaultEncoding, usesEncodingDetector ? UseAllAutoDetection : UseContentAndBOMBasedDetection));
+ return adoptPtr(new TextResourceDecoder(mimeType, defaultEncoding, usesEncodingDetector ? UseAllAutoDetection : UseContentAndBOMBasedDetection));
}
// Corresponds to utf-8 decode in Encoding spec:
// https://encoding.spec.whatwg.org/#utf-8-decode.
- static std::unique_ptr<TextResourceDecoder> createAlwaysUseUTF8ForText()
+ static PassOwnPtr<TextResourceDecoder> createAlwaysUseUTF8ForText()
{
- return wrapUnique(new TextResourceDecoder("plain/text", UTF8Encoding(), AlwaysUseUTF8ForText));
+ return adoptPtr(new TextResourceDecoder("plain/text", UTF8Encoding(), AlwaysUseUTF8ForText));
}
~TextResourceDecoder();
@@ -114,7 +112,7 @@ private:
ContentType m_contentType;
WTF::TextEncoding m_encoding;
- std::unique_ptr<TextCodec> m_codec;
+ OwnPtr<TextCodec> m_codec;
EncodingSource m_source;
const char* m_hintEncoding;
Vector<char> m_buffer;
@@ -126,7 +124,7 @@ private:
bool m_sawError;
EncodingDetectionOption m_encodingDetectionOption;
- std::unique_ptr<HTMLMetaCharsetParser> m_charsetParser;
+ OwnPtr<HTMLMetaCharsetParser> m_charsetParser;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698