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

Unified Diff: chrome/browser/chromeos/printing/cups_print_job_notification.cc

Issue 2748253005: Cleanup jobs which have failed. (Closed)
Patch Set: Created 3 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
Index: chrome/browser/chromeos/printing/cups_print_job_notification.cc
diff --git a/chrome/browser/chromeos/printing/cups_print_job_notification.cc b/chrome/browser/chromeos/printing/cups_print_job_notification.cc
index 25eba1000b58d425a1a7a6bae4254250f8477071..d2be94c070de6e9284a2acdf1d2836a4ddf52483 100644
--- a/chrome/browser/chromeos/printing/cups_print_job_notification.cc
+++ b/chrome/browser/chromeos/printing/cups_print_job_notification.cc
@@ -117,13 +117,15 @@ void CupsPrintJobNotification::ClickOnNotificationButton(int button_index) {
switch (button_command) {
case ButtonCommand::CANCEL_PRINTING:
- if (print_job_manager->CancelPrintJob(print_job_)) {
- // only clean up the nofitication if cancel was successful.
- g_browser_process->notification_ui_manager()->CancelById(
- GetNotificationId(), profile_id);
- cancelled_by_user_ = true;
- notification_manager_->OnPrintJobNotificationRemoved(this);
- }
+ print_job_manager->CancelPrintJob(print_job_);
+ // print_job_ may be deleted by print_job_manager after cancellation.
Carlson 2017/03/16 18:36:48 I don't understand what this comment means. That
skau 2017/03/16 22:14:36 It was supposed to mean that print_job_ is deleted
+ print_job_ = nullptr;
+
+ // only clean up the nofitication if cancel was successful.
+ g_browser_process->notification_ui_manager()->CancelById(
+ GetNotificationId(), profile_id);
+ cancelled_by_user_ = true;
+ notification_manager_->OnPrintJobNotificationRemoved(this);
break;
case ButtonCommand::PAUSE_PRINTING:
print_job_manager->SuspendPrintJob(print_job_);

Powered by Google App Engine
This is Rietveld 408576698