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

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

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 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/ppb_font_proxy.h ('k') | ppapi/proxy/ppb_fullscreen_proxy.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/ppb_font_proxy.h" 5 #include "ppapi/proxy/ppb_font_proxy.h"
6 6
7 #include "ppapi/c/dev/ppb_font_dev.h" 7 #include "ppapi/c/dev/ppb_font_dev.h"
8 #include "ppapi/proxy/plugin_dispatcher.h" 8 #include "ppapi/proxy/plugin_dispatcher.h"
9 #include "ppapi/proxy/plugin_resource.h" 9 #include "ppapi/proxy/plugin_resource.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 181
182 const void* PPB_Font_Proxy::GetSourceInterface() const { 182 const void* PPB_Font_Proxy::GetSourceInterface() const {
183 return &ppb_font_interface; 183 return &ppb_font_interface;
184 } 184 }
185 185
186 InterfaceID PPB_Font_Proxy::GetInterfaceId() const { 186 InterfaceID PPB_Font_Proxy::GetInterfaceId() const {
187 return INTERFACE_ID_PPB_FONT; 187 return INTERFACE_ID_PPB_FONT;
188 } 188 }
189 189
190 void PPB_Font_Proxy::OnMessageReceived(const IPC::Message& msg) { 190 bool PPB_Font_Proxy::OnMessageReceived(const IPC::Message& msg) {
191 bool handled = true;
191 IPC_BEGIN_MESSAGE_MAP(PPB_Font_Proxy, msg) 192 IPC_BEGIN_MESSAGE_MAP(PPB_Font_Proxy, msg)
192 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_Create, 193 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_Create,
193 OnMsgCreate) 194 OnMsgCreate)
194 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_DrawTextAt, 195 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_DrawTextAt,
195 OnMsgDrawTextAt) 196 OnMsgDrawTextAt)
196 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_MeasureText, 197 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_MeasureText,
197 OnMsgMeasureText) 198 OnMsgMeasureText)
198 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_CharacterOffsetForPixel, 199 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_CharacterOffsetForPixel,
199 OnMsgCharacterOffsetForPixel) 200 OnMsgCharacterOffsetForPixel)
200 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_PixelOffsetForCharacter, 201 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_PixelOffsetForCharacter,
201 OnMsgPixelOffsetForCharacter) 202 OnMsgPixelOffsetForCharacter)
203 IPC_MESSAGE_UNHANDLED(handled = false)
202 IPC_END_MESSAGE_MAP() 204 IPC_END_MESSAGE_MAP()
205 return handled;
203 } 206 }
204 207
205 void PPB_Font_Proxy::OnMsgCreate( 208 void PPB_Font_Proxy::OnMsgCreate(
206 PP_Module pp_module, 209 PP_Module pp_module,
207 const SerializedFontDescription& in_description, 210 const SerializedFontDescription& in_description,
208 PP_Resource* result, 211 PP_Resource* result,
209 SerializedFontDescription* out_description, 212 SerializedFontDescription* out_description,
210 std::string* out_metrics) { 213 std::string* out_metrics) {
211 // Convert the face name in the input description. 214 // Convert the face name in the input description.
212 PP_FontDescription_Dev in_pp_desc; 215 PP_FontDescription_Dev in_pp_desc;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 PP_TextRun_Dev run; 287 PP_TextRun_Dev run;
285 run.text = text.Get(dispatcher()); 288 run.text = text.Get(dispatcher());
286 run.rtl = text_is_rtl; 289 run.rtl = text_is_rtl;
287 run.override_direction = override_direction; 290 run.override_direction = override_direction;
288 291
289 *result = ppb_font_target()->PixelOffsetForCharacter(font, &run, char_offset); 292 *result = ppb_font_target()->PixelOffsetForCharacter(font, &run, char_offset);
290 } 293 }
291 294
292 } // namespace proxy 295 } // namespace proxy
293 } // namespace pp 296 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_font_proxy.h ('k') | ppapi/proxy/ppb_fullscreen_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698