OLD | NEW |
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 PPAPI_PROXY_FLASH_FONT_FILE_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_FLASH_FONT_FILE_RESOURCE_H_ |
6 #define PPAPI_PROXY_FLASH_FONT_FILE_RESOURCE_H_ | 6 #define PPAPI_PROXY_FLASH_FONT_FILE_RESOURCE_H_ |
7 | 7 |
8 #include <map> | |
9 #include <string> | 8 #include <string> |
10 | 9 |
11 #include "base/basictypes.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
12 #include "base/compiler_specific.h" | |
13 #include "base/memory/linked_ptr.h" | |
14 #include "ppapi/c/private/pp_private_font_charset.h" | 11 #include "ppapi/c/private/pp_private_font_charset.h" |
15 #include "ppapi/proxy/plugin_resource.h" | 12 #include "ppapi/proxy/plugin_resource.h" |
16 #include "ppapi/proxy/serialized_structs.h" | 13 #include "ppapi/proxy/serialized_structs.h" |
17 #include "ppapi/thunk/ppb_flash_font_file_api.h" | 14 #include "ppapi/thunk/ppb_flash_font_file_api.h" |
18 | 15 |
19 struct PP_BrowserFont_Trusted_Description; | 16 struct PP_BrowserFont_Trusted_Description; |
20 | 17 |
21 namespace ppapi { | 18 namespace ppapi { |
22 namespace proxy { | 19 namespace proxy { |
23 | 20 |
(...skipping 11 matching lines...) Expand all Loading... |
35 thunk::PPB_Flash_FontFile_API* AsPPB_Flash_FontFile_API() override; | 32 thunk::PPB_Flash_FontFile_API* AsPPB_Flash_FontFile_API() override; |
36 | 33 |
37 // PPB_Flash_FontFile_API. | 34 // PPB_Flash_FontFile_API. |
38 PP_Bool GetFontTable(uint32_t table, | 35 PP_Bool GetFontTable(uint32_t table, |
39 void* output, | 36 void* output, |
40 uint32_t* output_length) override; | 37 uint32_t* output_length) override; |
41 | 38 |
42 private: | 39 private: |
43 // Sees if we have a cache of the font table and returns a pointer to it. | 40 // Sees if we have a cache of the font table and returns a pointer to it. |
44 // Returns NULL if we don't have it. | 41 // Returns NULL if we don't have it. |
45 std::string* GetFontTable(uint32_t table) const; | 42 const std::string* GetFontTable(uint32_t table) const; |
46 | 43 |
47 std::string* AddFontTable(uint32_t table, const std::string& contents); | 44 const std::string* AddFontTable(uint32_t table, const std::string& contents); |
48 | 45 |
49 typedef std::map<uint32_t, linked_ptr<std::string> > FontTableMap; | 46 using FontTableMap = |
| 47 base::ScopedPtrHashMap<uint32_t, scoped_ptr<std::string>>; |
50 FontTableMap font_tables_; | 48 FontTableMap font_tables_; |
51 | 49 |
52 SerializedFontDescription description_; | 50 SerializedFontDescription description_; |
53 PP_PrivateFontCharset charset_; | 51 const PP_PrivateFontCharset charset_; |
54 | 52 |
55 DISALLOW_COPY_AND_ASSIGN(FlashFontFileResource); | 53 DISALLOW_COPY_AND_ASSIGN(FlashFontFileResource); |
56 }; | 54 }; |
57 | 55 |
58 } // namespace proxy | 56 } // namespace proxy |
59 } // namespace ppapi | 57 } // namespace ppapi |
60 | 58 |
61 #endif // PPAPI_PROXY_FLASH_FONT_FILE_RESOURCE_H_ | 59 #endif // PPAPI_PROXY_FLASH_FONT_FILE_RESOURCE_H_ |
OLD | NEW |