Chromium Code Reviews| Index: content/renderer/pepper/pepper_device_enumeration_host_helper.cc |
| diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc |
| index 2fd9a3b36d184db03fc2ff2a99c74408fab14305..dc4967c11216fcc587aac13517b450cbadd3f28c 100644 |
| --- a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc |
| +++ b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc |
| @@ -35,6 +35,9 @@ class PepperDeviceEnumerationHostHelper::ScopedEnumerationRequest |
| if (!owner->document_url_.is_valid()) |
| return; |
| + if (!owner->delegate_) |
|
yzshen1
2017/05/05 17:08:11
Sorry this has been too long ago. I don't remember
Guido Urdaneta
2017/05/05 17:18:12
It is also expected if the document_url is not val
yzshen1
2017/05/05 17:22:31
That makes sense. :)
|
| + return; |
| + |
| requested_ = true; |
| // Note that the callback passed into |
| @@ -44,7 +47,6 @@ class PepperDeviceEnumerationHostHelper::ScopedEnumerationRequest |
| // EnumerateDevicesCallbackBody() to ensure that we always call |callback| |
| // asynchronously. |
| sync_call_ = true; |
| - DCHECK(owner->delegate_); |
| owner->delegate_->EnumerateDevices( |
| owner->device_type_, owner->document_url_, |
| base::Bind(&ScopedEnumerationRequest::EnumerateDevicesCallbackBody, |
| @@ -91,9 +93,11 @@ class PepperDeviceEnumerationHostHelper::ScopedMonitoringRequest |
| if (!owner_->document_url_.is_valid()) |
| return; |
| + if (!owner->delegate_) |
| + return; |
| + |
| requested_ = true; |
| - DCHECK(owner_->delegate_); |
| // |callback| is never called synchronously by StartMonitoringDevices(), |
| // so it is OK to pass it directly, even if |callback| destroys |this|. |
| subscription_id_ = owner_->delegate_->StartMonitoringDevices( |