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

Unified Diff: ios/chrome/browser/web/tab_id_tab_helper.h

Issue 2956483003: [ios] TabIdTabHelper (Closed)
Patch Set: Additional unit tests and other edits. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/web/BUILD.gn ('k') | ios/chrome/browser/web/tab_id_tab_helper.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/web/tab_id_tab_helper.h
diff --git a/ios/chrome/browser/web/tab_id_tab_helper.h b/ios/chrome/browser/web/tab_id_tab_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..f70e85027302d203fd382478b39f1042d408c181
--- /dev/null
+++ b/ios/chrome/browser/web/tab_id_tab_helper.h
@@ -0,0 +1,27 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_WEB_TAB_ID_TAB_HELPER_H_
+#define IOS_CHROME_BROWSER_WEB_TAB_ID_TAB_HELPER_H_
+
+#include "base/macros.h"
+#import "ios/web/public/web_state/web_state_user_data.h"
+
+// Handles creating a unique identifier, which is stable across cold starts.
+class TabIdTabHelper : public web::WebStateUserData<TabIdTabHelper> {
+ public:
+ ~TabIdTabHelper() override;
+
+ // Returns a unique identifier for this tab.
+ NSString* tab_id() const { return tab_id_; }
+
+ private:
+ friend class web::WebStateUserData<TabIdTabHelper>;
+ explicit TabIdTabHelper(web::WebState* web_state);
+ __strong NSString* tab_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(TabIdTabHelper);
+};
+
+#endif // IOS_CHROME_BROWSER_WEB_TAB_ID_TAB_HELPER_H_
« no previous file with comments | « ios/chrome/browser/web/BUILD.gn ('k') | ios/chrome/browser/web/tab_id_tab_helper.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698