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

Side by Side Diff: content/renderer/media/video_capture_impl.cc

Issue 14150004: Fix problem where a video frame buffer is freed while it is still in use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/media/video_capture_impl.h" 5 #include "content/renderer/media/video_capture_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "content/common/child_process.h" 9 #include "content/common/child_process.h"
10 #include "content/common/media/video_capture_messages.h" 10 #include "content/common/media/video_capture_messages.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 it != clients_.end(); ++it) { 316 it != clients_.end(); ++it) {
317 // TODO(wjia): browser process would send error code. 317 // TODO(wjia): browser process would send error code.
318 it->first->OnError(this, 1); 318 it->first->OnError(this, 1);
319 it->first->OnRemoved(this); 319 it->first->OnRemoved(this);
320 } 320 }
321 clients_.clear(); 321 clients_.clear();
322 state_ = VIDEO_CAPTURE_STATE_ERROR; 322 state_ = VIDEO_CAPTURE_STATE_ERROR;
323 break; 323 break;
324 case VIDEO_CAPTURE_STATE_ENDED: 324 case VIDEO_CAPTURE_STATE_ENDED:
325 DVLOG(1) << "OnStateChanged: ended!, device_id = " << device_id_; 325 DVLOG(1) << "OnStateChanged: ended!, device_id = " << device_id_;
326 STLDeleteValues(&cached_dibs_);
327 for (ClientInfo::iterator it = clients_.begin(); 326 for (ClientInfo::iterator it = clients_.begin();
328 it != clients_.end(); ++it) { 327 it != clients_.end(); ++it) {
329 it->first->OnRemoved(this); 328 it->first->OnRemoved(this);
330 } 329 }
331 clients_.clear(); 330 clients_.clear();
332 state_ = VIDEO_CAPTURE_STATE_ENDED; 331 state_ = VIDEO_CAPTURE_STATE_ENDED;
333 break; 332 break;
334 default: 333 default:
335 break; 334 break;
336 } 335 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if (it != clients->end()) { 444 if (it != clients->end()) {
446 handler->OnStopped(this); 445 handler->OnStopped(this);
447 handler->OnRemoved(this); 446 handler->OnRemoved(this);
448 clients->erase(it); 447 clients->erase(it);
449 found = true; 448 found = true;
450 } 449 }
451 return found; 450 return found;
452 } 451 }
453 452
454 } // namespace content 453 } // namespace content
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