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

Unified Diff: chrome/browser/printing/background_printing_manager.cc

Issue 7104074: Attempt at fixing crash. It looks like the printing code can delete (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another comment tweak Created 9 years, 6 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 | « no previous file | chrome/browser/printing/print_view_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/background_printing_manager.cc
diff --git a/chrome/browser/printing/background_printing_manager.cc b/chrome/browser/printing/background_printing_manager.cc
index 997fab79874f0e71d91c4314d38ad3807b8761e6..e36e811828fe3c280545c8a4f2a92bbe17f4bd10 100644
--- a/chrome/browser/printing/background_printing_manager.cc
+++ b/chrome/browser/printing/background_printing_manager.cc
@@ -36,7 +36,7 @@ void BackgroundPrintingManager::OwnTabContents(TabContentsWrapper* contents) {
printing_contents_.insert(contents);
registrar_.Add(this, NotificationType::PRINT_JOB_RELEASED,
- Source<TabContents>(contents->tab_contents()));
+ Source<TabContentsWrapper>(contents));
registrar_.Add(this, NotificationType::TAB_CONTENTS_DESTROYED,
Source<TabContents>(contents->tab_contents()));
@@ -65,18 +65,20 @@ void BackgroundPrintingManager::Observe(NotificationType type,
case NotificationType::PRINT_JOB_RELEASED: {
// This might be happening in the middle of a RenderViewGone() loop.
// Deleting |contents| later so the RenderViewGone() loop can finish.
- MessageLoop::current()->DeleteSoon(FROM_HERE,
- Source<TabContents>(source).ptr());
+ MessageLoop::current()->DeleteSoon(
+ FROM_HERE,
+ Source<TabContentsWrapper>(source).ptr());
break;
}
case NotificationType::TAB_CONTENTS_DESTROYED: {
- TabContents* contents = Source<TabContents>(source).ptr();
+ TabContentsWrapper* tab =
+ TabContentsWrapper::GetCurrentWrapperForContents(
+ Source<TabContents>(source).ptr());
registrar_.Remove(this, NotificationType::PRINT_JOB_RELEASED,
- Source<TabContents>(contents));
+ Source<TabContentsWrapper>(tab));
registrar_.Remove(this, NotificationType::TAB_CONTENTS_DESTROYED,
- Source<TabContents>(contents));
- printing_contents_.erase(
- TabContentsWrapper::GetCurrentWrapperForContents(contents));
+ Source<TabContents>(tab->tab_contents()));
+ printing_contents_.erase(tab);
break;
}
default: {
« no previous file with comments | « no previous file | chrome/browser/printing/print_view_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698