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

Unified Diff: ios/shared/chrome/browser/tabs/web_state_list.h

Issue 2710183003: Fix WebStateListObserver::WebStateDetachedAt() parameter lifetime. (Closed)
Patch Set: Created 3 years, 10 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
Index: ios/shared/chrome/browser/tabs/web_state_list.h
diff --git a/ios/shared/chrome/browser/tabs/web_state_list.h b/ios/shared/chrome/browser/tabs/web_state_list.h
index 3916076b3662eacfd423ba32515e8db9b5c1259b..09eb4683e9bdc829946144002d43888c3cc593ae 100644
--- a/ios/shared/chrome/browser/tabs/web_state_list.h
+++ b/ios/shared/chrome/browser/tabs/web_state_list.h
@@ -8,6 +8,7 @@
#include <memory>
#include <vector>
+#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/observer_list.h"
@@ -85,10 +86,11 @@ class WebStateList {
// returned WebState). An optional opener for the new WebState may be passed.
web::WebState* ReplaceWebStateAt(int index,
web::WebState* web_state,
- web::WebState* opener);
+ web::WebState* opener) WARN_UNUSED_RESULT;
- // Detaches the WebState at the specified index.
- void DetachWebStateAt(int index);
+ // Detaches the WebState at the specified index. Returns the detached WebState
+ // to the caller (abandon ownership of the returned WebState).
+ web::WebState* DetachWebStateAt(int index) WARN_UNUSED_RESULT;
// Adds an observer to the model.
void AddObserver(WebStateListObserver* observer);

Powered by Google App Engine
This is Rietveld 408576698