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

Side by Side Diff: ios/chrome/browser/web/tab_id_tab_helper.h

Issue 2956483003: [ios] TabIdTabHelper (Closed)
Patch Set: Refactor Tab to use TabIDTabHelper. Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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 IOS_CHROME_BROWSER_WEB_TAB_ID_TAB_HELPER_H_
6 #define IOS_CHROME_BROWSER_WEB_TAB_ID_TAB_HELPER_H_
7
8 #include "base/macros.h"
9 #import "ios/web/public/web_state/web_state_user_data.h"
10
11 // The type of the unique identifier.
12 typedef std::string TabID;
rohitrao (ping after 24h) 2017/06/23 11:10:27 Is there a reason to put this behind a TabID typed
edchin 2017/06/23 16:24:21 Agree that in practice it does not provide any ben
13
14 // Handles creating a TabID, which is stable across cold starts.
15 class TabIDTabHelper : public web::WebStateUserData<TabIDTabHelper> {
16 public:
17 ~TabIDTabHelper() override;
18
19 // Returns the TabID for this tab.
20 const TabID& tab_id() const { return tab_id_; }
21
22 private:
23 explicit TabIDTabHelper(web::WebState* web_state);
24 friend class web::WebStateUserData<TabIDTabHelper>;
25 TabID tab_id_;
26
27 DISALLOW_COPY_AND_ASSIGN(TabIDTabHelper);
28 };
29
30 #endif // IOS_CHROME_BROWSER_WEB_TAB_ID_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698