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}
int32_t PepperDeviceEnumerationHostHelper::OnMonitorDeviceChange(
    HostMessageContext* /* context */,
    uint32_t callback_id) {
  monitor_.reset(new ScopedRequest(
      this,
      base::Bind(&PepperDeviceEnumerationHostHelper::OnNotifyDeviceChange,
                 base::Unretained(this),
                 callback_id)));

  return monitor_->requested() ? PP_OK : PP_ERROR_FAILED;
}

int32_t PepperDeviceEnumerationHostHelper::OnMonitorDeviceChange(
    HostMessageContext* /* context */,
    uint32_t callback_id) {
  monitor_.reset(new ScopedRequest(
      this,
      base::Bind(&PepperDeviceEnumerationHostHelper::OnNotifyDeviceChange,
                 base::Unretained(this),
                 callback_id)));

  return monitor_->requested() ? PP_OK : PP_ERROR_FAILED;
}
