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

Unified Diff: chrome/browser/sync/util/shared_value.h

Issue 7904021: [Sync] Rework SharedValue<T> into Immutable<T> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 3 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 | « chrome/browser/sync/util/immutable_unittest.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/util/shared_value.h
diff --git a/chrome/browser/sync/util/shared_value.h b/chrome/browser/sync/util/shared_value.h
deleted file mode 100644
index bd127545becc78f1f4f9166c54e4a0df7300d8fc..0000000000000000000000000000000000000000
--- a/chrome/browser/sync/util/shared_value.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) 2011 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 CHROME_BROWSER_SYNC_UTIL_SHARED_VALUE_H_
-#define CHROME_BROWSER_SYNC_UTIL_SHARED_VALUE_H_
-#pragma once
-
-#include "base/memory/ref_counted.h"
-
-namespace browser_sync {
-
-template <class ValueType>
-struct HasSwapMemFnTraits {
- static void Swap(ValueType* t1, ValueType* t2) {
- t1->Swap(t2);
- }
-};
-
-// A ref-counted thread-safe wrapper around an immutable value.
-template <class ValueType, class Traits>
-class SharedValue
- : public base::RefCountedThreadSafe<SharedValue<ValueType, Traits> > {
- public:
- SharedValue() {}
- // Takes over the data in |value|, leaving |value| empty.
- explicit SharedValue(ValueType* value) {
- Traits::Swap(&value_, value);
- }
-
- const ValueType& Get() const {
- return value_;
- }
-
- private:
- ~SharedValue() {}
- friend class base::RefCountedThreadSafe<SharedValue<ValueType, Traits> >;
-
- ValueType value_;
-};
-
-} // namespace browser_sync
-
-#endif // CHROME_BROWSER_SYNC_UTIL_SHARED_VALUE_H_
« no previous file with comments | « chrome/browser/sync/util/immutable_unittest.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698