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

Side by Side Diff: chrome/browser/media/webrtc_rtp_dump_handler.cc

Issue 322603003: Fix a crash in WebRtcRtpDumpHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/media/webrtc_rtp_dump_handler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_rtp_dump_handler.h" 5 #include "chrome/browser/media/webrtc_rtp_dump_handler.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 base::Bind(base::IgnoreResult(&base::DeleteFile), 323 base::Bind(base::IgnoreResult(&base::DeleteFile),
324 outgoing_dump_path_, 324 outgoing_dump_path_,
325 false)); 325 false));
326 326
327 DVLOG(2) << "Deleted invalid outgoing dump " 327 DVLOG(2) << "Deleted invalid outgoing dump "
328 << outgoing_dump_path_.value(); 328 << outgoing_dump_path_.value();
329 outgoing_dump_path_.clear(); 329 outgoing_dump_path_.clear();
330 } 330 }
331 } 331 }
332 332
333 if (!callback.is_null())
334 callback.Run();
335
336 // Release the writer when it's no longer needed. 333 // Release the writer when it's no longer needed.
337 if (incoming_state_ != STATE_STOPPING && outgoing_state_ != STATE_STOPPING && 334 if (incoming_state_ != STATE_STOPPING && outgoing_state_ != STATE_STOPPING &&
338 incoming_state_ != STATE_STARTED && outgoing_state_ != STATE_STARTED) { 335 incoming_state_ != STATE_STARTED && outgoing_state_ != STATE_STARTED) {
339 dump_writer_.reset(); 336 dump_writer_.reset();
340 --g_ongoing_rtp_dumps; 337 --g_ongoing_rtp_dumps;
341 } 338 }
339
340 // This object might be deleted after running the callback.
341 if (!callback.is_null())
342 callback.Run();
342 } 343 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/webrtc_rtp_dump_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698