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

Side by Side Diff: sync/util/immutable.h

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « sync/util/get_session_name_win.cc ('k') | sync/util/immutable_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Immutable<T> provides an easy, cheap, and thread-safe way to pass 5 // Immutable<T> provides an easy, cheap, and thread-safe way to pass
6 // large immutable data around. 6 // large immutable data around.
7 // 7 //
8 // For example, consider the following code: 8 // For example, consider the following code:
9 // 9 //
10 // typedef std::vector<LargeObject> LargeObjectList; 10 // typedef std::vector<LargeObject> LargeObjectList;
11 // 11 //
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // for discussion) Immutable<T> should be able to find it. 55 // for discussion) Immutable<T> should be able to find it.
56 // 56 //
57 // Alternatively, you could explicitly control which swap function is 57 // Alternatively, you could explicitly control which swap function is
58 // used by providing your own traits class or using one of the 58 // used by providing your own traits class or using one of the
59 // pre-defined ones below. See comments on traits below for details. 59 // pre-defined ones below. See comments on traits below for details.
60 // 60 //
61 // NOTE: Some complexity is necessary in order to use Immutable<T> 61 // NOTE: Some complexity is necessary in order to use Immutable<T>
62 // with forward-declared types. See comments on traits below for 62 // with forward-declared types. See comments on traits below for
63 // details. 63 // details.
64 64
65 #ifndef CHROME_BROWSER_SYNC_UTIL_IMMUTABLE_H_ 65 #ifndef SYNC_UTIL_IMMUTABLE_H_
66 #define CHROME_BROWSER_SYNC_UTIL_IMMUTABLE_H_ 66 #define SYNC_UTIL_IMMUTABLE_H_
67 #pragma once 67 #pragma once
68 68
69 // For std::swap(). 69 // For std::swap().
70 #include <algorithm> 70 #include <algorithm>
71 71
72 #include "base/basictypes.h" 72 #include "base/basictypes.h"
73 #include "base/memory/ref_counted.h" 73 #include "base/memory/ref_counted.h"
74 74
75 namespace browser_sync { 75 namespace browser_sync {
76 76
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 }; 252 };
253 253
254 // Helper function to avoid having to write out template arguments. 254 // Helper function to avoid having to write out template arguments.
255 template <typename T> 255 template <typename T>
256 Immutable<T> MakeImmutable(T* t) { 256 Immutable<T> MakeImmutable(T* t) {
257 return Immutable<T>(t); 257 return Immutable<T>(t);
258 } 258 }
259 259
260 } // namespace browser_sync 260 } // namespace browser_sync
261 261
262 #endif // CHROME_BROWSER_SYNC_UTIL_IMMUTABLE_H_ 262 #endif // SYNC_UTIL_IMMUTABLE_H_
OLDNEW
« no previous file with comments | « sync/util/get_session_name_win.cc ('k') | sync/util/immutable_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698