| Index: chrome/browser/extensions/api/tab_capture/offscreen_presentation.cc
|
| diff --git a/chrome/browser/extensions/api/tab_capture/offscreen_presentation.cc b/chrome/browser/extensions/api/tab_capture/offscreen_presentation.cc
|
| index 1e8e2d1e9dd1fbf837afdfef61bab4bd8b52cb92..7b28ce9bd9b8262cf2765d2590ab012409d6fd92 100644
|
| --- a/chrome/browser/extensions/api/tab_capture/offscreen_presentation.cc
|
| +++ b/chrome/browser/extensions/api/tab_capture/offscreen_presentation.cc
|
| @@ -381,14 +381,12 @@ void OffscreenPresentation::RequestMediaAccessPermission(
|
| // WebContents.
|
| content::BrowserContext* const extension_browser_context =
|
| owner_->extension_web_contents()->GetBrowserContext();
|
| - std::string extension_id;
|
| - for (const ExtensionHost* host :
|
| - ProcessManager::Get(extension_browser_context)->background_hosts()) {
|
| - if (host->host_contents() == owner_->extension_web_contents()) {
|
| - extension_id = host->extension_id();
|
| - break;
|
| - }
|
| - }
|
| + const extensions::Extension* const extension =
|
| + ProcessManager::Get(extension_browser_context)->
|
| + GetExtensionForWebContents(owner_->extension_web_contents());
|
| + const std::string extension_id = extension ? extension->id() : "";
|
| + LOG_IF(DFATAL, extension_id.empty())
|
| + << "Extension that started this OffscreenPresentation was not found.";
|
|
|
| // If verified, allow any tab capture audio/video devices that were requested.
|
| extensions::TabCaptureRegistry* const tab_capture_registry =
|
|
|