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

Unified Diff: ppapi/proxy/host_dispatcher.cc

Issue 6493004: Implement basic crash detection and shutdown handling for out of process PPAP... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/host_dispatcher.h ('k') | ppapi/proxy/plugin_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/host_dispatcher.cc
===================================================================
--- ppapi/proxy/host_dispatcher.cc (revision 74766)
+++ ppapi/proxy/host_dispatcher.cc (working copy)
@@ -7,6 +7,7 @@
#include <map>
#include "base/logging.h"
+#include "ppapi/c/private/ppb_proxy_private.h"
#include "ppapi/c/dev/ppb_var_deprecated.h"
#include "ppapi/proxy/host_var_serialization_rules.h"
#include "ppapi/proxy/ppapi_messages.h"
@@ -24,8 +25,9 @@
HostDispatcher::HostDispatcher(base::ProcessHandle remote_process_handle,
PP_Module module,
GetInterfaceFunc local_get_interface)
- : Dispatcher(remote_process_handle, local_get_interface) {
- set_pp_module(module);
+ : Dispatcher(remote_process_handle, local_get_interface),
+ pp_module_(module),
+ ppb_proxy_(NULL) {
const PPB_Var_Deprecated* var_interface =
static_cast<const PPB_Var_Deprecated*>(
local_get_interface(PPB_VAR_DEPRECATED_INTERFACE));
@@ -109,7 +111,10 @@
}
void HostDispatcher::OnChannelError() {
- // TODO(brettw) plugin has crashed, handle this.
+ Dispatcher::OnChannelError(); // Stop using the channel.
+
+ // Tell the host about the crash so it can clean up.
+ GetPPBProxy()->PluginCrashed(pp_module());
}
const void* HostDispatcher::GetProxiedInterface(const std::string& interface) {
@@ -137,6 +142,14 @@
return NULL;
}
+const PPB_Proxy_Private* HostDispatcher::GetPPBProxy() {
+ if (!ppb_proxy_) {
+ ppb_proxy_ = reinterpret_cast<const PPB_Proxy_Private*>(
+ GetLocalInterface(PPB_PROXY_PRIVATE_INTERFACE));
+ }
+ return ppb_proxy_;
+}
+
} // namespace proxy
} // namespace pp
« no previous file with comments | « ppapi/proxy/host_dispatcher.h ('k') | ppapi/proxy/plugin_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698