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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/media/webrtc_logging_handler_host.h" 5 #include "chrome/browser/media/webrtc_logging_handler_host.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 IPC_MESSAGE_HANDLER(WebRtcLoggingMsg_LoggingStopped, 212 IPC_MESSAGE_HANDLER(WebRtcLoggingMsg_LoggingStopped,
213 OnLoggingStoppedInRenderer) 213 OnLoggingStoppedInRenderer)
214 IPC_MESSAGE_UNHANDLED(handled = false) 214 IPC_MESSAGE_UNHANDLED(handled = false)
215 IPC_END_MESSAGE_MAP_EX() 215 IPC_END_MESSAGE_MAP_EX()
216 216
217 return handled; 217 return handled;
218 } 218 }
219 219
220 void WebRtcLoggingHandlerHost::OnLoggingStoppedInRenderer() { 220 void WebRtcLoggingHandlerHost::OnLoggingStoppedInRenderer() {
221 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 221 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
222 if (logging_state_ != STOPPING) {
223 // If an out-of-order response is received, stop_callback_ may be invalid,
224 // and must not be invoked.
225 BadMessageReceived();
tommi (sloooow) - chröme 2014/01/14 15:14:22 perhaps log an error and the current value of logg
226 return;
227 }
222 logging_state_ = STOPPED; 228 logging_state_ = STOPPED;
223 FireGenericDoneCallback(&stop_callback_, true, ""); 229 FireGenericDoneCallback(&stop_callback_, true, "");
224 } 230 }
225 231
226 void WebRtcLoggingHandlerHost::StartLoggingIfAllowed() { 232 void WebRtcLoggingHandlerHost::StartLoggingIfAllowed() {
227 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 233 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
228 if (!g_browser_process->webrtc_log_uploader()->ApplyForStartLogging()) { 234 if (!g_browser_process->webrtc_log_uploader()->ApplyForStartLogging()) {
229 logging_state_ = CLOSED; 235 logging_state_ = CLOSED;
230 FireGenericDoneCallback( 236 FireGenericDoneCallback(
231 &start_callback_, false, "Cannot start, maybe the maximum number of " 237 &start_callback_, false, "Cannot start, maybe the maximum number of "
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 void WebRtcLoggingHandlerHost::FireGenericDoneCallback( 382 void WebRtcLoggingHandlerHost::FireGenericDoneCallback(
377 GenericDoneCallback* callback, bool success, 383 GenericDoneCallback* callback, bool success,
378 const std::string& error_message) { 384 const std::string& error_message) {
379 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 385 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
380 DCHECK(!(*callback).is_null()); 386 DCHECK(!(*callback).is_null());
381 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, 387 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
382 base::Bind(*callback, success, 388 base::Bind(*callback, success,
383 error_message)); 389 error_message));
384 (*callback).Reset(); 390 (*callback).Reset();
385 } 391 }
OLDNEW
« 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