0

cros: Fix crash in about:tracing

We've seen some crashes in DebugDaemonClientImpl::OnRequestStopSystemTracing.
If debugd crashes or completes I/O back to Chrome too early we could NULL out
a scoped_ptr<> before the code expects it.  Null check the pointer.

BUG=155774
TEST=crash reports


Review URL: https://chromiumcodereview.appspot.com/11155017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162217 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
jamescook@chromium.org
2012-10-16 19:46:19 +00:00
parent a9fb79dba9
commit f57c14b47c

@ -470,7 +470,10 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
void OnRequestStopSystemTracing(dbus::Response* response) {
if (!response) {
LOG(ERROR) << "Failed to request systrace stop";
pipe_reader_->OnDataReady(-1); // terminate data stream
// If debugd crashes or completes I/O before this message is processed
// then pipe_reader_ can be NULL, see OnIOComplete().
if (pipe_reader_.get())
pipe_reader_->OnDataReady(-1); // terminate data stream
}
// NB: requester is signaled when i/o completes
}