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

Unified Diff: third_party/WebKit/Source/platform/text/hyphenation/HyphenationMinikin.h

Issue 2713553007: Merge 2987: Fix hyphenated words not to overflow on Android (Closed)
Patch Set: Created 3 years, 10 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/HyphenationMinikin.h
diff --git a/third_party/WebKit/Source/platform/text/hyphenation/HyphenationMinikin.h b/third_party/WebKit/Source/platform/text/hyphenation/HyphenationMinikin.h
new file mode 100644
index 0000000000000000000000000000000000000000..1f61b43087e147942b0f0666e9ddbad79c585513
--- /dev/null
+++ b/third_party/WebKit/Source/platform/text/hyphenation/HyphenationMinikin.h
@@ -0,0 +1,39 @@
+// Copyright 2017 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.
+
+#include "platform/text/Hyphenation.h"
+
+#include "base/files/memory_mapped_file.h"
+#include "platform/PlatformExport.h"
+
+namespace base {
+class File;
+} // namespace base
+
+namespace android {
+class Hyphenator;
+} // namespace andorid
+
+namespace blink {
+
+class PLATFORM_EXPORT HyphenationMinikin : public Hyphenation {
+ public:
+ bool openDictionary(const AtomicString& locale);
+
+ size_t lastHyphenLocation(const StringView& text,
+ size_t beforeIndex) const override;
+ Vector<size_t, 8> hyphenLocations(const StringView&) const override;
+
+ static PassRefPtr<HyphenationMinikin> fromFileForTesting(base::File);
+
+ private:
+ bool openDictionary(base::File);
+
+ std::vector<uint8_t> hyphenate(const StringView&) const;
+
+ base::MemoryMappedFile m_file;
+ std::unique_ptr<android::Hyphenator> m_hyphenator;
+};
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698