Pepper: Access PepperMediaDeviceManager through a WeakPtr

Its lifetime is scoped to the RenderFrame, and it might go away before the
hosts that refer to it.

BUG=423030

Review URL: https://codereview.chromium.org/653243003

Cr-Commit-Position: refs/heads/master@{#299897}
  ScopedRequest(PepperDeviceEnumerationHostHelper* owner,
                const Delegate::EnumerateDevicesCallback& callback)
      : owner_(owner),
        callback_(callback),
        requested_(false),
        request_id_(0),
        sync_call_(false) {
    if (!owner_->document_url_.is_valid())
      return;

    requested_ = true;

     sync_call_ = true;
    DCHECK(owner_->delegate_);
     request_id_ = owner_->delegate_->EnumerateDevices(
         owner_->device_type_,
         owner_->document_url_,
        base::Bind(&ScopedRequest::EnumerateDevicesCallbackBody, AsWeakPtr()));
    sync_call_ = false;
   }

  ScopedRequest(PepperDeviceEnumerationHostHelper* owner,
                const Delegate::EnumerateDevicesCallback& callback)
      : owner_(owner),
        callback_(callback),
        requested_(false),
        request_id_(0),
        sync_call_(false) {
    if (!owner_->document_url_.is_valid())
      return;

    requested_ = true;

     sync_call_ = true;
     request_id_ = owner_->delegate_->EnumerateDevices(
         owner_->device_type_,
         owner_->document_url_,
        base::Bind(&ScopedRequest::EnumerateDevicesCallbackBody, AsWeakPtr()));
    sync_call_ = false;
   }
