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

Unified Diff: third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h

Issue 1436153002: Apply clang-format with Chromium-style without column limit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/wtf/text/StringUTF8Adaptor.h
diff --git a/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h b/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
index 567bb995d67b9eda9f0bc6849e168c447299dfba..a1892fcea865656a6011556dd03d3888cd50909a 100644
--- a/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
+++ b/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
@@ -41,38 +41,36 @@ namespace WTF {
// separate buffer to hold the data if the String happens to be 8 bit and
// contain only ASCII characters.
class StringUTF8Adaptor {
-public:
- explicit StringUTF8Adaptor(const String& string)
- : m_data(0)
- , m_length(0)
- {
- if (string.isEmpty())
- return;
- // Unfortunately, 8 bit WTFStrings are encoded in Latin-1 and GURL uses UTF-8
- // when processing 8 bit strings. If |relative| is entirely ASCII, we luck out
- // and can avoid mallocing a new buffer to hold the UTF-8 data because UTF-8
- // and Latin-1 use the same code units for ASCII code points.
- if (string.is8Bit() && string.containsOnlyASCII()) {
- m_data = reinterpret_cast<const char*>(string.characters8());
- m_length = string.length();
- } else {
- m_utf8Buffer = string.utf8();
- m_data = m_utf8Buffer.data();
- m_length = m_utf8Buffer.length();
- }
+ public:
+ explicit StringUTF8Adaptor(const String& string)
+ : m_data(0), m_length(0) {
+ if (string.isEmpty())
+ return;
+ // Unfortunately, 8 bit WTFStrings are encoded in Latin-1 and GURL uses UTF-8
+ // when processing 8 bit strings. If |relative| is entirely ASCII, we luck out
+ // and can avoid mallocing a new buffer to hold the UTF-8 data because UTF-8
+ // and Latin-1 use the same code units for ASCII code points.
+ if (string.is8Bit() && string.containsOnlyASCII()) {
+ m_data = reinterpret_cast<const char*>(string.characters8());
+ m_length = string.length();
+ } else {
+ m_utf8Buffer = string.utf8();
+ m_data = m_utf8Buffer.data();
+ m_length = m_utf8Buffer.length();
}
+ }
- const char* data() const { return m_data; }
- size_t length() const { return m_length; }
+ const char* data() const { return m_data; }
+ size_t length() const { return m_length; }
-private:
- CString m_utf8Buffer;
- const char* m_data;
- size_t m_length;
+ private:
+ CString m_utf8Buffer;
+ const char* m_data;
+ size_t m_length;
};
-} // namespace WTF
+} // namespace WTF
using WTF::StringUTF8Adaptor;
-#endif // StringUTF8Adaptor_h
+#endif // StringUTF8Adaptor_h
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringStatics.cpp ('k') | third_party/WebKit/Source/wtf/text/StringView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698