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

Side by Side Diff: chrome/browser/google/google_url_tracker_map_entry.cc

Issue 11366075: Merge 165468 - Fix a crash that could occur if the user closed a tab with an uncommitted search nav… (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/google/google_url_tracker_map_entry.h" 5 #include "chrome/browser/google/google_url_tracker_map_entry.h"
6 6
7 #include "chrome/browser/google/google_url_tracker.h" 7 #include "chrome/browser/google/google_url_tracker.h"
8 #include "chrome/browser/google/google_url_tracker_infobar_delegate.h" 8 #include "chrome/browser/google/google_url_tracker_infobar_delegate.h"
9 #include "chrome/browser/infobars/infobar.h" 9 #include "chrome/browser/infobars/infobar.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
(...skipping 29 matching lines...) Expand all
40 40
41 void GoogleURLTrackerMapEntry::SetInfoBar( 41 void GoogleURLTrackerMapEntry::SetInfoBar(
42 GoogleURLTrackerInfoBarDelegate* infobar) { 42 GoogleURLTrackerInfoBarDelegate* infobar) {
43 DCHECK(!infobar_); 43 DCHECK(!infobar_);
44 infobar_ = infobar; 44 infobar_ = infobar;
45 registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, 45 registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
46 content::Source<InfoBarTabHelper>(infobar_helper_)); 46 content::Source<InfoBarTabHelper>(infobar_helper_));
47 } 47 }
48 48
49 void GoogleURLTrackerMapEntry::Close(bool redo_search) { 49 void GoogleURLTrackerMapEntry::Close(bool redo_search) {
50 if (infobar_) 50 if (infobar_) {
51 infobar_->Close(redo_search); 51 infobar_->Close(redo_search);
52 else 52 } else {
53 // WARNING: |infobar_helper_| may point to a deleted object. Do not
54 // dereference it! See GoogleURLTracker::OnTabClosed().
53 google_url_tracker_->DeleteMapEntryForHelper(infobar_helper_); 55 google_url_tracker_->DeleteMapEntryForHelper(infobar_helper_);
56 }
54 // WARNING: At this point |this| has been deleted! 57 // WARNING: At this point |this| has been deleted!
55 } 58 }
OLDNEW
« no previous file with comments | « chrome/browser/google/google_url_tracker.cc ('k') | chrome/browser/google/google_url_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698