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

Unified Diff: chrome/browser/media/webrtc_logging_handler_host.cc

Issue 137503002: Make WebRtcLoggingHandlerHost tolerant of out-of-order messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 500s Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/webrtc_logging_handler_host.cc
diff --git a/chrome/browser/media/webrtc_logging_handler_host.cc b/chrome/browser/media/webrtc_logging_handler_host.cc
index bed00cb8757700aefc32b44e7e6485991aaf0205..66f038ac2dc421ca66d79bcfdc424db9f062ccfa 100644
--- a/chrome/browser/media/webrtc_logging_handler_host.cc
+++ b/chrome/browser/media/webrtc_logging_handler_host.cc
@@ -219,6 +219,14 @@ bool WebRtcLoggingHandlerHost::OnMessageReceived(const IPC::Message& message,
void WebRtcLoggingHandlerHost::OnLoggingStoppedInRenderer() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ if (logging_state_ != STOPPING) {
+ // If an out-of-order response is received, stop_callback_ may be invalid,
+ // and must not be invoked.
+ DLOG(ERROR) << "OnLoggingStoppedInRenderer invoked in state "
+ << logging_state_;
+ BadMessageReceived();
+ return;
+ }
logging_state_ = STOPPED;
FireGenericDoneCallback(&stop_callback_, true, "");
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698