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

Side by Side Diff: content/browser/renderer_host/media/media_stream_dispatcher_host.cc

Issue 10829190: Resolve the problems where we can leak the system tray UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed more relevant problems, ready for review now. Created 8 years, 4 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/browser/renderer_host/media/media_stream_dispatcher_host.h" 5 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h"
6 6
7 #include "content/browser/browser_main_loop.h" 7 #include "content/browser/browser_main_loop.h"
8 #include "content/common/media/media_stream_messages.h" 8 #include "content/common/media/media_stream_messages.h"
9 #include "content/common/media/media_stream_options.h" 9 #include "content/common/media/media_stream_options.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 OnOpenDevice) 136 OnOpenDevice)
137 IPC_MESSAGE_UNHANDLED(handled = false) 137 IPC_MESSAGE_UNHANDLED(handled = false)
138 IPC_END_MESSAGE_MAP_EX() 138 IPC_END_MESSAGE_MAP_EX()
139 return handled; 139 return handled;
140 } 140 }
141 141
142 void MediaStreamDispatcherHost::OnChannelClosing() { 142 void MediaStreamDispatcherHost::OnChannelClosing() {
143 BrowserMessageFilter::OnChannelClosing(); 143 BrowserMessageFilter::OnChannelClosing();
144 DVLOG(1) << "MediaStreamDispatcherHost::OnChannelClosing"; 144 DVLOG(1) << "MediaStreamDispatcherHost::OnChannelClosing";
145 145
146 // Since the IPC channel is gone, cancel pending requests and close all 146 // Since the IPC channel is gone, close all requesting/requested streams.
147 // requested VideoCaptureDevices.
148 GetManager()->CancelRequests(this);
149 for (StreamMap::iterator it = streams_.begin(); 147 for (StreamMap::iterator it = streams_.begin();
150 it != streams_.end(); 148 it != streams_.end();
151 it++) { 149 it++) {
152 std::string label = it->first; 150 std::string label = it->first;
153 GetManager()->StopGeneratedStream(label); 151 GetManager()->StopGeneratedStream(label);
154 } 152 }
155 } 153 }
156 154
157 MediaStreamDispatcherHost::~MediaStreamDispatcherHost() {} 155 MediaStreamDispatcherHost::~MediaStreamDispatcherHost() {}
158 156
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 device_id, type, security_origin, &label); 235 device_id, type, security_origin, &label);
238 DCHECK(!label.empty()); 236 DCHECK(!label.empty());
239 streams_[label] = StreamRequest(render_view_id, page_request_id); 237 streams_[label] = StreamRequest(render_view_id, page_request_id);
240 } 238 }
241 239
242 MediaStreamManager* MediaStreamDispatcherHost::GetManager() { 240 MediaStreamManager* MediaStreamDispatcherHost::GetManager() {
243 return BrowserMainLoop::GetMediaStreamManager(); 241 return BrowserMainLoop::GetMediaStreamManager();
244 } 242 }
245 243
246 } // namespace media_stream 244 } // namespace media_stream
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698