Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6842)

Unified Diff: chrome/browser/extensions/api/media_galleries/media_galleries_api.cc

Issue 2570903002: Media Galleries: Fix render-process-gone case in GetMetadata call (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
index 492f8da62a959656cc538b9502ba941d736e4dc5..d5d062629d2eb08ed1e8e26994ff41f5fd5ef733 100644
--- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
+++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
@@ -752,9 +752,16 @@ void MediaGalleriesGetMetadataFunction::ConstructNextBlob(
attached_images_list->Append(std::move(attached_image));
blob_uuids->push_back(current_blob->GetUUID());
+
+ content::RenderProcessHost* render_process_host =
+ render_frame_host()->GetProcess();
+ if (!render_process_host) {
+ SendResponse(false);
+ return;
+ }
+
extensions::BlobHolder* holder =
- extensions::BlobHolder::FromRenderProcessHost(
- render_frame_host()->GetProcess());
+ extensions::BlobHolder::FromRenderProcessHost(render_process_host);
holder->HoldBlobReference(std::move(current_blob));
// Construct the next Blob if necessary.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698