Commit 1a3cf7af authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Ignore GetCdmOrigin() failure

GetCdmOrigin() makes a sync call to the browser during CDM creation in
the CDM service in the utility process. Since CDM creation is an async
process, by the time GetCdmOrigin() is called, the render frame host
hosting that call may already be gone, causing GetCdmOrigin() failure.
In this case we should just ignore the error instead of the CHECK which
would cause a crash in the CDM process.

Bug: 1088352
Change-Id: I0298ed3a0421a0baa9c6d11fc2921f4446fd2d7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2225347Reviewed-by: default avatarJohn Rummell <jrummell@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773897}
parent 57724c5a
......@@ -47,7 +47,8 @@ class MEDIA_EXPORT CdmAuxiliaryHelper : public CdmAllocator,
// needed anymore.
virtual cdm::FileIO* CreateCdmFileIO(cdm::FileIOClient* client);
// Gets the URL origin of the CDM instance.
// Gets the origin of the frame associated with the CDM, which could be empty
// if the origin is unavailable or if error happened.
virtual url::Origin GetCdmOrigin();
// CdmAllocator implementation.
......
......@@ -4,6 +4,7 @@
#include "media/mojo/services/mojo_cdm_helper.h"
#include "base/macros.h"
#include "base/stl_util.h"
#include "media/base/cdm_context.h"
#include "media/cdm/cdm_helpers.h"
......@@ -39,7 +40,10 @@ cdm::FileIO* MojoCdmHelper::CreateCdmFileIO(cdm::FileIOClient* client) {
url::Origin MojoCdmHelper::GetCdmOrigin() {
url::Origin cdm_origin;
CHECK(frame_interfaces_->GetCdmOrigin(&cdm_origin));
// Since the CDM is created asynchronously, by the time this function is
// called, the render frame host in the browser process may already be gone.
// It's safe to ignore the error since the origin is used for crash reporting.
ignore_result(frame_interfaces_->GetCdmOrigin(&cdm_origin));
return cdm_origin;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment