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

Side by Side Diff: ppapi/proxy/flash_font_file_resource.cc

Issue 11106019: PluginResource: Avoid having two sets of similar methods for talking with browser and renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/flash_device_id_resource.cc ('k') | ppapi/proxy/flash_resource.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 #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
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
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
OLDNEW
« no previous file with comments | « ppapi/proxy/flash_device_id_resource.cc ('k') | ppapi/proxy/flash_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698