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

Side by Side Diff: components/translate/core/browser/ranker_model.h

Issue 2925733002: Move ranker_model_loader to a new component. (Closed)
Patch Set: Adressing sdefresne's comments. Created 3 years, 5 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
OLDNEW
(Empty)
1 // Copyright 2017 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 COMPONENTS_TRANSLATE_CORE_BROWSER_RANKER_MODEL_H_
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_RANKER_MODEL_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/macros.h"
12
13 namespace chrome_intelligence {
14
15 class RankerModelProto;
16
17 // Wrapper class for chrome_intelligence::TranslateRankerProto.
18 class RankerModel {
19 public:
20 RankerModel();
21 ~RankerModel();
22
23 // Returns a new ranker model constructed from |data|.
24 static std::unique_ptr<RankerModel> FromString(const std::string& data);
25
26 const RankerModelProto& proto() const { return *proto_; }
27 RankerModelProto* mutable_proto() const { return proto_.get(); }
28
29 // Returns true if this ranker model has expired.
30 bool IsExpired() const;
31
32 const std::string& GetSourceURL() const;
33
34 // Returns a serialization of this ranker model.
35 std::string SerializeAsString() const;
36
37 private:
38 // The underlying ranker model proto.
39 std::unique_ptr<RankerModelProto> proto_;
40
41 DISALLOW_COPY_AND_ASSIGN(RankerModel);
42 };
43
44 } // namesapce chrome_intelligence
45
46 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_RANKER_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698