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

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

Issue 18420011: Support cancellation of request for opening device. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: add IsThisRequest method and some comments Created 7 years, 5 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
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/media_stream_impl.h" 5 #include "content/renderer/media/media_stream_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 // MediaStreamDispatcher know that the stream is no longer wanted. 491 // MediaStreamDispatcher know that the stream is no longer wanted.
492 // If not, we cancel the request and delete the request object. 492 // If not, we cancel the request and delete the request object.
493 if ((*request_it)->generated) { 493 if ((*request_it)->generated) {
494 // Stop the local audio track before closing the device in the browser. 494 // Stop the local audio track before closing the device in the browser.
495 dependency_factory_->StopLocalAudioSource((*request_it)->descriptor); 495 dependency_factory_->StopLocalAudioSource((*request_it)->descriptor);
496 496
497 media_stream_dispatcher_->StopStream( 497 media_stream_dispatcher_->StopStream(
498 UTF16ToUTF8((*request_it)->descriptor.label())); 498 UTF16ToUTF8((*request_it)->descriptor.label()));
499 } else { 499 } else {
500 media_stream_dispatcher_->CancelGenerateStream( 500 media_stream_dispatcher_->CancelGenerateStream(
501 (*request_it)->request_id); 501 (*request_it)->request_id, AsWeakPtr());
502 } 502 }
503 request_it = user_media_requests_.erase(request_it); 503 request_it = user_media_requests_.erase(request_it);
504 } else { 504 } else {
505 ++request_it; 505 ++request_it;
506 } 506 }
507 } 507 }
508 } 508 }
509 509
510 scoped_refptr<webkit_media::VideoFrameProvider> 510 scoped_refptr<webkit_media::VideoFrameProvider>
511 MediaStreamImpl::CreateVideoFrameProvider( 511 MediaStreamImpl::CreateVideoFrameProvider(
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 } 622 }
623 623
624 for (size_t i = 0; i < video_sources.size(); ++i) { 624 for (size_t i = 0; i < video_sources.size(); ++i) {
625 video_sources[i].setReadyState( 625 video_sources[i].setReadyState(
626 WebKit::WebMediaStreamSource::ReadyStateEnded); 626 WebKit::WebMediaStreamSource::ReadyStateEnded);
627 video_sources[i].setExtraData(NULL); 627 video_sources[i].setExtraData(NULL);
628 } 628 }
629 } 629 }
630 630
631 } // namespace content 631 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_dispatcher_unittest.cc ('k') | content/renderer/media/mock_media_stream_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698