Commit a266e4d0 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Remove unused include of generator source file in production code.

The relevant header is renamed to not imply that it's part of the
generator only, and added as a source of both the generator and of
the platform component.

Some mild renaming included, but optional.

This resolves a gn check failure in //third_party/blink/renderer/platform.

Change-Id: Ic7b3f7c7e70307cea99fa7cbdd9787484f9a0122
Reviewed-on: https://chromium-review.googlesource.com/c/1329841Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607584}
parent a332fd8b
......@@ -120,8 +120,8 @@ action("instrumentation_probes") {
executable("character_data_generator") {
sources = [
"text/character_property_data.h",
"text/character_property_data_generator.cc",
"text/character_property_data_generator.h",
]
configs += [ "//third_party/blink/renderer:config" ]
deps = [
......@@ -1272,6 +1272,7 @@ jumbo_component("platform") {
"text/character.h",
"text/character_emoji.cc",
"text/character_property.h",
"text/character_property_data.h",
"text/date_time_format.cc",
"text/date_time_format.h",
"text/decode_escape_sequences.h",
......
......@@ -33,13 +33,13 @@
#include <unicode/uobject.h>
#include <unicode/uscript.h>
#include <algorithm>
#include "third_party/blink/renderer/platform/text/character_property_data.h"
#include "third_party/blink/renderer/platform/text/icu_error.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#if defined(USING_SYSTEM_ICU)
#include <unicode/uniset.h>
#include "third_party/blink/renderer/platform/text/character_property_data_generator.h"
#else
#define MUTEX_H // Prevent compile failure of utrie2.h on Windows
#include <utrie2.h>
......@@ -71,10 +71,6 @@ static icu::UnicodeSet* createUnicodeSet(const UChar32* characters,
unicodeSet = CREATE_UNICODE_SET(name); \
return unicodeSet->contains(c);
#else
// Freezed trie tree, see CharacterDataGenerator.cpp.
extern const int32_t kSerializedCharacterDataSize;
extern const uint8_t kSerializedCharacterData[];
static UTrie2* CreateTrie() {
// Create a Trie from the value array.
ICUError error;
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_CHARACTER_PROPERTY_DATA_GENERATOR_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_CHARACTER_PROPERTY_DATA_GENERATOR_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_CHARACTER_PROPERTY_DATA_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_CHARACTER_PROPERTY_DATA_H_
#include <unicode/uobject.h>
......@@ -249,6 +249,12 @@ static const UChar32 kIsHangulRanges[] = {
static const UChar32 kIsHangulArray[] = {};
#if !defined(USING_SYSTEM_ICU)
// Freezed trie tree, see character_property_data_generator.cc.
extern const int32_t kSerializedCharacterDataSize;
extern const uint8_t kSerializedCharacterData[];
#endif
} // namespace blink
#endif
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/platform/text/character_property_data_generator.h"
#include "third_party/blink/renderer/platform/text/character_property_data.h"
#include <stdio.h>
#include <cassert>
......@@ -15,9 +15,10 @@
#endif
namespace blink {
namespace {
#if defined(USING_SYSTEM_ICU)
static void Generate(FILE*) {}
static void GenerateCharacterPropertyData(FILE*) {}
#else
const UChar32 kMaxCodepoint = 0x10FFFF;
......@@ -66,7 +67,7 @@ static void GenerateUTrieSerialized(FILE* fp, int32_t size, uint8_t* array) {
"} // namespace blink\n");
}
static void Generate(FILE* fp) {
static void GenerateCharacterPropertyData(FILE* fp) {
// Create a value array of all possible code points.
const UChar32 kSize = kMaxCodepoint + 1;
std::unique_ptr<CharacterProperty[]> values(new CharacterProperty[kSize]);
......@@ -120,15 +121,16 @@ static void Generate(FILE* fp) {
}
#endif
} // namespace
} // namespace blink
int main(int argc, char** argv) {
// Write the serialized array to the source file.
if (argc <= 1) {
blink::Generate(stdout);
blink::GenerateCharacterPropertyData(stdout);
} else {
FILE* fp = fopen(argv[1], "wb");
blink::Generate(fp);
blink::GenerateCharacterPropertyData(fp);
fclose(fp);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment