summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbsy@google.com <bsy@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-26 22:28:59 +0000
committerbsy@google.com <bsy@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-26 22:28:59 +0000
commit8616e9c8edebdefc624bc3d0c4a12ca00966fd69 (patch)
tree1dc16871e2d02679b9a5d9e061c58b083f5632e3
parent5ac34c41bfd7dc06e04b3a1cab6c6cdb841e4e4f (diff)
downloadchromium_src-8616e9c8edebdefc624bc3d0c4a12ca00966fd69.zip
chromium_src-8616e9c8edebdefc624bc3d0c4a12ca00966fd69.tar.gz
chromium_src-8616e9c8edebdefc624bc3d0c4a12ca00966fd69.tar.bz2
ensure that the plugin will report only one crash event.
BUG= http://code.google.com/p/chromium/issues/detail?id=97868 Review URL: http://codereview.chromium.org/8038013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102821 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.cc3
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.h16
2 files changed, 10 insertions, 9 deletions
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index 649b94a..059ed49 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -1371,7 +1371,7 @@ void Plugin::ReportDeadNexe() {
if (ppapi_proxy_ != NULL)
ppapi_proxy_->ReportDeadNexe();
- if (nacl_ready_state() == DONE) { // After loadEnd.
+ if (nacl_ready_state() == DONE && !nexe_error_reported()) { // After loadEnd.
int64_t crash_time = NaClGetTimeOfDayMicroseconds();
// Crashes will be more likely near startup, so use a medium histogram
// instead of a large one.
@@ -1387,6 +1387,7 @@ void Plugin::ReportDeadNexe() {
LENGTH_IS_NOT_COMPUTABLE,
kUnknownBytes,
kUnknownBytes);
+ set_nexe_error_reported(true);
CHECK(ppapi_proxy_ == NULL || !ppapi_proxy_->is_valid());
ShutdownProxy();
}
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.h b/ppapi/native_client/src/trusted/plugin/plugin.h
index cd30e76..4300c28 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.h
+++ b/ppapi/native_client/src/trusted/plugin/plugin.h
@@ -378,13 +378,13 @@ class Plugin : public pp::InstancePrivate {
// Callback used when the reverse channel closes. This is an
// asynchronous event that might turn into a JavaScript error or
// crash event -- this is controlled by the two state variables
- // nacl_ready_state_ and nexe_error_reported_: If an error had
- // already been reported, no crash event is generated. If no error
- // has been reported but nacl_ready_state_ is not DONE, then the
- // loadend event has not been reported, and we enqueue an error
- // event followed by loadend. If nacl_ready_state_ is DONE, then we
- // are in the post-loadend (we need temporal predicate symbols), and
- // we enqueue a crash event.
+ // nacl_ready_state_ and nexe_error_reported_: If an error or crash
+ // had already been reported, no additional crash event is
+ // generated. If no error has been reported but nacl_ready_state_
+ // is not DONE, then the loadend event has not been reported, and we
+ // enqueue an error event followed by loadend. If nacl_ready_state_
+ // is DONE, then we are in the post-loadend (we need temporal
+ // predicate symbols), and we enqueue a crash event.
void NexeDidCrash(int32_t pp_error);
// Callback used when a .nexe is translated from bitcode. If the translation
@@ -464,7 +464,7 @@ class Plugin : public pp::InstancePrivate {
nacl::string manifest_base_url_;
nacl::string manifest_url_;
ReadyState nacl_ready_state_;
- bool nexe_error_reported_;
+ bool nexe_error_reported_; // error or crash reported
nacl::DescWrapperFactory* wrapper_factory_;