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

Unified Diff: chrome/browser/image_decoder.cc

Issue 1041043008: Catch utility process StartBatchMode failures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments in header Created 5 years, 9 months 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 | « chrome/browser/image_decoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/image_decoder.cc
diff --git a/chrome/browser/image_decoder.cc b/chrome/browser/image_decoder.cc
index cfd887e06a9f4454330f9cd7e4d102506a1d78f3..9e21662088f5ab09a5cd61b71057da235bb6fe24 100644
--- a/chrome/browser/image_decoder.cc
+++ b/chrome/browser/image_decoder.cc
@@ -80,6 +80,16 @@ void ImageDecoder::DecodeImageInSandbox(
if (!utility_process_host_) {
StartBatchMode();
}
+ if (!utility_process_host_) {
+ // Utility process failed to start; notify delegate and return.
+ // Without this check, we were seeing crashes on startup. Further
+ // investigation is needed to determine why the utility process
+ // is failing to start. See crbug.com/472272
+ image_request->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&ImageRequest::OnDecodeImageFailed,
+ base::Unretained(image_request)));
+ return;
+ }
last_request_ = base::TimeTicks::Now();
base::AutoLock lock(map_lock_);
@@ -117,7 +127,10 @@ void ImageDecoder::StartBatchMode() {
utility_process_host_ =
UtilityProcessHost::Create(this, base::MessageLoopProxy::current().get())
->AsWeakPtr();
- utility_process_host_->StartBatchMode();
+ if (!utility_process_host_->StartBatchMode()) {
+ utility_process_host_.reset();
+ return;
+ }
batch_mode_timer_.Start(
FROM_HERE, base::TimeDelta::FromSeconds(kBatchModeTimeoutSeconds),
this, &ImageDecoder::StopBatchMode);
« no previous file with comments | « chrome/browser/image_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698