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 #include "ppapi/proxy/flash_font_file_resource.h" | 5 #include "ppapi/proxy/flash_font_file_resource.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 | 8 |
9 #include "ppapi/c/dev/ppb_font_dev.h" | 9 #include "ppapi/c/dev/ppb_font_dev.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 return this; | 31 return this; |
32 } | 32 } |
33 | 33 |
34 PP_Bool FlashFontFileResource::GetFontTable(uint32_t table, | 34 PP_Bool FlashFontFileResource::GetFontTable(uint32_t table, |
35 void* output, | 35 void* output, |
36 uint32_t* output_length) { | 36 uint32_t* output_length) { |
37 if (!output_length) | 37 if (!output_length) |
38 return PP_FALSE; | 38 return PP_FALSE; |
39 | 39 |
40 if (!sent_create_to_renderer()) { | 40 if (!sent_create_to_renderer()) { |
41 SendCreateToRenderer( | 41 SendCreate( |
42 PpapiHostMsg_FlashFontFile_Create(description_, charset_)); | 42 RENDERER, PpapiHostMsg_FlashFontFile_Create(description_, charset_)); |
43 } | 43 } |
44 | 44 |
45 std::string* contents = GetFontTable(table); | 45 std::string* contents = GetFontTable(table); |
46 if (!contents) { | 46 if (!contents) { |
47 std::string out_contents; | 47 std::string out_contents; |
48 int32_t result = SyncCall<PpapiPluginMsg_FlashFontFile_GetFontTableReply>( | 48 int32_t result = SyncCall<PpapiPluginMsg_FlashFontFile_GetFontTableReply>( |
49 RENDERER, PpapiHostMsg_FlashFontFile_GetFontTable(table), | 49 RENDERER, PpapiHostMsg_FlashFontFile_GetFontTable(table), |
50 &out_contents); | 50 &out_contents); |
51 if (result != PP_OK) | 51 if (result != PP_OK) |
52 return PP_FALSE; | 52 return PP_FALSE; |
(...skipping 20 matching lines...) Expand all Loading... |
73 | 73 |
74 std::string* FlashFontFileResource::AddFontTable(uint32_t table, | 74 std::string* FlashFontFileResource::AddFontTable(uint32_t table, |
75 const std::string& contents) { | 75 const std::string& contents) { |
76 linked_ptr<std::string> heap_string(new std::string(contents)); | 76 linked_ptr<std::string> heap_string(new std::string(contents)); |
77 font_tables_[table] = heap_string; | 77 font_tables_[table] = heap_string; |
78 return heap_string.get(); | 78 return heap_string.get(); |
79 } | 79 } |
80 | 80 |
81 } // namespace proxy | 81 } // namespace proxy |
82 } // namespace ppapi | 82 } // namespace ppapi |
OLD | NEW |