OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_FONT_SERVICE_PUBLIC_CPP_FONT_LOADER_H_ | 5 #ifndef COMPONENTS_FONT_SERVICE_PUBLIC_CPP_FONT_LOADER_H_ |
6 #define COMPONENTS_FONT_SERVICE_PUBLIC_CPP_FONT_LOADER_H_ | 6 #define COMPONENTS_FONT_SERVICE_PUBLIC_CPP_FONT_LOADER_H_ |
7 | 7 |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // also see the FontServiceThread class.) | 30 // also see the FontServiceThread class.) |
31 // | 31 // |
32 // This is the mojo equivalent to content/common/font_config_ipc_linux.h | 32 // This is the mojo equivalent to content/common/font_config_ipc_linux.h |
33 class FontLoader : public SkFontConfigInterface, | 33 class FontLoader : public SkFontConfigInterface, |
34 public internal::MappedFontFile::Observer { | 34 public internal::MappedFontFile::Observer { |
35 public: | 35 public: |
36 explicit FontLoader(mojo::Shell* shell); | 36 explicit FontLoader(mojo::Shell* shell); |
37 explicit FontLoader(mojo::ApplicationImpl* application_impl); | 37 explicit FontLoader(mojo::ApplicationImpl* application_impl); |
38 ~FontLoader() override; | 38 ~FontLoader() override; |
39 | 39 |
| 40 // Shuts down the background thread. |
| 41 void Shutdown(); |
| 42 |
40 // SkFontConfigInterface: | 43 // SkFontConfigInterface: |
41 bool matchFamilyName(const char family_name[], | 44 bool matchFamilyName(const char family_name[], |
42 SkTypeface::Style requested, | 45 SkTypeface::Style requested, |
43 FontIdentity* out_font_identifier, | 46 FontIdentity* out_font_identifier, |
44 SkString* out_family_name, | 47 SkString* out_family_name, |
45 SkTypeface::Style* out_style) override; | 48 SkTypeface::Style* out_style) override; |
46 SkStreamAsset* openStream(const FontIdentity& identity) override; | 49 SkStreamAsset* openStream(const FontIdentity& identity) override; |
47 | 50 |
48 private: | 51 private: |
49 // internal::MappedFontFile::Observer: | 52 // internal::MappedFontFile::Observer: |
(...skipping 10 matching lines...) Expand all Loading... |
60 | 63 |
61 // Maps font identity ID to the memory-mapped file with font data. | 64 // Maps font identity ID to the memory-mapped file with font data. |
62 base::hash_map<uint32_t, internal::MappedFontFile*> mapped_font_files_; | 65 base::hash_map<uint32_t, internal::MappedFontFile*> mapped_font_files_; |
63 | 66 |
64 DISALLOW_COPY_AND_ASSIGN(FontLoader); | 67 DISALLOW_COPY_AND_ASSIGN(FontLoader); |
65 }; | 68 }; |
66 | 69 |
67 } // namespace font_service | 70 } // namespace font_service |
68 | 71 |
69 #endif // COMPONENTS_FONT_SERVICE_PUBLIC_CPP_FONT_LOADER_H_ | 72 #endif // COMPONENTS_FONT_SERVICE_PUBLIC_CPP_FONT_LOADER_H_ |
OLD | NEW |