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

Side by Side Diff: chrome/browser/ui/cocoa/has_weak_browser_pointer.h

Issue 1221173003: [Mac] Inform reference counted objects that hold a weak Browser* when the Browser is being destroye… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add HasWeakBrowserPointer protocol. Allow -dealloc without preceding -browserWillBeDestroyed. Created 5 years, 5 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_COCOA_HAS_WEAK_BROWSER_POINTER_H_
6 #define CHROME_BROWSER_UI_COCOA_HAS_WEAK_BROWSER_POINTER_H_
7
8 // This allows reference counted objects holding a Browser* to be
9 // notified that the Browser will be destroyed so they can invalidate their
10 // Browser*, perform any necessary cleanup, and pass the notification onto any
11 // objects they retain that also implement this protocol. This helps to prevent
12 // use-after-free of Browser*, or anything else tied to the Browser's lifetime,
13 // by objects that may be retained beyond the lifetime of their associated
14 // Browser (e.g. NSViewControllers).
15 @protocol HasWeakBrowserPointer
16 @required
17 // This is usually called by BrowserWindowController but can be called by any
18 // object that's certain of Browser's destruction.
19 - (void)browserWillBeDestroyed;
20 @end
21
22 #endif // CHROME_BROWSER_UI_COCOA_HAS_WEAK_BROWSER_POINTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698