X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontent%2Frenderer%2Fpepper%2Fpepper_device_enumeration_host_helper.cc;h=edc0840bb92a4c4307b7bc50bc717ae6b5813391;hb=f5180d0a4dfe13ef74567dc9aa75047c1a9cd6de;hp=d983f4a5816f70ae16d72aaa0959eb165a03503f;hpb=669bbc0a54393464248e6bac22558cda42a9a350;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/content/renderer/pepper/pepper_device_enumeration_host_helper.cc b/src/content/renderer/pepper/pepper_device_enumeration_host_helper.cc index d983f4a..edc0840 100644 --- a/src/content/renderer/pepper/pepper_device_enumeration_host_helper.cc +++ b/src/content/renderer/pepper/pepper_device_enumeration_host_helper.cc @@ -46,6 +46,7 @@ class PepperDeviceEnumerationHostHelper::ScopedRequest // EnumerateDevicesCallbackBody() to ensure that we always call |callback| // asynchronously. sync_call_ = true; + DCHECK(owner_->delegate_); request_id_ = owner_->delegate_->EnumerateDevices( owner_->device_type_, owner_->document_url_, @@ -54,7 +55,7 @@ class PepperDeviceEnumerationHostHelper::ScopedRequest } ~ScopedRequest() { - if (requested_) { + if (requested_ && owner_->delegate_) { owner_->delegate_->StopEnumerateDevices(request_id_); } } @@ -91,7 +92,7 @@ class PepperDeviceEnumerationHostHelper::ScopedRequest PepperDeviceEnumerationHostHelper::PepperDeviceEnumerationHostHelper( ppapi::host::ResourceHost* resource_host, - Delegate* delegate, + base::WeakPtr delegate, PP_DeviceType_Dev device_type, const GURL& document_url) : resource_host_(resource_host),