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

Side by Side Diff: chrome/browser/infobars/infobar_tab_helper.cc

Issue 11085055: Make the WebContentsUserData locator key private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, catch more uses of the key Created 8 years, 2 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 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/infobars/infobar_tab_helper.h" 5 #include "chrome/browser/infobars/infobar_tab_helper.h"
6 6
7 #include "chrome/browser/api/infobars/infobar_delegate.h" 7 #include "chrome/browser/api/infobars/infobar_delegate.h"
8 #include "chrome/browser/infobars/infobar.h" 8 #include "chrome/browser/infobars/infobar.h"
9 #include "chrome/browser/infobars/insecure_content_infobar_delegate.h" 9 #include "chrome/browser/infobars/insecure_content_infobar_delegate.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 212 }
213 213
214 return; 214 return;
215 } 215 }
216 216
217 DCHECK_EQ(type, content::NOTIFICATION_WEB_CONTENTS_DESTROYED); 217 DCHECK_EQ(type, content::NOTIFICATION_WEB_CONTENTS_DESTROYED);
218 // The WebContents is going away; be aggressively paranoid and delete 218 // The WebContents is going away; be aggressively paranoid and delete
219 // ourselves lest other parts of the system attempt to add infobars or use 219 // ourselves lest other parts of the system attempt to add infobars or use
220 // us otherwise during the destruction. 220 // us otherwise during the destruction.
221 DCHECK_EQ(web_contents(), content::Source<WebContents>(source).ptr()); 221 DCHECK_EQ(web_contents(), content::Source<WebContents>(source).ptr());
222 web_contents()->RemoveUserData(&kLocatorKey); 222 web_contents()->RemoveUserData(UserDataKey());
223 // That was the equivalent of "delete this". This object is now destroyed; 223 // That was the equivalent of "delete this". This object is now destroyed;
224 // returning from this function is the only safe thing to do. 224 // returning from this function is the only safe thing to do.
225 return; 225 return;
226 } 226 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698