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 "content/renderer/webplugin_delegate_proxy.h" | 5 #include "content/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #elif defined(USE_X11) | 9 #elif defined(USE_X11) |
10 #include <cairo/cairo.h> | 10 #include <cairo/cairo.h> |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 render_view_->routing_id(), url, page_url_, mime_type_, | 309 render_view_->routing_id(), url, page_url_, mime_type_, |
310 &channel_handle, &info_))) { | 310 &channel_handle, &info_))) { |
311 continue; | 311 continue; |
312 } | 312 } |
313 | 313 |
314 if (channel_handle.name.empty()) { | 314 if (channel_handle.name.empty()) { |
315 // We got an invalid handle. Either the plugin couldn't be found (which | 315 // We got an invalid handle. Either the plugin couldn't be found (which |
316 // shouldn't happen, since if we got here the plugin should exist) or the | 316 // shouldn't happen, since if we got here the plugin should exist) or the |
317 // plugin crashed on initialization. | 317 // plugin crashed on initialization. |
318 if (!info_.path.empty()) { | 318 if (!info_.path.empty()) { |
319 render_view_->PluginCrashed(info_.path); | 319 render_view_->PluginCrashed(info_.path, base::kNullProcessId); |
320 LOG(ERROR) << "Plug-in crashed on start"; | 320 LOG(ERROR) << "Plug-in crashed on start"; |
321 | 321 |
322 // Return true so that the plugin widget is created and we can paint the | 322 // Return true so that the plugin widget is created and we can paint the |
323 // crashed plugin there. | 323 // crashed plugin there. |
324 return true; | 324 return true; |
325 } | 325 } |
326 LOG(ERROR) << "Plug-in couldn't be found"; | 326 LOG(ERROR) << "Plug-in couldn't be found"; |
327 return false; | 327 return false; |
328 } | 328 } |
329 | 329 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 void WebPluginDelegateProxy::OnChannelError() { | 492 void WebPluginDelegateProxy::OnChannelError() { |
493 if (plugin_) { | 493 if (plugin_) { |
494 if (window_) { | 494 if (window_) { |
495 // The actual WebPluginDelegate never got a chance to tell the WebPlugin | 495 // The actual WebPluginDelegate never got a chance to tell the WebPlugin |
496 // its window was going away. Do it on its behalf. | 496 // its window was going away. Do it on its behalf. |
497 WillDestroyWindow(); | 497 WillDestroyWindow(); |
498 } | 498 } |
499 plugin_->Invalidate(); | 499 plugin_->Invalidate(); |
500 } | 500 } |
501 if (!channel_host_->expecting_shutdown()) | 501 if (!channel_host_->expecting_shutdown()) |
502 render_view_->PluginCrashed(info_.path); | 502 render_view_->PluginCrashed(info_.path, channel_host_->peer_pid()); |
503 | 503 |
504 #if defined(OS_MACOSX) || defined(OS_WIN) | 504 #if defined(OS_MACOSX) || defined(OS_WIN) |
505 // Ensure that the renderer doesn't think the plugin still has focus. | 505 // Ensure that the renderer doesn't think the plugin still has focus. |
506 if (render_view_) | 506 if (render_view_) |
507 render_view_->PluginFocusChanged(false, instance_id_); | 507 render_view_->PluginFocusChanged(false, instance_id_); |
508 #endif | 508 #endif |
509 } | 509 } |
510 | 510 |
511 static void CopyTransportDIBHandleForMessage( | 511 static void CopyTransportDIBHandleForMessage( |
512 const TransportDIB::Handle& handle_in, | 512 const TransportDIB::Handle& handle_in, |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 | 1299 |
1300 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1300 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1301 int resource_id) { | 1301 int resource_id) { |
1302 if (!plugin_) | 1302 if (!plugin_) |
1303 return; | 1303 return; |
1304 | 1304 |
1305 plugin_->URLRedirectResponse(allow, resource_id); | 1305 plugin_->URLRedirectResponse(allow, resource_id); |
1306 } | 1306 } |
1307 | 1307 |
1308 } // namespace content | 1308 } // namespace content |
OLD | NEW |