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/entity_builder_factory.h" | 5 #include "components/sync/test/fake_server/entity_builder_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "sync/test/fake_server/bookmark_entity_builder.h" | 11 #include "components/sync/test/fake_server/bookmark_entity_builder.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 using std::string; | 14 using std::string; |
15 | 15 |
16 namespace fake_server { | 16 namespace fake_server { |
17 | 17 |
18 EntityBuilderFactory::EntityBuilderFactory() | 18 EntityBuilderFactory::EntityBuilderFactory() |
19 : cache_guid_(base::GenerateGUID()), latest_client_item_id_(0L) { | 19 : cache_guid_(base::GenerateGUID()), latest_client_item_id_(0L) {} |
20 } | |
21 | 20 |
22 EntityBuilderFactory::EntityBuilderFactory(const string& cache_guid) | 21 EntityBuilderFactory::EntityBuilderFactory(const string& cache_guid) |
23 : cache_guid_(cache_guid), latest_client_item_id_(0L) { | 22 : cache_guid_(cache_guid), latest_client_item_id_(0L) {} |
24 } | |
25 | 23 |
26 EntityBuilderFactory::~EntityBuilderFactory() { | 24 EntityBuilderFactory::~EntityBuilderFactory() {} |
27 } | |
28 | 25 |
29 BookmarkEntityBuilder EntityBuilderFactory::NewBookmarkEntityBuilder( | 26 BookmarkEntityBuilder EntityBuilderFactory::NewBookmarkEntityBuilder( |
30 const string& title) { | 27 const string& title) { |
31 --latest_client_item_id_; | 28 --latest_client_item_id_; |
32 BookmarkEntityBuilder builder(title, | 29 BookmarkEntityBuilder builder(title, cache_guid_, |
33 cache_guid_, | |
34 base::Int64ToString(latest_client_item_id_)); | 30 base::Int64ToString(latest_client_item_id_)); |
35 return builder; | 31 return builder; |
36 } | 32 } |
37 | 33 |
38 } // namespace fake_server | 34 } // namespace fake_server |
OLD | NEW |