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

Unified Diff: content/renderer/media/media_stream_dispatcher.cc

Issue 18420011: Support cancellation of request for opening device. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_dispatcher.cc
===================================================================
--- content/renderer/media/media_stream_dispatcher.cc (revision 209718)
+++ content/renderer/media/media_stream_dispatcher.cc (working copy)
@@ -85,18 +85,21 @@
security_origin));
}
-void MediaStreamDispatcher::CancelGenerateStream(int request_id) {
+void MediaStreamDispatcher::CancelGenerateStream(
+ int request_id,
+ const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler) {
DCHECK(main_loop_->BelongsToCurrentThread());
DVLOG(1) << "MediaStreamDispatcher::CancelGenerateStream"
<< ", {request_id = " << request_id << "}";
RequestList::iterator it = requests_.begin();
for (; it != requests_.end(); ++it) {
- Request& request = *it;
- if (request.request_id == request_id) {
+ if (it->request_id == request_id &&
+ it->handler.get() == event_handler.get()) {
tommi (sloooow) - chröme 2013/07/03 08:05:12 is this the right thing to do? it seems to me tha
wjia(left Chromium) 2013/07/03 17:41:36 Yes, it's the right thing to do. The request_id is
+ int ipc_request = it->ipc_request;
requests_.erase(it);
Send(new MediaStreamHostMsg_CancelGenerateStream(routing_id(),
- request_id));
+ ipc_request));
break;
}
}
@@ -197,6 +200,12 @@
security_origin));
}
+void MediaStreamDispatcher::CancelOpenDevice(
+ int request_id,
+ const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler) {
+ CancelGenerateStream(request_id, event_handler);
+}
+
void MediaStreamDispatcher::CloseDevice(const std::string& label) {
DCHECK(main_loop_->BelongsToCurrentThread());
DVLOG(1) << "MediaStreamDispatcher::CloseDevice"
« no previous file with comments | « content/renderer/media/media_stream_dispatcher.h ('k') | content/renderer/media/media_stream_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698