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

Unified Diff: ios/public/consumer/base/supports_user_data.h

Issue 781643004: Cleanup WebState and WebStateUserData API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra destructor Created 6 years 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/ios_tests_unit.gyp ('k') | ios/public/provider/web/web_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/public/consumer/base/supports_user_data.h
diff --git a/ios/public/consumer/base/supports_user_data.h b/ios/public/consumer/base/supports_user_data.h
deleted file mode 100644
index 5986c57def848909d981a9b2f013867aaa13364b..0000000000000000000000000000000000000000
--- a/ios/public/consumer/base/supports_user_data.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2013 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_PUBLIC_CONSUMER_BASE_SUPPORTS_USER_DATA_H_
-#define IOS_PUBLIC_CONSUMER_BASE_SUPPORTS_USER_DATA_H_
-
-namespace ios {
-
-class SupportsUserDataInternal;
-
-// This is a helper for classes that want to allow users to stash random data by
-// key. At destruction all the objects will be destructed.
-class SupportsUserData {
- public:
- SupportsUserData();
-
- // Derive from this class and add your own data members to associate extra
- // information with this object. Alternatively, add this as a public base
- // class to any class with a virtual destructor.
- class Data {
- public:
- virtual ~Data() {}
- };
-
- // The user data allows the clients to associate data with this object.
- // Multiple user data values can be stored under different keys.
- // This object will TAKE OWNERSHIP of the given data pointer, and will
- // delete the object if it is changed or the object is destroyed.
- Data* GetUserData(const void* key) const;
- void SetUserData(const void* key, Data* data);
- void RemoveUserData(const void* key);
-
- // SupportsUserData is not thread-safe, and on debug build will assert it is
- // only used on one thread. Calling this method allows the caller to hand
- // the SupportsUserData instance across threads. Use only if you are taking
- // full control of the synchronization of that handover.
- void DetachUserDataThread();
-
- protected:
- virtual ~SupportsUserData();
-
- private:
- // Owned by this object and scoped to its lifetime.
- SupportsUserDataInternal* internal_helper_;
-};
-
-} // namespace ios
-
-#endif // IOS_PUBLIC_CONSUMER_BASE_SUPPORTS_USER_DATA_H_
« no previous file with comments | « ios/ios_tests_unit.gyp ('k') | ios/public/provider/web/web_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698