summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-04 16:17:01 +0000
committermarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-04 16:17:01 +0000
commitc48998a7082c56a5afb066f50fe3f96016b2279b (patch)
tree38de4641f25d8c878281188d261702e70dc3a63b
parent999f7b47802d1f94e64198ae945139b0248be52c (diff)
downloadchromium_src-c48998a7082c56a5afb066f50fe3f96016b2279b.zip
chromium_src-c48998a7082c56a5afb066f50fe3f96016b2279b.tar.gz
chromium_src-c48998a7082c56a5afb066f50fe3f96016b2279b.tar.bz2
In the MediaStreamDevicescontroller: Test if the TabSpecificContentSettings is not NULL. This prevents the Controller from crashing if no TabSpecificContentSettings exist e.g. during CROS login .
BUG=173209 Review URL: https://codereview.chromium.org/12090117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180419 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/media/media_stream_devices_controller.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/media/media_stream_devices_controller.cc b/chrome/browser/media/media_stream_devices_controller.cc
index 613d939..22823c5 100644
--- a/chrome/browser/media/media_stream_devices_controller.cc
+++ b/chrome/browser/media/media_stream_devices_controller.cc
@@ -122,7 +122,8 @@ const std::string& MediaStreamDevicesController::GetSecurityOriginSpec() const {
}
void MediaStreamDevicesController::Accept(bool update_content_setting) {
- content_settings_->OnMediaStreamAccessed();
+ if (content_settings_)
+ content_settings_->OnMediaStreamAccessed();
// Get the default devices for the request.
content::MediaStreamDevices devices;
@@ -160,8 +161,11 @@ void MediaStreamDevicesController::Deny(bool update_content_setting) {
// TODO(markusheintz): Replace CONTENT_SETTINGS_TYPE_MEDIA_STREAM with the
// appropriate new CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC and
// CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA.
- content_settings_->OnContentBlocked(CONTENT_SETTINGS_TYPE_MEDIASTREAM,
- std::string());
+ if (content_settings_) {
+ content_settings_->OnContentBlocked(CONTENT_SETTINGS_TYPE_MEDIASTREAM,
+ std::string());
+ }
+
if (update_content_setting)
SetPermission(false);