Chromium Code Reviews| Index: content/common/font_config_ipc_linux.h |
| diff --git a/content/common/font_config_ipc_linux.h b/content/common/font_config_ipc_linux.h |
| index c5cf80f72744dac30632e84bd43563e9fa94472d..4d64884807ddcb4e34ed2940cf7f361738250543 100644 |
| --- a/content/common/font_config_ipc_linux.h |
| +++ b/content/common/font_config_ipc_linux.h |
| @@ -6,6 +6,8 @@ |
| #define CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ |
| #include "base/compiler_specific.h" |
| +#include "base/containers/hash_tables.h" |
| +#include "base/synchronization/lock.h" |
| #include "third_party/skia/include/ports/SkFontConfigInterface.h" |
| #include <string> |
| @@ -37,7 +39,19 @@ class FontConfigIPC : public SkFontConfigInterface { |
| }; |
| private: |
| + class MappedFontFile; |
| + friend class MappedFontFile; |
|
Daniel Erat
2015/01/14 23:40:27
(mostly a note for myself: i initially thought tha
Krzysztof Olczyk
2015/01/15 09:05:28
Oh, I wasn't aware it was addressed in C++11, than
Daniel Erat
2015/01/15 15:55:54
sorry, i meant it the other way around: apparently
Krzysztof Olczyk
2015/01/15 17:44:11
I think it's other way round. I'm pretty sure frie
|
| + |
| + // Removes |mapped_font_file| from |mapped_font_files_|. |
| + // Does not delete the passed-in object. |
| + void RemoveMappedFontFile(MappedFontFile* mapped_font_file); |
| + |
| const int fd_; |
| + // Lock preventing multiple threads from opening font file and accessing |
| + // |mapped_font_files_| map at the same time. |
| + base::Lock stream_opening_lock_; |
|
Daniel Erat
2015/01/14 23:40:27
nit: just rename this to |lock_| since it protects
Krzysztof Olczyk
2015/01/15 09:05:28
Done.
|
| + // Maps font identity ID to the memory-mapped file with font data. |
| + base::hash_map<uint32_t, MappedFontFile*> mapped_font_files_; |
| }; |
| } // namespace content |