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

Unified Diff: chrome/service/cloud_print/printer_job_handler.cc

Issue 10021067: Merge 132283 - Fix a crash if GetPrinterCapsAndDefaults returns after the calling printer is delete… (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: Created 8 years, 8 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/service/cloud_print/printer_job_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/cloud_print/printer_job_handler.cc
===================================================================
--- chrome/service/cloud_print/printer_job_handler.cc (revision 132831)
+++ chrome/service/cloud_print/printer_job_handler.cc (working copy)
@@ -54,7 +54,8 @@
shutting_down_(false),
job_check_pending_(false),
printer_update_pending_(true),
- task_in_progress_(false) {
+ task_in_progress_(false),
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
}
bool PrinterJobHandler::Initialize() {
@@ -169,7 +170,7 @@
print_system_->GetPrinterCapsAndDefaults(
printer_info.printer_name.c_str(),
base::Bind(&PrinterJobHandler::OnReceivePrinterCaps,
- base::Unretained(this)));
+ weak_ptr_factory_.GetWeakPtr()));
// While we are waiting for the data, pretend we have work to do and return
// true.
« no previous file with comments | « chrome/service/cloud_print/printer_job_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698