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

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

Issue 7284037: Adding MediaStreamManager. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_device_settings.h" 5 #include "content/browser/renderer_host/media/media_stream_device_settings.h"
6 6
7 #include "base/stl_util-inl.h" 7 #include "base/stl_util-inl.h"
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "content/browser/browser_thread.h" 9 #include "content/browser/browser_thread.h"
10 #include "content/browser/renderer_host/media/media_stream_settings_requester.h" 10 #include "content/browser/renderer_host/media/media_stream_settings_requester.h"
(...skipping 26 matching lines...) Expand all
37 }; 37 };
38 38
39 MediaStreamDeviceSettings::MediaStreamDeviceSettings( 39 MediaStreamDeviceSettings::MediaStreamDeviceSettings(
40 SettingsRequester* requester) 40 SettingsRequester* requester)
41 : requester_(requester) { 41 : requester_(requester) {
42 DCHECK(requester_); 42 DCHECK(requester_);
43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
44 } 44 }
45 45
46 MediaStreamDeviceSettings::~MediaStreamDeviceSettings() { 46 MediaStreamDeviceSettings::~MediaStreamDeviceSettings() {
47 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
48 STLDeleteValues(&requests_); 47 STLDeleteValues(&requests_);
49 } 48 }
50 49
51 void MediaStreamDeviceSettings::RequestCaptureDeviceUsage( 50 void MediaStreamDeviceSettings::RequestCaptureDeviceUsage(
wjia(left Chromium) 2011/07/01 03:58:34 Is it good to combine RequestCaptureDeviceUsage wi
mflodman1 2011/07/01 09:37:10 This is a good point and I was thinking about this
52 const std::string& label, int render_process_id, int render_view_id, 51 const std::string& label, int render_process_id, int render_view_id,
53 const StreamOptions& request_options, const std::string& security_origin) { 52 const StreamOptions& request_options, const std::string& security_origin) {
54 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
55 54
56 if (requests_.find(label) != requests_.end()) { 55 if (requests_.find(label) != requests_.end()) {
57 // Request with this id already exists. 56 // Request with this id already exists.
58 requester_->Error(label); 57 requester_->Error(label);
59 return; 58 return;
60 } 59 }
61 60
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 119 }
121 } 120 }
122 // Post result and delete request. 121 // Post result and delete request.
123 requester_->DevicesAccepted(label, devices_to_use); 122 requester_->DevicesAccepted(label, devices_to_use);
124 requests_.erase(request_it); 123 requests_.erase(request_it);
125 delete request; 124 delete request;
126 } 125 }
127 } 126 }
128 127
129 } // namespace media_stream 128 } // namespace media_stream
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698