• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef SYNC_TEST_FAKE_SERVER_ENTITY_BUILDER_H_
6 #define SYNC_TEST_FAKE_SERVER_ENTITY_BUILDER_H_
7 
8 #include <string>
9 
10 #include "base/memory/scoped_ptr.h"
11 #include "sync/internal_api/public/base/model_type.h"
12 #include "sync/test/fake_server/fake_server_entity.h"
13 #include "url/gurl.h"
14 
15 namespace fake_server {
16 
17 // Parent class for FakeServerEntity builders.
18 class EntityBuilder {
19  public:
20   virtual ~EntityBuilder();
21 
22   // Builds a FakeServerEntity and returns a scoped_ptr tht owns it. If building
23   // was not successful, the returned scoped_ptr will not own a
24   // FakeServerEntity*.
25   virtual scoped_ptr<FakeServerEntity> Build() = 0;
26 
27  protected:
28   EntityBuilder(syncer::ModelType model_type, const std::string& name);
29 
30   std::string id_;
31   syncer::ModelType model_type_;
32   std::string name_;
33 };
34 
35 }  // namespace fake_server
36 
37 #endif  // SYNC_TEST_FAKE_SERVER_ENTITY_BUILDER_H_
38