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

Side by Side Diff: content/common/font_config_ipc_linux.h

Issue 697383002: Fix for the font files being maped multiple times (Fontconfig). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to HEAD Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/common/font_config_ipc_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ 5 #ifndef CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_
6 #define CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ 6 #define CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/containers/hash_tables.h"
10 #include "base/synchronization/lock.h"
9 #include "third_party/skia/include/core/SkStream.h" 11 #include "third_party/skia/include/core/SkStream.h"
10 #include "third_party/skia/include/core/SkTypeface.h" 12 #include "third_party/skia/include/core/SkTypeface.h"
11 #include "third_party/skia/include/ports/SkFontConfigInterface.h" 13 #include "third_party/skia/include/ports/SkFontConfigInterface.h"
12 14
13 #include <string> 15 #include <string>
14 16
15 class SkString; 17 class SkString;
16 18
17 namespace content { 19 namespace content {
18 20
(...skipping 15 matching lines...) Expand all
34 enum Method { 36 enum Method {
35 METHOD_MATCH = 0, 37 METHOD_MATCH = 0,
36 METHOD_OPEN = 1, 38 METHOD_OPEN = 1,
37 }; 39 };
38 40
39 enum { 41 enum {
40 kMaxFontFamilyLength = 2048 42 kMaxFontFamilyLength = 2048
41 }; 43 };
42 44
43 private: 45 private:
46 class MappedFontFile;
47
48 // Removes |mapped_font_file| from |mapped_font_files_|.
49 // Does not delete the passed-in object.
50 void RemoveMappedFontFile(MappedFontFile* mapped_font_file);
51
44 const int fd_; 52 const int fd_;
53 // Lock preventing multiple threads from opening font file and accessing
54 // |mapped_font_files_| map at the same time.
55 base::Lock lock_;
56 // Maps font identity ID to the memory-mapped file with font data.
57 base::hash_map<uint32_t, MappedFontFile*> mapped_font_files_;
45 }; 58 };
46 59
47 } // namespace content 60 } // namespace content
48 61
49 #endif // CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_ 62 #endif // CONTENT_COMMON_FONT_CONFIG_IPC_LINUX_H_
OLDNEW
« no previous file with comments | « no previous file | content/common/font_config_ipc_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698