ServiceWorker: Consolidate version manipulation functions in SWProviderContext
[chromium-blink-merge.git] / sync / test / fake_server / entity_builder_factory.cc
bloba8f3d9e9de74591ad3a2dfb379fe5bc82c128ec6
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
3 // found in the LICENSE file.
5 #include "sync/test/fake_server/entity_builder_factory.h"
7 #include <string>
9 #include "base/guid.h"
10 #include "base/strings/string_number_conversions.h"
11 #include "sync/test/fake_server/bookmark_entity_builder.h"
12 #include "url/gurl.h"
14 using std::string;
16 namespace fake_server {
18 EntityBuilderFactory::EntityBuilderFactory()
19 : cache_guid_(base::GenerateGUID()), latest_client_item_id_(0L) {
22 EntityBuilderFactory::EntityBuilderFactory(const string& cache_guid)
23 : cache_guid_(cache_guid), latest_client_item_id_(0L) {
26 EntityBuilderFactory::~EntityBuilderFactory() {
29 BookmarkEntityBuilder EntityBuilderFactory::NewBookmarkEntityBuilder(
30 const string& title, const GURL& url) {
31 --latest_client_item_id_;
32 BookmarkEntityBuilder builder(title,
33 url,
34 cache_guid_,
35 base::Int64ToString(latest_client_item_id_));
36 return builder;
39 } // namespace fake_server