OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "sync/test/fake_server/fake_server_entity.h" | 5 #include "sync/test/fake_server/fake_server_entity.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/guid.h" | 12 #include "base/guid.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
18 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
19 #include "net/base/net_errors.h" | 19 #include "net/base/net_errors.h" |
20 #include "net/http/http_status_code.h" | 20 #include "net/http/http_status_code.h" |
21 #include "sync/internal_api/public/base/model_type.h" | 21 #include "sync/internal_api/public/base/model_type.h" |
22 #include "sync/protocol/sync.pb.h" | 22 #include "sync/protocol/sync.pb.h" |
23 | 23 |
24 using std::string; | 24 using std::string; |
25 using std::vector; | 25 using std::vector; |
26 | 26 |
27 using syncer::ModelType; | 27 using syncer::ModelType; |
28 | 28 |
29 // The separator used when formatting IDs. | 29 // The separator used when formatting IDs. |
30 const char kIdSeparator[] = "/"; | 30 // |
| 31 // We chose the underscore character because it doesn't conflict with the |
| 32 // special characters used by base/base64.h's encoding, which is also used in |
| 33 // the construction of some IDs. |
| 34 const char kIdSeparator[] = "_"; |
31 | 35 |
32 namespace fake_server { | 36 namespace fake_server { |
33 | 37 |
34 FakeServerEntity::~FakeServerEntity() { } | 38 FakeServerEntity::~FakeServerEntity() { } |
35 | 39 |
36 const std::string& FakeServerEntity::GetId() const { | 40 const std::string& FakeServerEntity::GetId() const { |
37 return id_; | 41 return id_; |
38 } | 42 } |
39 | 43 |
40 ModelType FakeServerEntity::GetModelType() const { | 44 ModelType FakeServerEntity::GetModelType() const { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 sync_entity->set_id_string(id_); | 102 sync_entity->set_id_string(id_); |
99 sync_entity->set_version(version_); | 103 sync_entity->set_version(version_); |
100 sync_entity->set_name(name_); | 104 sync_entity->set_name(name_); |
101 | 105 |
102 // Data via accessors | 106 // Data via accessors |
103 sync_entity->set_deleted(IsDeleted()); | 107 sync_entity->set_deleted(IsDeleted()); |
104 sync_entity->set_folder(IsFolder()); | 108 sync_entity->set_folder(IsFolder()); |
105 } | 109 } |
106 | 110 |
107 } // namespace fake_server | 111 } // namespace fake_server |
OLD | NEW |