Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |