Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / content / renderer / npapi / webplugin_delegate_proxy.cc
index 1943e80..13eb8a7 100644 (file)
@@ -486,7 +486,7 @@ void WebPluginDelegateProxy::OnChannelError() {
     }
     plugin_->Invalidate();
   }
-  if (!channel_host_->expecting_shutdown()) {
+  if (channel_host_.get() && !channel_host_->expecting_shutdown()) {
     render_view_->main_render_frame()->PluginCrashed(
         info_.path, channel_host_->peer_pid());
   }
@@ -525,6 +525,9 @@ static void CopyTransportDIBHandleForMessage(
 
 void WebPluginDelegateProxy::SendUpdateGeometry(
     bool bitmaps_changed) {
+  if (!channel_host_.get())
+    return;
+
   PluginMsg_UpdateGeometry_Param param;
   param.window_rect = plugin_rect_;
   param.clip_rect = clip_rect_;
@@ -730,6 +733,9 @@ NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() {
   if (npobject_)
     return WebBindings::retainObject(npobject_);
 
+  if (!channel_host_.get())
+    return NULL;
+
   int route_id = MSG_ROUTING_NONE;
   Send(new PluginMsg_GetPluginScriptableObject(instance_id_, &route_id));
   if (route_id == MSG_ROUTING_NONE)
@@ -769,7 +775,7 @@ void WebPluginDelegateProxy::SetFocus(bool focused) {
 bool WebPluginDelegateProxy::HandleInputEvent(
     const WebInputEvent& event,
     WebCursor::CursorInfo* cursor_info) {
-  bool handled;
+  bool handled = false;
   WebCursor cursor;
   // A windowless plugin can enter a modal loop in the context of a
   // NPP_HandleEvent call, in which case we need to pump messages to