summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy
diff options
context:
space:
mode:
authorpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 19:28:36 +0000
committerpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 19:28:36 +0000
commit83baa283eae4b154a7d71958c1610bce672f9839 (patch)
tree88805cc5448ebd61abe18269365220600af51c8c /ppapi/proxy
parentab83d83afed9823716303f99b32a42fa392b4f8c (diff)
downloadchromium_src-83baa283eae4b154a7d71958c1610bce672f9839.zip
chromium_src-83baa283eae4b154a7d71958c1610bce672f9839.tar.gz
chromium_src-83baa283eae4b154a7d71958c1610bce672f9839.tar.bz2
Protect against a NULL dispatcher
BUG=14338 TEST=none Review URL: http://codereview.chromium.org/6903158 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83759 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r--ppapi/proxy/ppb_font_proxy.cc30
1 files changed, 18 insertions, 12 deletions
diff --git a/ppapi/proxy/ppb_font_proxy.cc b/ppapi/proxy/ppb_font_proxy.cc
index 67c363f..e8d58df 100644
--- a/ppapi/proxy/ppb_font_proxy.cc
+++ b/ppapi/proxy/ppb_font_proxy.cc
@@ -146,10 +146,12 @@ int32_t MeasureText(PP_Resource font_id, const PP_TextRun_Dev* text) {
Dispatcher* dispatcher = PluginDispatcher::GetForInstance(object->instance());
int32_t result = 0;
- dispatcher->Send(new PpapiHostMsg_PPBFont_MeasureText(
- INTERFACE_ID_PPB_FONT, object->host_resource(),
- SerializedVarSendInput(dispatcher, text->text),
- text->rtl, text->override_direction, &result));
+ if (dispatcher) {
+ dispatcher->Send(new PpapiHostMsg_PPBFont_MeasureText(
+ INTERFACE_ID_PPB_FONT, object->host_resource(),
+ SerializedVarSendInput(dispatcher, text->text),
+ text->rtl, text->override_direction, &result));
+ }
return result;
}
@@ -162,10 +164,12 @@ uint32_t CharacterOffsetForPixel(PP_Resource font_id,
Dispatcher* dispatcher = PluginDispatcher::GetForInstance(object->instance());
uint32_t result = 0;
- dispatcher->Send(new PpapiHostMsg_PPBFont_CharacterOffsetForPixel(
- INTERFACE_ID_PPB_FONT, object->host_resource(),
- SerializedVarSendInput(dispatcher, text->text),
- text->rtl, text->override_direction, pixel_position, &result));
+ if (dispatcher) {
+ dispatcher->Send(new PpapiHostMsg_PPBFont_CharacterOffsetForPixel(
+ INTERFACE_ID_PPB_FONT, object->host_resource(),
+ SerializedVarSendInput(dispatcher, text->text),
+ text->rtl, text->override_direction, pixel_position, &result));
+ }
return result;
}
@@ -178,10 +182,12 @@ int32_t PixelOffsetForCharacter(PP_Resource font_id,
Dispatcher* dispatcher = PluginDispatcher::GetForInstance(object->instance());
int32_t result = 0;
- dispatcher->Send(new PpapiHostMsg_PPBFont_PixelOffsetForCharacter(
- INTERFACE_ID_PPB_FONT, object->host_resource(),
- SerializedVarSendInput(dispatcher, text->text),
- text->rtl, text->override_direction, char_offset, &result));
+ if (dispatcher) {
+ dispatcher->Send(new PpapiHostMsg_PPBFont_PixelOffsetForCharacter(
+ INTERFACE_ID_PPB_FONT, object->host_resource(),
+ SerializedVarSendInput(dispatcher, text->text),
+ text->rtl, text->override_direction, char_offset, &result));
+ }
return result;
}