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

Side by Side Diff: components/machine_intelligence/ranker_model.cc

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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 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 "components/translate/core/browser/ranker_model.h" 5 #include "components/machine_intelligence/ranker_model.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "components/translate/core/browser/proto/ranker_model.pb.h" 9 #include "components/machine_intelligence/proto/ranker_model.pb.h"
10 10
11 namespace chrome_intelligence { 11 namespace machine_intelligence {
12 12
13 RankerModel::RankerModel() : proto_(base::MakeUnique<RankerModelProto>()) {} 13 RankerModel::RankerModel() : proto_(base::MakeUnique<RankerModelProto>()) {}
14 14
15 RankerModel::~RankerModel() {} 15 RankerModel::~RankerModel() {}
16 16
17 // static 17 // static
18 std::unique_ptr<RankerModel> RankerModel::FromString(const std::string& data) { 18 std::unique_ptr<RankerModel> RankerModel::FromString(const std::string& data) {
19 auto model = base::MakeUnique<RankerModel>(); 19 auto model = base::MakeUnique<RankerModel>();
20 if (!model->mutable_proto()->ParseFromString(data)) 20 if (!model->mutable_proto()->ParseFromString(data))
21 return nullptr; 21 return nullptr;
(...skipping 22 matching lines...) Expand all
44 } 44 }
45 45
46 const std::string& RankerModel::GetSourceURL() const { 46 const std::string& RankerModel::GetSourceURL() const {
47 return proto_->metadata().source(); 47 return proto_->metadata().source();
48 } 48 }
49 49
50 std::string RankerModel::SerializeAsString() const { 50 std::string RankerModel::SerializeAsString() const {
51 return proto_->SerializeAsString(); 51 return proto_->SerializeAsString();
52 } 52 }
53 53
54 } // namespace chrome_intelligence 54 } // namespace machine_intelligence
OLDNEW
« no previous file with comments | « components/machine_intelligence/ranker_model.h ('k') | components/machine_intelligence/ranker_model_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698