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

Unified Diff: third_party/WebKit/Source/platform/text/Hyphenation.h

Issue 1917423002: Add Hyphenation class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix Created 4 years, 8 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/platform/text/Hyphenation.h
diff --git a/third_party/WebKit/Source/platform/text/Hyphenation.h b/third_party/WebKit/Source/platform/text/Hyphenation.h
new file mode 100644
index 0000000000000000000000000000000000000000..95d1e4c980249242ce58f58cd9e0dc11ed03bd8a
--- /dev/null
+++ b/third_party/WebKit/Source/platform/text/Hyphenation.h
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef Hyphenation_h
+#define Hyphenation_h
+
+#include "platform/PlatformExport.h"
+#include "wtf/Forward.h"
+#include "wtf/HashMap.h"
+#include "wtf/RefCounted.h"
+#include "wtf/text/AtomicStringHash.h"
+#include "wtf/text/StringHash.h"
+
+namespace blink {
+
+class StringView;
+
+class PLATFORM_EXPORT Hyphenation : public RefCounted<Hyphenation> {
+public:
+ virtual ~Hyphenation() {}
+
+ static Hyphenation* get(const AtomicString& locale);
+
+ virtual size_t lastHyphenLocation(const StringView&, size_t beforeIndex, const AtomicString& locale) const = 0;
+
+ static void setForTesting(const AtomicString& locale, PassRefPtr<Hyphenation>);
+ static void clearForTesting();
+
+private:
+ using HyphenationMap = HashMap<AtomicString, RefPtr<Hyphenation>, CaseFoldingHash>;
+
+ static HyphenationMap& getHyphenationMap();
+ static PassRefPtr<Hyphenation> platformGetHyphenation(const AtomicString& locale);
+};
+
+} // namespace blink
+
+#endif // Hyphenation_h
« no previous file with comments | « third_party/WebKit/Source/platform/blink_platform.gypi ('k') | third_party/WebKit/Source/platform/text/Hyphenation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698