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

Side by Side Diff: chrome/browser/sync/syncable/syncable_id.cc

Issue 7822008: [Sync] Remove static initializers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/syncable/syncable_id.h ('k') | no next file » | 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) 2011 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 #include "chrome/browser/sync/syncable/syncable_id.h" 5 #include "chrome/browser/sync/syncable/syncable_id.h"
6 6
7 #include <iosfwd> 7 #include <iosfwd>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 11
12 using std::ostream; 12 using std::ostream;
13 using std::string; 13 using std::string;
14 14
15 namespace syncable { 15 namespace syncable {
16 const Id kNullId; // Currently == root.
17 16
18 ostream& operator<<(ostream& out, const Id& id) { 17 ostream& operator<<(ostream& out, const Id& id) {
19 out << id.s_; 18 out << id.s_;
20 return out; 19 return out;
21 } 20 }
22 21
23 StringValue* Id::ToValue() const { 22 StringValue* Id::ToValue() const {
24 return Value::CreateStringValue(s_); 23 return Value::CreateStringValue(s_);
25 } 24 }
26 25
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return StringToLowerASCII(s_).find(lowercase_query) != std::string::npos; 63 return StringToLowerASCII(s_).find(lowercase_query) != std::string::npos;
65 } 64 }
66 65
67 // static 66 // static
68 Id Id::GetLeastIdForLexicographicComparison() { 67 Id Id::GetLeastIdForLexicographicComparison() {
69 Id id; 68 Id id;
70 id.s_.clear(); 69 id.s_.clear();
71 return id; 70 return id;
72 } 71 }
73 72
73 Id GetNullId() {
74 return Id(); // Currently == root.
75 }
76
74 } // namespace syncable 77 } // namespace syncable
OLDNEW
« no previous file with comments | « chrome/browser/sync/syncable/syncable_id.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698